Yt-dlp configuration file

Hello everyone, I’m trying to configure yt-dlp, to download the files in other folder instead of home, I’ve tried creating the . conf inside home, like it says in github, but keeps saving the files in the default folder (home).

do you know how to proper configure this? thanks

By default it should download the file(s) to the current working directory.

So for example, if you cd into ~/Downloads/youtube-archive/ and then invoke yt-dlp, it will save the video inside of ~/Downloads/youtube-archive/

Most graphical file browsers, such as Dolphin, let you open up the terminal in the currently viewed directory (usually from a right-click context menu). So if you browse to User Home FolderDownloadsyoutube-archives, then you can right-click and launch the terminal for this directory. Use yt-dlp as usual inside this directory.

1 Like

There seems to be a plethora of config file locations to choose from

man page excerpt

You can configure yt-dlp by placing any supported command line option to a configuration file. The configuration is loaded from the following locations:

  1. Main Configuration: The file given by --config-location
  2. Portable Configuration: yt-dlp.conf in the same directory as the bundled binary. If you are running from source-code (/yt_dlp/main.py), the root directory is used
    instead.
  3. Home Configuration: yt-dlp.conf in the home path given by -P, or in the current directory if no such path is given
  4. User Configuration:
    • %XDG_CONFIG_HOME%/yt-dlp/config (recommended on Linux/macOS)
    • %XDG_CONFIG_HOME%/yt-dlp.conf
    • %APPDATA%/yt-dlp/config (recommended on Windows)
    • %APPDATA%/yt-dlp/config.txt
    • ~/yt-dlp.conf
    • ~/yt-dlp.conf.txt
    %XDG_CONFIG_HOME% defaults to ~/.config if undefined. On windows, %APPDATA% generally points to C:\Users<user name>\AppData\Roaming and ~ points to %HOME% if present, %USERPRO‐
    FILE% (generally C:\Users<user name>), or %HOMEDRIVE%%HOMEPATH%
  5. System Configuration: /etc/yt-dlp.conf

%XDG_CONFIG_HOME%/yt-dlp/config or $HOME/.config/yt-dlp/config seems to be recommended for Linux.

1 Like

create a yt-dlp.conf in .config/
Paste -o /your/directory/what/you/want/%(title)s.%(ext)s

1 Like

My config file is $HOME/.config/yt-dlp/config and looks like this:

# Save all videos here
--paths $HOME/Videos/youtube-dl
--output %(title)s.%(upload_date)s.%(vcodec)s.%(acodec)s.%(autonumber)02d.%(ext)s

# Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames
--restrict-filenames

# Download all the available subtitles
--all-subs
# merge subtitles into video file
--embed-subs

# Embed metadata to the video file. Also adds chapters to file
--embed-metadata

# Do not overwrite existing output files
--no-overwrites

# Download only the video, if the URL refers to a video AND a playlist
--no-playlist

# Number of seconds to sleep before each download when used alone or a lower bound of a range for randomized sleep before each download (minimum possible number of seconds to sleep) when used
--min-sleep-interval 1
--max-sleep-interval 2

# Number of fragments of a dash/hlsnative video that should be download concurrently (default is 1)
--concurrent-fragments 4

You can use $HOME/ or ~/ for the user’s home directory.

2 Likes

thanks everyone,

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.