Skip to content

yt-dlp for Mere Mortals

Some of the best things published on the web — lectures, talks, open films, concert recordings, conference sessions — arrive as streams: your browser plays them and throws them away. yt-dlp is the command-line program that keeps them. Give it a page's address and it saves the video or audio from that page to a file of your choosing: at the size you pick, under a name you design, with the subtitles alongside, or as sound alone. This guide explains how it works in those terms, walks through real downloads end to end, and is honest about the large site that refused to take part.

The lab behind this guide ran the real thing: yt-dlp 2026.10.21 with ffmpeg 8.1.2, installed with pip onto a small Linux machine. Onto the disk came only freely licensed material. From the Blender Foundation's own PeerTube instance: Big Buck Bunny complete at 480p (74.83 MiB, probed and verified), its soundtrack extracted to an MP3 that matches the film's length to the second, and one item pulled from the Foundation's 23-item channel playlist under a numbered template. From TED: a famous talk's subtitle track saved as text, and its picture and sound — served as separate streams — merged into a single file. From the Internet Archive: a small clip fetched twice through a config file, the second run correctly refused by the download archive the first run had written.

What the lab could not do, it did not fake, and the refusal is instructive. YouTube — the site the tool is named for — declined every request from the lab's machine: a rate-limit warning, then a demand to sign in and prove a human was asking. Serving that proof means handing over a browser session's cookies, which the lab chose not to do; so YouTube downloads are documented only in this guide, and labelled as such wherever they appear. Everything else here was run, and the failures were kept alongside the successes: an audio extraction that failed because the clip was silent, a fragment download a CDN cut off mid-stream (and the route that finished it), a filter that quietly fetched the largest file on the page, and a config file that reached further than its author intended. criteria.md keeps the full ledger.

What this guide covers

  • What yt-dlp is — the mental model: the streams are already coming to your machine; this keeps them. What it is not: a player, a DRM key, a guarantee
  • The moving parts — extractors, formats, the fragment downloader, ffmpeg and its postprocessors, templates and the archive
  • Installing yt-dlp — pip in a venv (the lab's way), pipx, the standalone file, why distro packages lag, and ffmpeg alongside
  • Your first download — listing formats, choosing one, and proving the file is what the table promised
  • Choosing formats — the two shapes of format list, selectors, filters, sorting, fallbacks, and dry-running a choice before it costs you a download
  • Naming your files — output templates, padded playlist numbers, checking fields before using them, and unruly titles
  • Audio and subtitles — extracting sound to MP3 (and the silent clip that refused), listing and saving subtitles, and the sites whose answer is "none"
  • Playlists and archives — flat listings, taking items by number, and the archive file that makes repeat runs fetch only what's new
  • Config files and cookies — defaults that live in a file, the config the lab didn't know it had, and session cookies with their risks stated plainly
  • Sites and extractors — the five sites the lab exercised, what each taught, and the ceiling named without varnish
  • Recipes — copy-and-run combinations of the verified operations
  • The neighbours — youtube-dl, ffmpeg alone, aria2, streamlink, gallery-dl, and when each is the better tool
  • Limits — refusals, DRM, throttling, metadata gaps, and the limits that are law and terms rather than code
  • Troubleshooting — symptom → cause → fix, starting — as always with this tool — with updating

What it doesn't cover

Downloading from YouTube in practice (documented only — the lab's address was refused; chapter 10 has the transcript). Logging into any site: no cookies were used, exported, or stored by the lab, and the cookie workflows in chapter 9 are described, not demonstrated. Graphical front-ends and the tools that wrap yt-dlp into a media library. Anything behind DRM. And the legal question for any specific item — the guide states the principle (download what you have the right to keep) and leaves the item-by-item judgement, as it must, to you.

How to use this guide

Read chapters 1–4 in order and you will have made a real download. After that the chapters stand alone: formats when a choice surprises you, playlists when a list gets long, config when the typing gets repetitive, troubleshooting when a host says no. Every command was run against the versions named in criteria.md, and the lab transcripts in yt-dlp-lab/transcripts/ are the evidence — progress bars trimmed, errors kept.


Part of the series

This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.

Related guides:

License

The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.