| --date DATE | Download only videos uploaded on this date.<br>The date can be "YYYYMMDD" or in the format \[now\|today\|yesterday]\[-N\[day\|week\|month\|year]].<br>E.g. --date today-2weeks |
| --datebefore DATE | Download only videos uploaded on or before this date |
| --dateafter DATE | Download only videos uploaded on or after this date |
| --no-playlist | Download only the video, if the URL refers to a video and a playlist |
| --yes-playlist | Download the playlist, if the URL refers to a video and a playlist |
| --download-archive FILE | Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it |
| --max-downloads NUMBER | Abort after downloading NUMBER files |
| --downloader \[PROTO:]NAME | Name or path of the external downloader to use (optionally) prefixed by the protocols ([http](../../internet/HTTP.md), ftp, m3u8, dash, rstp, rtmp, mms) to use it for.<br>Currently supports native, aria2c, avconv, axel, [curl](../cli/network/curl.md), [ffmpeg](ffmpeg.md), [httpie](../development/HTTPie.md), wget. You can use this option multiple times to set different downloaders for different protocols.<br>E.g. --downloader aria2c --downloader "dash,m3u8:native" will use aria2c for [http](../../internet/HTTP.md)/ftp downloads, and the native downloader for dash/m3u8 downloads |
| -a, --batch-file FILE | File containing URLs to download ("-" for stdin), one URL per line. Lines starting with "#", ";" or "]" are considered as comments and ignored |
| -o, --output [TYPES:]TEMPLATE | Output filename template; see "OUTPUT TEMPLATE" for details |
| --restrict-filenames | Restrict filenames to only [ASCII](../../files/ASCII.md) characters and avoid "&" and spaces in filenames |
| --write-description | Write video description to a .description file |
| --write-info-json | Write video metadata to a .info.json file |
| --write-comments | Retrieve video comments to be placed in the infojson. The comments are fetched even without this option if the extraction is known to be quick |
| --cookies FILE | Netscape formatted file to read cookies from and dump cookie jar in |
| --cookies-from-browser BROWSER\[+KEYRING]\[:PROFILE]\[::CONTAINER] | The name of the browser to load cookies from. Currently supported browsers are: [brave](../network/browsers/Brave.md), chrome, chromium, edge, [firefox](../network/browsers/Firefox.md), opera, safari, vivaldi. Optionally, the KEYRING used for decrypting Chromium cookies on [Linux](../../linux/Linux.md), the name/path of the PROFILE to load cookies from, and the CONTAINER name (if [Firefox](../network/browsers/Firefox.md)) ("none" for no container) can be given with their respective seperators. By default, all containers of the most recently accessed profile are used. Currently supported keyrings are: basictext, gnomekeyring, kwallet |
| --merge-output-format FORMAT | Containers that may be used when merging formats, separated by "/", e.g. "mp4/[mkv](../../files/media/Matroska.md)". Ignored if no merge is required. (currently supported: avi, flv, [mkv](../../files/media/Matroska.md), mov, mp4, webm) |
| --list-subs | List available subtitles of each video. Simulate unless --no-simulate is used |
| --sub-format FORMAT | Subtitle format; accepts formats preference, e.g. "srt" or "ass/srt/best" |
| --sub-langs LANGS | Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. --sub-langs "en.\*,ja". You can prefix the language code with a "-" to exclude it from the requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of available language tags |
| -x, --extract-audio | Convert video files to audio-only files (requires [ffmpeg](ffmpeg.md) and ffprobe) |
| --audio-format FORMAT | Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, [flac](../../files/media/audio/FLAC.md), m4a, mp3, [opus](../../files/media/audio/Opus.md), vorbis, [wav](../../files/media/audio/WAV.md)) |
| --remux-video FORMAT | Remux the video into another container if necessary (currently supported: avi, flv, [mkv](../../files/media/Matroska.md), mov, mp4, webm, aac, aiff, alac, [flac](../../files/media/audio/FLAC.md), m4a, mka, mp3, ogg, [opus](../../files/media/audio/Opus.md), vorbis, [wav](../../files/media/audio/WAV.md)) |
| --embed-subs | Embed subtitles in the video (only for mp4, webm and [mkv](../../files/media/Matroska.md) videos) |
| --embed-thumbnail | Embed thumbnail in the video as cover art |
| --embed-metadata | Embed metadata to the video file. Also embeds chapters/infojson if present unless --no-embed-chapters/--no-embed-info-json are used |
| --embed-chapters | Add chapter markers to the video file |
The `-o` option is used to indicate a template for the output file names while `-P` option is used to specify the path each type of file should be saved to.
The simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `yt-dlp -o funny_video.flv "https://some/video"` (hard-coding file extension like this is _not_ recommended and could break some post-processing).
It may however also contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [Python string formatting operations](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting), e.g. `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations.
1.**Object traversal**: The dictionaries and lists available in metadata can be traversed by using a dot `.` separator; e.g. `%(tags.0)s`, `%(subtitles.en.-1.ext)s`. You can do Python slicing with colon `:`; E.g. `%(id.3:7:-1)s`, `%(formats.:.format_id)s`. Curly braces `{}` can be used to build dictionaries with only specific keys; e.g. `%(formats.:.{format_id,height})#j`. An empty field name `%()s` refers to the entire infodict; e.g. `%(.{id,title})s`. Note that all the fields that become available using this method are not listed below. Use `-j` to see such fields
2.**Addition**: Addition and subtraction of numeric fields can be done using `+` and `-` respectively. E.g. `%(playlist_index+10)03d`, `%(n_entries+1-playlist_index)d`
3.**Date/time Formatting**: Date/time fields can be formatted according to [strftime formatting](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) by specifying it separated from the field name using a `>`. E.g. `%(duration>%H-%M-%S)s`, `%(upload_date>%Y-%m-%d)s`, `%(epoch-3600>%H-%M-%S)s`
5.**Replacement**: A replacement value can be specified using a `&` separator. If the field is _not_ empty, this replacement value will be used instead of the actual field content. This is done after alternate fields are considered; thus the replacement is used if _any_ of the alternative fields is _not_ empty.
6.**Default**: A literal default value can be specified for when the field is empty using a `|` separator. This overrides `--output-na-placeholder`. E.g. `%(uploader|Unknown)s`
7.**More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, yt-dlp additionally supports converting to `B` = **B**ytes, `j` = **j**son (flag `#` for pretty-printing, `+` for Unicode), `h` = HTML escaping, `l` = a comma separated **l**ist (flag `#` for `\n` newline-separated), `q` = a string **q**uoted for the terminal (flag `#` to split a list into different arguments), `D` = add **D**ecimal suffixes (e.g. 10M) (flag `#` to use 1024 as factor), and `S` = **S**anitize as filename (flag `#` for restricted)
8.**Unicode normalization**: The format type `U` can be used for NFC [Unicode normalization](https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize). The alternate form flag (`#`) changes the normalization to NFD and the conversion flag `+` can be used for NFKC/NFKD compatibility equivalence normalization. E.g. `%(title)+.100U` is NFKC
Additionally, you can set different output templates for the various metadata files separately from the general output template by specifying the type of file followed by the template separated by a colon `:`. The different file types supported are `subtitle`, `thumbnail`, `description`, `annotation` (deprecated), `infojson`, `link`, `pl_thumbnail`, `pl_description`, `pl_infojson`, `chapter`, `pl_video`. E.g. `-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s"` will put the thumbnails in a folder with the same name as the video. If any of the templates is empty, that type of file will not be written. E.g. `--write-thumbnail -o "thumbnail:"` will write thumbnails only for playlists and not for video.
Note: Due to post-processing (i.e. merging etc.), the actual output filename might differ. Use `--print after_move:filepath` to get the name after all post-processing is complete.
-`modified_date` (string): The date (YYYYMMDD) when the video was last modified in UTC
-`uploader_id` (string): Nickname or id of the video uploader
-`channel` (string): Full name of the channel the video is uploaded on
-`channel_id` (string): Id of the channel
-`channel_follower_count` (numeric): Number of followers of the channel
-`location` (string): Physical location where the video was filmed
-`duration` (numeric): Length of the video in seconds
-`duration_string` (string): Length of the video (HH:mm:ss)
-`view_count` (numeric): How many users have watched the video on the platform
-`concurrent_view_count` (numeric): How many users are currently watching the video on the platform.
-`like_count` (numeric): Number of positive ratings of the video
-`dislike_count` (numeric): Number of negative ratings of the video
-`repost_count` (numeric): Number of reposts of the video
-`average_rating` (numeric): Average rating give by users, the scale used depends on the webpage
-`comment_count` (numeric): Number of comments on the video (For some extractors, comments are only downloaded at the end, and so this field cannot be used)
-`age_limit` (numeric): Age restriction for the video (years)
-`live_status` (string): One of "not_live", "is_live", "is_upcoming", "was_live", "post_live" (was live, but VOD is not yet processed)
-`is_live` (boolean): Whether this video is a live stream or a fixed-length video
-`was_live` (boolean): Whether this video was originally a live stream
-`playable_in_embed` (string): Whether this video is allowed to play in embedded players on other sites
-`availability` (string): Whether the video is "private", "premium_only", "subscriber_only", "needs_auth", "unlisted" or "public"
-`start_time` (numeric): Time in seconds where the reproduction should start, as specified in the URL
-`end_time` (numeric): Time in seconds where the reproduction should end, as specified in the URL
-`extractor` (string): Name of the extractor
-`extractor_key` (string): Key name of the extractor
-`epoch` (numeric): Unix epoch of when the information extraction was completed
-`autonumber` (numeric): Number that will be increased with each download, starting at `--autonumber-start`
-`video_autonumber` (numeric): Number that will be increased with each video
-`n_entries` (numeric): Total number of extracted items in the playlist
-`playlist_id` (string): Identifier of the playlist that contains the video
-`playlist_title` (string): Name of the playlist that contains the video
-`playlist` (string): `playlist_id` or `playlist_title`
-`playlist_count` (numeric): Total number of items in the playlist. May not be known if entire playlist is not extracted
-`playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according the final index
-`playlist_autonumber` (numeric): Position of the video in the playlist download queue padded with leading zeros according to the total length of the playlist
-`playlist_uploader` (string): Full name of the playlist uploader
-`playlist_uploader_id` (string): Nickname or id of the playlist uploader
-`webpage_url` (string): A URL to the video webpage which if given to yt-dlp should allow to get the same result again
-`webpage_url_basename` (string): The basename of the webpage URL
-`webpage_url_domain` (string): The domain of the webpage URL
-`original_url` (string): The URL given by the user (or same as `webpage_url` for playlist entries)
All the fields in [Filtering Formats](https://github.com/yt-dlp/yt-dlp#filtering-formats) can also be used
Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. E.g. for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `yt-dlp test video` and id `BaW_jenozKc`, this will result in a `yt-dlp test video-BaW_jenozKc.mp4` file created in the current directory.
Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with placeholder value provided with `--output-na-placeholder` (`NA` by default).
For numeric sequences you can use [numeric related formatting](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting); e.g. `%(view_count)05d` will result in a string with view count padded with zeros up to 5 characters, like in `00042`.
Output templates can also contain arbitrary hierarchical path, e.g. `-o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"` which will result in downloading each video in a directory corresponding to this path template. Any missing directory will be automatically created for you.
In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title.