Chuck Carroll


Bringing Sanity to YouTube with yt-dlp

Published: 2023-07-20
Updated: 2024-05-30

Although I seldom actually "use" YouTube (and when I do it's with some heavy uBlock filters), there are a handful of channels I like keeping up with including NotJustBikes, PBS Spacetime, and Science Fiction with Isaac Arthur - just to name a few. One of the more useful programs I've been using for the past year is yt-dlp, a fork of youtube-dl (which hasn't been updated in a few years and very slow and painful as a result). yt-dlp has been a real blessing from the computer gods. It's a commandline program written in python for downloading audio and video from YouTube. I use yt-dlp with my rss reader newsboat that lists a handful of YouTube channels I follow. This means I rarely ever need to go to youtube.com.

If you're using Arch Linux, yt-dlp can be installed via the main arch repo. Otherwise, instructions can be found on the project's GitHub page. Below are some basics commands.

Basic Commands

Command Description
yt-dlp [video URL] Download YouTube video at highest quality
yt-dlp [video URL] -F Lists all avalable formats of specified video, including videos of different resolutions and audio of different bit rate
yt-dlp -f [number] [video URL] Download specified audio or video format from the output with the "-F" flag from above

Audio Commands

Command Description
yt-dlp -x [video URL] Downlad audio only
yt-dlp --audio-quality 0 [video URL] Download audio at max quality (0 is the highest, 9 the lowest)

Miscellaneous Commands

Command Description
yt-dlp --all-subs --skip-download [video URL] Download all available subtitles
yt-dlp --list-subs [video URL] Lists all available subtitles
yt-dlp [video URL] --merge-output-format mkv Merges the output of file into an MKV
yt-dlp -o "%(playlist_index)s-%(title)s.%(ext)s" [video URL] Rips video playlist and numbers them in sorted order

Links

Arch Wiki: yt-dlp

Thanks for reading. Feel free to send comments, questions, or recommendations to hey@chuck.is.