Requirements:
- YouTube-Agent.Bundle
- Absolute Series Scanner
- Youtube-DL
- Channel ID or Playlist ID of Channel
- YouTube Data API Key (free)
- Download https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/Scanners/Series/Absolute%20Series%20Scanner.py
- Create a new folder called Scanners:
.../Plex Media Server/Scanners
- Create a folder underneat that called Series:
.../Plex Media Server/Scanners/Series
- Save python script to:
.../Plex Media Server/Scanners/Series/Absolute Series Scanner.py
- Make sure
Absolute Series Scanner.py
has read/write permissions (chmod +x Absolute Series Scanner.py
) - Download YouTube-Agent.Bundle and install to Plugin folder. Link to Plugin folders.
- Restart Plex.
- Create new TV Library called
YouTube
. I have it setup at the root of my Media:
/Movies
/YouTube <--- Folder here
/4KMovies
/4KTV
- Set Scanner as
Absolute Series Scanner
- Set Agent as
YouTubeSeries
- Create a YouTube Data API key and apply it under YouTube API Key: Link to creating YouTube API Key
- Create a file called
youtube-dl-seen.conf
anywhere thatyoutube-dl
can read from. This will allow YouTube DL to skip already downloaded files. I placed mine at~/.cache/youtube-dl/youtube-dl-seen.conf
- Using
youtube-dl
, create or use a script download to the appropriate place, assuming/youtube
is the root of your YouTube media. Here's mine that I use to automatically download all videos from Blippi and BuySellshort channels uploaded within the last week - Once done, re-scan Plex Library, and if all is well, you should see YouTube videos with metadata.
PowerShell:
$array = @(
## Blippi
"https://www.youtube.com/channel/UC5PYHgAzJ1wLEidB58SK6Xw",
## BuySellShort
"https://www.youtube.com/channel/UCpamFkrGa5ePxhWsDyQs74w"
)
foreach ($u in $array) {
Start-Process "youtube-dl" -ArgumentList @(
$u,
"-v",
"-i",
"--dateafter now-1week",
"--merge-output-format mp4",
"--write-info-json",
'-f "bestvideo+bestaudio[ext=m4a]/best"',
'--download-archive ~/.cache/youtube-dl/youtube-dl-seen.conf',
'--output "/YouTube/%(uploader)s [%(channel_id)s]/%(playlist_index)s - %(title)s [%(id)s].%(ext)s"'
)
}
Shell script:
array=(
"https://www.youtube.com/channel/UC5PYHgAzJ1wLEidB58SK6Xw"
"https://www.youtube.com/channel/UCpamFkrGa5ePxhWsDyQs74w"
)
for i in "${array[@]}"
do
youtube-dl "$i" \
-v \
-i \
--dateafter now-1week \
--merge-output-format mp4 \
-f "bestvideo+bestaudio[ext=m4a]/best" \
--write-info-json \
--download-archive ~/.cache/youtube-dl/youtube-dl-seen.conf \
--output "/YouTube/%(uploader)s [%(channel_id)s]/%(playlist_index)s - %(title)s [%(id)s].%(ext)s" \
--batch-file=~/.cache/youtube-dl/Channels_to_DL.txt
done