The yt-dlp Config File: Stop Retyping the Same Flags
Quick answer
Every flag you have typed twice belongs in yt-dlp.conf. One flag per line, no
yt-dlp prefix, no quotes. Create it here:
mkdir -p ~/.config/yt-dlp
nano ~/.config/yt-dlp/config
New-Item -ItemType Directory -Force "$env:APPDATA\yt-dlp"
notepad "$env:APPDATA\yt-dlp\config.txt"
A config worth starting from
Sensible on almost any machine. Each line is explained below it:
# Quality — merged, capped at 1080p, H.264 for compatibility
-S res:1080,vcodec:h264,acodec:m4a
--merge-output-format mp4
# Naming — channel folders, ids kept so nothing collides
-o %(uploader)s/%(title)s [%(id)s].%(ext)s
--restrict-filenames
# Metadata a media library can read
--embed-metadata
--embed-thumbnail
--embed-chapters
# Only the video I linked to, not the playlist it sits in
--no-playlist
# Pacing, so a long job finishes instead of hitting a 429
--sleep-requests 1.5
--retries 10
# Do not stop a playlist because one video is gone
-i
--no-playlist is the line most worth having. Without it, clicking a video that
happens to sit inside a 400-video playlist and pasting the URL downloads all 400.
Where the file goes
| Platform | Path |
|---|---|
| Windows | %APPDATA%\yt-dlp\config.txt |
| Windows (alternative) | %USERPROFILE%\yt-dlp.conf |
| macOS, Linux | ~/.config/yt-dlp/config |
| macOS, Linux (alternative) | ~/yt-dlp.conf |
| System-wide (Unix) | /etc/yt-dlp.conf |
| Per project | yt-dlp.conf in the current directory |
Syntax
- One flag per line. A flag and its value can share a line.
- No quotes. The file is not parsed by a shell, so quotes end up inside the value.
- No
yt-dlpprefix — the file holds arguments, not commands. #begins a comment.- Blank lines are ignored.
The quoting rule is the one that catches people, because it is the opposite of what the command line requires:
-o "%(title)s.%(ext)s"
-o %(title)s.%(ext)s
Load order, and what wins
yt-dlp reads several files, and later ones override earlier ones. The command line always wins:
- System-wide
/etc/yt-dlp.conf - User config in
~/.config/yt-dlp/or%APPDATA%\yt-dlp\ - Home directory
yt-dlp.conf - A
yt-dlp.confin the current directory - Anything passed with
--config-location - The command line
To see exactly what was loaded:
yt-dlp -v --simulate "URL" 2>&1 | head -20
The header includes a Loaded N config files line naming each one. When a command
behaves differently on your machine than in a guide, this is the first thing to check.
Turning something off
Most flags have a negation that works from the command line:
yt-dlp --no-embed-metadata --yes-playlist "URL"
yt-dlp --ignore-config "URL"
--ignore-config disables every config file for one run. It is the fastest way to
answer "is my config doing this", and worth trying before debugging anything else that behaves
unexpectedly.
Several configs for several jobs
Keep separate files and select one per run:
-x
--audio-format m4a
--audio-quality 0
--embed-thumbnail
--embed-metadata
--parse-metadata %(title)s:%(artist)s - %(title)s
-o %(artist,uploader)s/%(album,playlist)s/%(track,title)s.%(ext)s
-P ~/Music/yt-dlp
yt-dlp --config-location ~/.config/yt-dlp/music.conf "URL"
A per-directory yt-dlp.conf is the other useful shape: an archive folder whose
config sets its own naming and archive file, so running yt-dlp from inside it does the right
thing with no flags at all.
Lines worth thinking twice about
A config file applies to everything, forever, silently. Three that cause trouble later:
-
-f best— caps every download at 360p, and you will not remember writing it. -
--no-check-certificate— disables TLS verification for every site, permanently. If you needed it once, pass it once. -
--cookies-from-browser chrome— makes every command depend on Chrome being closed, including the ones that need no cookies at all.
A useful habit: keep the config small and comment why each line is there. Six months later that comment is the difference between "this is deliberate" and "why is everything 360p".
Frequently asked
Why does my config file seem to be ignored?
Do values need quotes?
How do I turn off something the config sets?
Can I have different configs for different jobs?
Related
- yt-dlp Output Templates: Name and Sort Files Automatically The -o template turns a folder of random filenames into a library. Every field worth using, the numeric and da...
- yt-dlp cheat sheet One page, every yt-dlp command worth memorising: quality, audio, playlists, subtitles, cookies, archives and r...
- yt-dlp Format Selection: -f, -S and Getting Exactly What You Want Format selection is the one yt-dlp concept worth learning properly — it decides resolution, codec, file size a...