Configuration File Locations
yt-dlp searches for configuration files in the following locations (in order of priority):1. Main Configuration
The file specified with--config-locations:
2. Portable Configuration
Recommended for portable installations If using a binary:yt-dlp.confin the same directory as the binary
yt-dlp.confin the parent directory ofyt_dlp
This is ideal for portable installations where you want the configuration to travel with the executable.
3. Home Configuration
yt-dlp.confin the home path given to-P- If
-Pis not given, the current directory is searched
4. User Configuration
- Linux/macOS
- Windows
Recommended locations:
${XDG_CONFIG_HOME}/yt-dlp/config${XDG_CONFIG_HOME}/yt-dlp.conf${XDG_CONFIG_HOME}/yt-dlp/config.txt
~/.yt-dlp/config~/yt-dlp.conf~/yt-dlp.conf.txt~/.yt-dlp/config.txt
${XDG_CONFIG_HOME} defaults to ~/.config if unset5. System Configuration
Linux/macOS only:/etc/yt-dlp.conf/etc/yt-dlp/config/etc/yt-dlp/config.txt
If
--ignore-config is found in the system configuration file, user configuration is not loaded (for backward compatibility).Configuration File Syntax
Configuration files use the same options as command line switches:Basic Rules
- One option per line
- No whitespace after
-or-- - Comments start with
# - Quote values when necessary (as in a shell)
Example Configuration
Configuration File Encoding
Configuration files are decoded according to:- UTF BOM if present
- System locale encoding otherwise
Specifying Encoding
To force a specific encoding, add this as the first line:There must be no characters before the encoding declaration, not even spaces or BOM.
Ignoring Configuration Files
Disable configuration file loading:Partial Ignore
If--ignore-config is found inside a configuration file:
- No further configuration files are loaded
- Useful for preventing cascading configs
Exclude Specific Locations
Multiple Configuration Files
Load additional configuration files:Practical Configuration Examples
Default Quality Settings
Organization and Archiving
Performance and Reliability
Subtitle Preferences
Post-Processing
Per-Site Configuration
While yt-dlp doesn’t have built-in per-site configs, you can use shell aliases:Environment Variables
Variable Syntax
- UNIX:
${VARIABLE}or$VARIABLE - Windows:
%VARIABLE% - yt-dlp allows UNIX-style variables on Windows for path options
Common Variables
- Linux/macOS
- Windows
${HOME}- User home directory${XDG_CONFIG_HOME}- Config directory (defaults to~/.config)${XDG_CACHE_HOME}- Cache directory (defaults to~/.cache)