I needed to download a 3k+ playlist from youtube. It pissed me off how often the music would get deleted from there and the ads…

The best tool for the job was YT-DLP.

https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#installation

Shit ton of options and always working. With linux it comes bundled with GUI automatically so… yeah. Another reason to change from windows to linux.

Thanks to having a GUI to work with, I had more time to work on the settings I wanted on the music. Here are the settings I used:

-f bestaudio --extract-audio --audio-quality 0 --embed-thumbnail --audio-format opus --embed-metadata --yes-playlist --lazy-playlist --embed-chapters --continue --no-overwrites --ignore-errors --compat-options no-live-chat --download-archive My_mix.txt

This “script” will try to download the playlist presented, do so one by one and make a record into My_mix.txt file. So if your power goes out, you can resume, where you stopped. Also it will embed chapters into the file, description and other things.

–ignore-config -o %(uploader)s-%(title).60s-%(id)s.%(ext)s

This part here just outputs a file name with an uploader-video_title-yt_id.extension(.opus)

I also made 2 scripts for downloading videos. One where you download it in best quality possible: -f bv*+ba/b --embed-subs --embed-metadata --embed-thumbnail --yes-playlist --lazy-playlist --embed-chapters --continue --no-overwrites --ignore-errors --compat-options no-live-chat --download-archive archive_list.txt --xattrs

And other where if you want to archive a channel you don’t need to necessarily the best quality (4K) video for an essay. 1080p or smaller, I found was enough:

-f bestvideo[height<=1080][ext=mkv][vcodec^=avc]+bestaudio[ext=opus]/bestvideo[height<=1080]+bestaudio --embed-subs --embed-metadata --embed-thumbnail --yes-playlist --lazy-playlist --embed-chapters --continue --no-overwrites --ignore-errors --compat-options no-live-chat --download-archive archive_list.txt --xattrs

You might want to change some settings here. That’s why you should do several test runs on smaller playlists and tweak them however you like. You will also need a VPN for huge playlists, because you will get throttled by ISP (internet service provider) or Youtube.

I recommend Mullvad VPN:

https://mullvad.net/de

Write up by @Thaso@lemmy.ml