Skip to content

Start typing. Errors match on their exact yt-dlp output.

to move, to open esc to close

yt-dlp cheat sheet

The commands worth keeping, grouped by task. Every one tested against yt-dlp 2026.07.28. Copy buttons on all of them, and the builder if you would rather click than type.

The one to remember

Best quality the site offers, merged into an mp4 that plays everywhere, tagged, named after the video. If you take one command away from this page, this is it.

the sensible default
yt-dlp -f "bv*+ba/b" --merge-output-format mp4 --embed-metadata --embed-thumbnail -o "%(title)s.%(ext)s" "URL"

Quality

see what is on offer — run this before guessing
yt-dlp -F "URL"
cap at 1080p
yt-dlp -f "bv*[height<=1080]+ba/b[height<=1080]/b" "URL"
4K if it exists, best available if not
yt-dlp -S "res:2160" "URL"
maximum compatibility — H.264 in mp4, plays on any TV
yt-dlp -S "res:1080,vcodec:h264,acodec:m4a" --merge-output-format mp4 "URL"
smallest file, for a quick look
yt-dlp -S "+size" "URL"

Format selection covers the syntax; if a download comes out at 360p, this page narrows it to one of four causes in a single command.

Audio

keep the original — no re-encode, seconds not minutes
yt-dlp -x --audio-format m4a --embed-thumbnail --embed-metadata "URL"
mp3, when a device requires it
yt-dlp -x --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata "URL"
a music library, organised
yt-dlp -x --audio-format m4a --embed-thumbnail --embed-metadata \
  -o "%(artist,uploader)s/%(album,playlist)s/%(track,title)s.%(ext)s" "URL"

Playlists and channels

just this video, not the playlist it sits in
yt-dlp --no-playlist "URL"
a whole playlist, resumable, numbered so it sorts
yt-dlp --download-archive archive.txt -i \
  -o "%(playlist)s/%(playlist_index)02d - %(title)s.%(ext)s" "PLAYLIST_URL"
a range of items
yt-dlp -I 5-20 "PLAYLIST_URL"
a whole channel, paced so it finishes
yt-dlp --download-archive archive.txt --sleep-requests 2 --limit-rate 4M -i \
  -o "%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" \
  "https://www.youtube.com/@channel/videos"
count what you are committing to, in seconds
yt-dlp --flat-playlist --print "%(title)s" "CHANNEL_URL" | wc -l

Subtitles

what exists
yt-dlp --list-subs "URL"
real subtitles and machine captions, embedded
yt-dlp --write-subs --write-auto-subs --sub-langs "en.*" --embed-subs --merge-output-format mkv "URL"
separate .srt files
yt-dlp --write-subs --write-auto-subs --sub-langs "en.*" --convert-subs srt "URL"
transcript only, no video
yt-dlp --skip-download --write-auto-subs --sub-langs "en.*" --convert-subs srt "URL"

SponsorBlock

mark segments as chapters — nothing is re-cut
yt-dlp --sponsorblock-mark all --embed-chapters "URL"
cut the advertising out
yt-dlp --sponsorblock-remove "sponsor,selfpromo,interaction" "URL"

Signing in

read Firefox's cookies — works while it is open
yt-dlp --cookies-from-browser firefox "URL"
an exported file — works headless and in containers
yt-dlp --cookies cookies.txt "URL"
a client that is not challenged — no account needed
yt-dlp --extractor-args "youtube:player_client=tv" "URL"

Naming and folders

channel folders, ids kept so nothing collides
yt-dlp -o "%(uploader)s/%(title)s [%(id)s].%(ext)s" "URL"
dated archive
yt-dlp -o "%(uploader)s/%(upload_date>%Y)s/%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "URL"
safe on network shares, Windows and Android
yt-dlp --restrict-filenames --trim-filenames 120 "URL"
preview the paths without downloading
yt-dlp --simulate --print filename -o "YOUR TEMPLATE" "PLAYLIST_URL"

When it is slow or blocked

pacing that keeps a long job under the limit
yt-dlp --sleep-requests 2 --sleep-interval 5 --max-sleep-interval 15 --limit-rate 2M -i "URL"
faster on fragmented formats
yt-dlp -N 4 "URL"
fixes most 403s and throttling
yt-dlp -U && yt-dlp --rm-cache-dir

Diagnostics

everything, downloading nothing
yt-dlp --simulate -v "URL"
what a command would produce
yt-dlp --simulate --print "%(format_id)s %(height)sp %(vcodec)s %(filesize_approx)s" "URL"
all the metadata there is
yt-dlp --dump-json "URL"
rule out your config file
yt-dlp --ignore-config "URL"
a report worth filing
yt-dlp -vU "URL" 2>&1 | tee report.txt

Updating

bash
yt-dlp --version
yt-dlp -U
yt-dlp --update-to nightly
yt-dlp --update-to stable

-U only works on the standalone binary. A pip or package-manager install has to be updated the same way it was installed — which decides how fast fixes reach you.

A config file worth having

Everything above that you would otherwise retype. Windows: %APPDATA%\yt-dlp\config.txt. Elsewhere: ~/.config/yt-dlp/config. No quotes in this file — it is not parsed by a shell.

yt-dlp.conf
-S res:1080,vcodec:h264,acodec:m4a
--merge-output-format mp4
-o %(uploader)s/%(title)s [%(id)s].%(ext)s
--restrict-filenames
--embed-metadata
--embed-thumbnail
--embed-chapters
--no-playlist
--sleep-requests 1.5
-i

The config guide covers load order and the lines worth thinking twice about.

Frequently asked

Why is -f best not on this page?
Because it does the opposite of what people expect: it means the best pre-merged file, which on YouTube is 360p. yt-dlp's default already merges and is better than the thing most guides replace it with.
Do these work on sites other than YouTube?
Most of them, on most of the thousand-odd supported sites. The exceptions are anything using --extractor-args youtube, and format selectors assuming split video and audio streams — many sites only serve combined files, which is why bv*+ba/b appears rather than bestvideo+bestaudio.
Can I run these on Windows as written?
Yes in PowerShell and Windows Terminal. The one difference is line continuations — the trailing backslash works in PowerShell 7 but not in cmd.exe, where you would paste the command as a single line.