> For the complete documentation index, see [llms.txt](https://strangebutohwell.gitbook.io/knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strangebutohwell.gitbook.io/knowledge/applications/youtube-dl/youtube-dl-config-file.md).

# Youtube-DL Config File

## Config file Location

{% tabs %}
{% tab title="MacOS & Linux" %}
Save your configuration file as **config** in \<User Home Dir>/.config/youtube-dl/

`~/.config/youtube-dl/config`
{% endtab %}

{% tab title="Windows" %}
Save your configuration file as **youtube-dl.conf** in your User's home directory

`C:\Users\<user name>\youtube-dl.conf`
{% endtab %}
{% endtabs %}

## Config file Options

### Batch Downloads

Batch downloads videos listed in a text file - One URL per line, in order.\
\
Comment out this line if you prefer to individually download from URLs entered at the command line.

`--batch-file "$HOME/Projects/youtube-dl/config/ytdl-queue.txt"`

### Save Path

$HOME/Projects/youtube-dl/output/\<Title of Playlist>/\<Playlist Index Number> - \<Video Title>.\<Extension>

`-o "$HOME/Projects/youtube-dl/output/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s"`

### Download Archvie

Use a file as archive history. When a video download is completed successfully, record it in the archive file. After that, the video will be skipped and not downloaded again.

`--download-archive "$HOME/Projects/youtube-dl/config/ytdl-archive.txt"`

### .netrc

Enables .netrc file as database of login credentials

`--netrc`

### Preferred Format

This will attempt to download reasonably sized .MP4 files with sane bitrates to keep the total filesize managable.\
\
As set up, its first choice is 720p (starting with bitrates under 1100kb/s then moving through up to 1600kb/s),\
\
Then files with a resolution higher than 480p up to and including 1080p (with the same bitrate progression <1100kb/s through <1800kb/s).\
\
If it can't find anything with a reasonable bitrate, it downloads the best file it can.

`-f 'best[ext=mp4][height=720][tbr<=?1100]'/'best[ext=mp4][height=720][tbr<=?1400]'/'best[ext=mp4][height=720][tbr<=?1600]'/'best[ext=mp4][height<=?1080][height>480][tbr<=?1100]'/'best[ext=mp4][height<=?1080][height>480][tbr<=?1400]'/'best[ext=mp4][height<=?1080][height>480][tbr<=?1600]'/'best[ext=mp4][height<=?1080][height>480][tbr<=?1800]'/'best[ext=mp4][height<=?1080][height>480]'/best`

### List Formats

Get a list of all available formats for a particular video, and print them to console, but do not download.&#x20;

`--list-formats`

### All Formats

Download all available formats.\
\
If you use this, I recommend using an output naming structure that includes the '%(format)s' string\
\
This will include a human-readable format description in the file-name.                                               &#x20;

`--all-formats`

### Number of Retries

(default is 10)

`--retries 15`

### Timeout

Time to wait before giving up

`--socket-timeout 20`

### Sleep

Number of seconds to sleep before each download in seconds (lower/upper bounds)

This will help avoid HTTP timeouts if you are downloading a large amount of files, ie: from a playlist or using the queue.

If you get a timeout during a long queue or a big playlist, youtube-dl is not able to recover from the error and quits.

`--sleep-interval 20`

`--max-sleep-interval 25`

### Prefer ffmpeg

Prefer ffmpeg over avconv for running the postprocessors (default)

`--prefer-ffmpeg`

### Disable Progress bar

Do not print progress bar

`--no-progress`

### Ignore Errors

`--ignore-errors`

### Force IPv4 Connections

`--force-ipv4`

## Config File DEBUG Options

### Verbose

Print various debugging information

`--verbose`

### Simulate

Simulate action only, do not download

`--simulate`

### Write Description

Write video description to a .description file

`--write-description`

### Write Info Json

Write video metadata to a .info.json file &#x20;

`--write-info-json`

### Write Annotations

Write video annotations to a .annotations.xml file

`--write-annotations`
