Download Options for YouTube archiving

Posted on Dec 18, 2023

My goal is to download YT videos and import to Plex/Jellyfin so that the correct title, thumbnail, and description load with it in the library. This way the video appears native to the platform and it is easier to discern what the video is about.

Install

First make sure curl and ffmpeg are installed.

Then install yt-dlp onto your system.

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp

yt-dlp flags

Here is my full download command with flags:

yt-dlp --download-archive downloaded.txt -f 22 -i -o "%(uploader)s/%(title)s.%(ext)s" --write-thumbnail --convert-thumbnails png --embed-thumbnail --write-subs --write-auto-subs --embed-subs --sub-langs en --embed-chapters --embed-metadata --sponsorblock-mark all,-filler --dateafter 20230615 --match-filters 'tags !*= shorts' --batch-file=channel_list.txt

Might also try this to exclude livestreams:

--match-filter "is_live != true & was_live != true"

Notes and description of the above options:

  • --download-archive saves to a file what videos have already been downloaded and to not do it again.
  • -f 22 sets the quality to 720p
  • -i ignore errors
  • -o "%(uploader)s/%(title)s.%(ext)s" outputs the file to a directory of the channel and then saves the file with the title plus extension.
  • --write-thumbnail downloads the thumbnail
  • --convert-thumbnail to png
  • --embed-thumbnail in the final file
  • --write-subs creates a subtitle file if subtitles publisher created subtitles are found
  • --write-auto-subs creates a subtitle file from the YT auto-generated subs
  • --embed-subs in the final file
  • --sub-langs en to only save the English subtitles
  • --embed-chapters writes the chapter markers in the video
  • --embed-metadata writes the video description into the final file to display in Jellyfin/Plex
  • --sponsorblock-mark all,-filler marks in the final file where all the SponsorBlock marks are, minus “filler” marking.
  • --dateafter 20230615 only downloads videos after June 15, 2023 (or whatever date needed)
  • --batch-file=channel_list.txt reads a txt file of all the URL’s to download. These will be full URL’s of channels to download.
  • --match-filters 'tags !*= shorts' to skip YT Shorts