Skip to content

Instantly share code, notes, and snippets.

@reneruiz
Last active January 14, 2024 02:38
Show Gist options
  • Save reneruiz/72859007b9253fb2c52de08fe42d92ae to your computer and use it in GitHub Desktop.
Save reneruiz/72859007b9253fb2c52de08fe42d92ae to your computer and use it in GitHub Desktop.
Using youtube-dl or yt-dlp to download and name files in Plex-like format

⚠️ A lot of this depends on the the metadata that was used by the publisher/uploader. You might be able to modify the metadata to clean output, but I haven't experimented with this.


As Series Name - S00E00.mp4

$ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" -o '%(series)s - S%(season_number)02dE%(episode_number)02d.%(ext)s' 'https://www.youtube.com/playlist?list={your_list_id_here}'

As Series Name - S00E00 - Episode Name.mp4

$ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" -o '%(series)s - S%(season_number)02dE%(episode_number)02d - %(episode)s.%(ext)s' 'https://www.youtube.com/playlist?list={your_list_id_here}'

Episodes grouped by season folders as Season 0/Series Name - S00E00 - Episode Name.mp4

yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" -o '%(season)s/%(series)s - S%(season_number)02dE%(episode_number)02d - %(episode)s.%(ext)s' 'https://www.youtube.com/playlist?list={your_list_id_here}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment