If you enjoy organizing YouTube videos into seasons and episodes for easy access, especially for educational content on Jellyfin, yt-dlp is a powerful tool for downloading entire playlists with custom naming formats. In this tutorial, we’ll cover how to download YouTube playlists and organize them into seasons like S01E01, S02E01, etc.
Before you begin, you’ll need:
yt-dlp is an open-source tool for downloading videos from YouTube and other video platforms. It’s a fork of youtube-dl with additional features and updates.
sudo apt update
sudo apt install yt-dlpAlternatively, if you have pip installed, you can install it with:
pip install yt-dlpTo download YouTube playlists and name each episode sequentially (e.g., S01E01, S02E01), you’ll need to format your yt-dlp command accordingly. Here’s how to set it up for each season.
Let’s say you have a Season 1 playlist at this URL:
https://www.youtube.com/watch?v=jpjOfK6RZPY&list=PLGnieQmILo-g0BWFpckG_Q4-MYON_Jfae
To download this playlist as S01E01, S01E02, etc., use the following command:
yt-dlp -f bestvideo+bestaudio -o 'S01E%(playlist_index)02d.%(ext)s' "https://www.youtube.com/watch?v=jpjOfK6RZPY&list=PLGnieQmILo-g0BWFpckG_Q4-MYON_Jfae"Explanation:
-f bestvideo+bestaudio tells yt-dlp to download the highest quality video and audio, then combine them.-o 'S01E%(playlist_index)02d.%(ext)s' formats the output to look like S01E01.mp4, S01E02.mp4, etc.For Season 2, use the following command with the Season 2 playlist URL:
yt-dlp -f bestvideo+bestaudio -o 'S02E%(playlist_index)02d.%(ext)s' "https://www.youtube.com/watch?v=mxGwVT2oDJ8&list=PLSW2D61TnopT7EB7TozoTfs_wEkPC3byE"To download Season 3, simply change the season number in the filename format. For the Season 3 playlist link:
yt-dlp -f bestvideo+bestaudio -o 'S03E%(playlist_index)02d.%(ext)s' "https://www.youtube.com/watch?v=H9tzoIplps8&list=PLGnieQmILo-h8CNDHxvMmSWYg_-yiTddM"Once downloaded, you can move each season’s files into separate folders named Season 1, Season 2, etc. This makes it easy to import into Jellyfin or another media manager.
Show Name/
├── Season 1/
│ ├── S01E01.mp4
│ ├── S01E02.mp4
├── Season 2/
│ ├── S02E01.mp4
│ ├── S02E02.mp4
-f bestaudio to download just the audio track if you don’t need video.-r 500K to avoid excessive bandwidth usage.yt-dlp -U to keep it up-to-date for the latest features and fixes.Now you’re all set to create a well-organized library of YouTube playlists on your Jellyfin server! Enjoy easy access to educational shows and more.