Guides

yt-dlp Commands for Windows

The yt-dlp commands people actually use on Windows: pick a quality, extract MP3 or FLAC, save playlists in order, get subtitles and use cookies.

Before you start

Every command here assumes yt-dlp and FFmpeg are installed and on your PATH. If they are not, the install guide on this site covers that in a few minutes. Run the commands in Windows Terminal, PowerShell or Command Prompt — they work the same in all three.

Two Windows habits save most of the trouble. Put the address in double quotes, because a link with an & in it will otherwise be cut in half by the shell. And if you paste a command into a .bat file, double every percent sign, so %(title)s becomes %%(title)s.

Check that both tools are found
yt-dlp --version
ffmpeg -version

Choose the quality and container

With no options at all, yt-dlp takes the best video and the best audio and joins them. The options below narrow that down. As a rule of thumb, -S sorts the available formats by what you prefer, while -f filters them to exactly what you ask for and fails if it is not there.

See every format a video offers
yt-dlp -F "URL"
Best quality, whatever the container
yt-dlp "URL"
Nothing above 1080p
yt-dlp -S "res:1080" "URL"
Best MP4, falling back to the best of anything
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" "URL"
Join the streams into an MKV file
yt-dlp --merge-output-format mkv "URL"
An exact pair of format IDs from the -F table
yt-dlp -f 137+140 "URL"

Why strict MP4 can cap you at 1080p

On YouTube, the H.264 video that sits most comfortably in an MP4 file usually stops at 1080p. The 1440p, 4K and 8K versions are stored as VP9 or AV1. If you insist on MP4 with H.264, you may get 1080p and never see a warning. For the highest resolutions, let yt-dlp pick freely and write MKV or WEBM, then convert later only if a device demands it.

Audio only

The -x option keeps the sound and drops the picture. Add a format when you need a particular file type; leave it off to keep the stream exactly as the site stored it, with no re-encoding.

MP3 at the best variable bitrate
yt-dlp -x --audio-format mp3 --audio-quality 0 "URL"
MP3 at a fixed 320 kbps
yt-dlp -x --audio-format mp3 --audio-quality 320K "URL"
FLAC
yt-dlp -x --audio-format flac "URL"
The original audio stream, untouched
yt-dlp -f ba "URL"

Playlists and channels

The output template after -o decides the folder and file names. The one below makes a folder named after the playlist and numbers each file, so the order survives in File Explorer. The archive file is a plain list of what has already been saved; run the same command next month and only the new videos come down.

A folder per playlist, files numbered in order
yt-dlp -o "%(playlist_title)s/%(playlist_index)02d - %(title)s.%(ext)s" "PLAYLIST_URL"
Only items 1 to 5 and item 8
yt-dlp --playlist-items 1-5,8 "PLAYLIST_URL"
Skip everything already downloaded
yt-dlp --download-archive archive.txt "PLAYLIST_URL"
One video, even if the link carries a playlist
yt-dlp --no-playlist "URL"
List the titles without downloading
yt-dlp --flat-playlist --print "%(title)s" "PLAYLIST_URL"

Subtitles, thumbnails and metadata

See which subtitle languages exist
yt-dlp --list-subs "URL"
English subtitles saved as SRT next to the video
yt-dlp --write-subs --sub-langs "en.*" --convert-subs srt "URL"
Auto-generated captions when no real ones exist
yt-dlp --write-auto-subs --sub-langs en --convert-subs srt "URL"
Subtitles only, no video
yt-dlp --skip-download --write-subs --sub-langs en "URL"
Subtitles, cover image, tags and chapters inside the file
yt-dlp --embed-subs --embed-thumbnail --embed-metadata --embed-chapters "URL"

Sign-in, speed and good manners

Some videos only play when you are signed in: age-restricted uploads, members-only posts, private videos shared with your account. yt-dlp can borrow the session from a browser on the same PC. Firefox is the dependable choice on Windows, because Chromium browsers lock and encrypt their cookie store. Use this only for things your own account is allowed to watch.

The other three options are about being a considerate guest: a speed cap so the rest of the house can still use the connection, parallel fragments for a faster single download, and a random pause between videos on long playlists.

Use the session from Firefox
yt-dlp --cookies-from-browser firefox "URL"
Limit the speed to 2 MB per second
yt-dlp -r 2M "URL"
Download four fragments at once
yt-dlp -N 4 "URL"
Wait 5 to 15 seconds between videos
yt-dlp --sleep-interval 5 --max-sleep-interval 15 "PLAYLIST_URL"

Clips, sponsors and where files go

Only the part from 10:15 to 12:30
yt-dlp --download-sections "*10:15-12:30" "URL"
Cut out sponsor segments marked by SponsorBlock
yt-dlp --sponsorblock-remove sponsor "URL"
Save into a particular folder
yt-dlp -P "D:\Videos" "URL"
Work through a text file of links, one per line
yt-dlp -a urls.txt

Save your defaults in a config file

Typing the same options every time gets old. yt-dlp reads a file named config.txt from the yt-dlp folder inside %APPDATA%, with one option per line. Create the folder and the file once and every later command picks the settings up; add --ignore-config to a command when you want a clean run.

Sites change their players often, and an out-of-date yt-dlp is the usual reason a command that worked last week now fails. Update before you start debugging anything else.

An example config.txt
-P "D:\Videos"
-o "%(title)s [%(id)s].%(ext)s"
--embed-metadata
--embed-thumbnail
--download-archive "D:\Videos\archive.txt"
Update yt-dlp itself
yt-dlp -U

When you would rather not type any of this

GetVideosLocally runs the same yt-dlp engine behind a Windows interface: quality and format are menus, playlists land in numbered folders, and a searchable history replaces the terminal scrollback. It is free and open source, and it bundles FFmpeg so there is nothing else to install.

Whichever way you run it, yt-dlp is for content you are allowed to save — your own uploads, public-domain and Creative Commons material, and anything you have permission for.

FAQ

Why does my command fail on a link with an & in it?

The shell treats & as the end of the command. Put the whole address in double quotes and it is passed to yt-dlp in one piece.

Why do I get two files, or no MP4, instead of one video?

yt-dlp needs FFmpeg to join the separate video and audio streams and to convert between formats. Install FFmpeg, make sure it is on your PATH, and run the command again.

Do these commands work in PowerShell and Command Prompt?

Yes. Use double quotes as shown and they behave the same in both. Only .bat files differ: there, every percent sign in an output template has to be doubled.

Download GetVideosLocally for Windows. Free and open source.

Home · Guides · Changelog · Privacy · GitHub · Donate