Someone might really want to keep their favourite YouTube videos forever. For this, said someone might use a youtube-dl
fork called yt-dlp
. In this fictional scenario imagine that “I” employ this method of downloading YouTube videos.
Like the original it has lots of options and as of the writing of this post it gets regular updates. To get it all working on macOS the installation is easy enough using homebrew: brew install yt-dlp
. You will also need ffmpeg installed.
The real difficulty was trying to figure out how to get the best video and audio in a format that ist compatible on basically all my devices and – most importantly – my Plex server.
Without going into the discovery process, which involved some trial and error (being a lame script kiddie in that regard…) I found what works best for my use case. So, without any further delay, this is what I use:
yt-dlp -v --merge-output-format "mp4/mkv" -o "/Volumes/Mediathek/youtube-dl/YT-Fav-Archive/%(upload_date)s - %(release_date)s - %(channel)s - %(title)s - %(id)s.%(ext)s" -i -f 'bestvideo+bestaudio' --download-archive /Volumes/Mediathek/youtube-dl/YT-Fav-Archive/archive.txt "https://www.youtube.com/playlist?list=[PLAYLIST ID]"