Skip to main content

Input Sources

-a, --batch-file
string
File containing URLs to download (”-” for stdin), one URL per lineLines starting with ”#”, ”;” or ”]” are considered as comments and ignoredExample:
yt-dlp -a urls.txt
cat urls.txt | yt-dlp -a -
--no-batch-file
flag
default:"true"
Do not read URLs from batch file

Output Path Configuration

-P, --paths
string
The paths where the files should be downloadedFormat: [TYPES:]PATHSpecify the type of file and the path separated by a colon ”:”. All the same TYPES as --output are supported. Additionally, you can also provide “home” (default) and “temp” paths.All intermediary files are first downloaded to the temp path and then the final files are moved over to the home path after download is finished.This option is ignored if --output is an absolute path.Example:
yt-dlp -P ~/Downloads -P "temp:/tmp" URL
-o, --output
string
Output filename templateFormat: [TYPES:]TEMPLATESee “OUTPUT TEMPLATE” for detailsExample:
yt-dlp -o "%(title)s.%(ext)s" URL
yt-dlp -o "%(uploader)s/%(title)s-%(id)s.%(ext)s" URL
--output-na-placeholder
string
default:"NA"
Placeholder for unavailable fields in --output

Filename Restrictions

--restrict-filenames
flag
Restrict filenames to only ASCII characters, and avoid ”&” and spaces in filenames
--no-restrict-filenames
flag
default:"true"
Allow Unicode characters, ”&” and spaces in filenames
--windows-filenames
flag
Force filenames to be Windows-compatible
--no-windows-filenames
flag
Sanitize filenames only minimally
--trim-filenames
number
Limit the filename length (excluding extension) to the specified number of charactersExample:
yt-dlp --trim-filenames 100 URL

File Overwrite Behavior

-w, --no-overwrites
flag
Do not overwrite any files
--force-overwrites
flag
Overwrite all video and metadata filesThis option includes --no-continue
--no-force-overwrites
flag
default:"true"
Do not overwrite the video, but overwrite related files
-c, --continue
flag
default:"true"
Resume partially downloaded files/fragments
--no-continue
flag
Do not resume partially downloaded fragments. If the file is not fragmented, restart download of the entire file
--part
flag
default:"true"
Use .part files instead of writing directly into output file
--no-part
flag
Do not use .part files - write directly into output file

File Timestamps

--mtime
flag
Use the Last-modified header to set the file modification time
--no-mtime
flag
default:"true"
Do not use the Last-modified header to set the file modification time

Metadata Files

--write-description
flag
Write video description to a .description file
--no-write-description
flag
default:"true"
Do not write video description
--write-info-json
flag
Write video metadata to a .info.json fileThis may contain personal information
--no-write-info-json
flag
default:"true"
Do not write video metadata
--write-playlist-metafiles
flag
default:"true"
Write playlist metadata in addition to the video metadata when using --write-info-json, --write-description etc.
--no-write-playlist-metafiles
flag
Do not write playlist metadata when using --write-info-json, --write-description etc.
--clean-info-json
flag
default:"true"
Remove some internal metadata such as filenames from the infojson
--no-clean-info-json
flag
Write all fields to the infojson

Comments

--write-comments
flag
Retrieve video comments to be placed in the infojsonThe comments are fetched even without this option if the extraction is known to be quickAlias: --get-comments
--no-write-comments
flag
Do not retrieve video comments unless the extraction is known to be quickAlias: --no-get-comments
--load-info-json
string
JSON file containing the video information (created with the --write-info-json option)Example:
yt-dlp --load-info-json video.info.json

Cookies

--cookies
string
Netscape formatted file to read cookies from and dump cookie jar inExample:
yt-dlp --cookies cookies.txt URL
--no-cookies
flag
default:"true"
Do not read/dump cookies from/to file
--cookies-from-browser
string
The name of the browser to load cookies fromFormat: BROWSER[+KEYRING][:PROFILE][::CONTAINER]Supported browsers: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whaleOptionally:
  • KEYRING used for decrypting Chromium cookies on Linux
  • Name/path of the PROFILE to load cookies from
  • CONTAINER name (if Firefox) (“none” for no container)
By default, all containers of the most recently accessed profile are used.Supported keyrings: basictext, gnomekeyring, kwallet, kwallet5, kwallet6Example:
yt-dlp --cookies-from-browser chrome URL
yt-dlp --cookies-from-browser firefox:default::container1 URL
--no-cookies-from-browser
flag
default:"true"
Do not load cookies from browser

Cache

--cache-dir
string
Location in the filesystem where yt-dlp can store some downloaded information (such as client ids and signatures) permanentlyDefault: ${XDG_CACHE_HOME}/yt-dlpExample:
yt-dlp --cache-dir ~/.cache/yt-dlp URL
--no-cache-dir
flag
Disable filesystem caching
--rm-cache-dir
flag
Delete all filesystem cache files

Thumbnail Options

--write-thumbnail
flag
Write thumbnail image to diskExample:
yt-dlp --write-thumbnail URL
--no-write-thumbnail
flag
default:"true"
Do not write thumbnail image to disk
--write-all-thumbnails
flag
Write all thumbnail image formats to diskExample:
yt-dlp --write-all-thumbnails URL
--list-thumbnails
flag
List available thumbnails of each videoSimulate unless --no-simulate is usedExample:
yt-dlp --list-thumbnails URL

Internet Shortcut Options

Write an internet shortcut file, depending on the current platform (.url, .webloc or .desktop)The URL may be cached by the OSExample:
yt-dlp --write-link URL
Write a .url Windows internet shortcutThe OS caches the URL based on the file path
Write a .webloc macOS internet shortcut
Write a .desktop Linux internet shortcut