Monday, August 14, 2017

Downloaded Youtube Content On Plex

My cyberspace provider gives me uncapped information at night, but severely capped in addition to throttled during the day. For this reason, I similar to download around videos from YouTube in addition to and hence brand them accessible on my Plex server. This is peculiarly handy for my wife, who loves a sure enough pop practise channel.

Whatever your argue for putting YouTube videos on your Plex server, this is a handy guide to getting those videos on the server easily accessible.
This is a partly automated in addition to partly manual process, but I accept reached the signal where I tin give the axe import in addition to brand available the downloads for an entire channel inward a really curt timespan.

This guide assumes a span of things.

1. You are running Plex on a Linux server (though all the utilities piece of job nether Windows every bit well)
2. You know how to install utilities on your Linux server. If yous don't Google is your friend


Step 1: Install youtube-dl on your server
The instructions for installation are available on https://rg3.github.io/youtube-dl/download.html

Step 2: Create a directory for your YouTube media. We volition download the media lead into the lastly folder.

Step 3: Find the channel that yous desire to download. For channels alongside hundreds of videos, I ile to grouping the videos past times playlist, where each playlist becomes 1 flavour of the specific show.

3.1 - Visit the Playlists page for the specific channel
3.2 - Using a link clipping plugin (I run link klipper on chrome) extract all the playlist links from the page.
3.3 - Link Klipper creates a CSV file that I sanitize using Notepad ++ into a listing alongside all the playlists that I desire to download. (I run Notepad++ extensively, in addition to it's column edit fashion comes inward handy inward a bit)


Step 4: Modify the text file every bit per below:
4.1 - Add the next text to the showtime of each business inward the text file:
youtube-dl -i --yes-playlist -o './Khan\ Academy/Season 01/Khan\ Academy - S01e%(playlist_index)s - %(title)s.%(ext)s' --write-thumbnail --add-metadata --metadata-from-title '%(title)s' --xattrs --download-archive ./progress.txt -f 22

Your file should forthwith await something similar this:

Remember to alter the Season divulge on each line, hence that each playlist volition terminate upwards inward it's ain folder.

Step 5: Put the text file on your server inward the root directory of your YouTube content
I commonly merely re-create the text to the clipboard on my pc, in addition to and hence glue it into a putty session alongside VIM running.

5.1 - Open a Putty session to your server
5.2 - Navigate to your YouTube folder
5.3 - Using your favourite text editor, opened upwards a novel file called youtube.sh (or whatever.sh)
5.3 - Paste the contents of the text file containing the playlist into this novel file.
5.4 - Run the next command:
sh youtube.sh

This volition start the download, refer the files in addition to position them inward the correct folders

Step 6: Adding the content to your Plex Server
6.1 - Add a novel "TV Shows" library to your Plex Server calling it "YouTube" or any plant for you.
6.2 - Add the YouTube folder containing the downloaded YouTube content
6.3 - Under the Advanced tab, laid upwards the scanner to "Plex Series Scanner" in addition to the agent to "Personal Media Shows"

Additional Tasks:

I similar to create a overnice demonstrate poster inward photoshop, hence that the demonstrate looks bully on my server, I too manually create in addition to laid upwards a flavour poster for each season, that has the Playlist championship on the flavour poster. This makes it slowly to know what content is inward each season.