2277 lines
153 KiB
Raw Permalink Normal View History

2021-04-11 02:22:55 +02:00
<div align="center">
2021-08-02 07:15:02 +02:00
2021-01-12 17:17:22 +01:00
[![Release version](](#installation "Installation")
[![PyPi](]( "PyPi")
2022-01-19 23:57:07 +01:00
[![Donate](]( "Donate")
[![Matrix](]( "Matrix")
[![Discord](]( "Discord")
2022-01-19 23:57:07 +01:00
[![Supported Sites](]( "Supported Sites")
[![License: Unlicense](](LICENSE "License")
[![CI Status](]( "CI Status")
2022-01-19 23:57:07 +01:00
[![Commits](]( "Commit History")
2023-07-06 15:48:35 +02:00
[![Last Commit](]( "Last activity")
2021-01-07 07:41:05 +01:00
2021-04-11 02:22:55 +02:00
2021-01-07 07:41:05 +01:00
2021-04-11 02:22:55 +02:00
yt-dlp is a [youtube-dl]( fork based on the now inactive [youtube-dlc]( The main focus of this project is adding new features and patches while also keeping up to date with the original project
2017-10-20 21:11:11 +02:00
2021-01-08 18:20:49 +01:00
* [NEW FEATURES](#new-features)
* [Differences in default behavior](#differences-in-default-behavior)
2021-01-07 07:41:05 +01:00
* [INSTALLATION](#installation)
2022-09-10 00:16:54 +02:00
* [Detailed instructions](
* [Update](#update)
* [Release Files](#release-files)
* [Dependencies](#dependencies)
* [Compile](#compile)
2021-04-11 02:22:55 +02:00
* [USAGE AND OPTIONS](#usage-and-options)
* [General Options](#general-options)
2021-01-04 18:50:13 +01:00
* [Network Options](#network-options)
2021-04-11 02:22:55 +02:00
* [Geo-restriction](#geo-restriction)
2021-01-04 18:50:13 +01:00
* [Video Selection](#video-selection)
* [Download Options](#download-options)
* [Filesystem Options](#filesystem-options)
2021-04-11 02:22:55 +02:00
* [Thumbnail Options](#thumbnail-options)
2021-01-04 18:50:13 +01:00
* [Internet Shortcut Options](#internet-shortcut-options)
* [Verbosity and Simulation Options](#verbosity-and-simulation-options)
2021-01-04 18:50:13 +01:00
* [Workarounds](#workarounds)
* [Video Format Options](#video-format-options)
* [Subtitle Options](#subtitle-options)
* [Authentication Options](#authentication-options)
* [Post-processing Options](#post-processing-options)
* [SponsorBlock Options](#sponsorblock-options)
2021-01-04 18:50:13 +01:00
* [Extractor Options](#extractor-options)
2021-01-07 07:41:05 +01:00
* [CONFIGURATION](#configuration)
* [Configuration file encoding](#configuration-file-encoding)
* [Authentication with netrc](#authentication-with-netrc)
* [Notes about environment variables](#notes-about-environment-variables)
2021-01-07 07:41:05 +01:00
* [OUTPUT TEMPLATE](#output-template)
2021-01-04 18:50:13 +01:00
* [Output template examples](#output-template-examples)
2021-01-07 07:41:05 +01:00
* [FORMAT SELECTION](#format-selection)
2021-01-04 18:50:13 +01:00
* [Filtering Formats](#filtering-formats)
* [Sorting Formats](#sorting-formats)
* [Format Selection examples](#format-selection-examples)
* [MODIFYING METADATA](#modifying-metadata)
* [Modifying metadata examples](#modifying-metadata-examples)
* [EXTRACTOR ARGUMENTS](#extractor-arguments)
* [PLUGINS](#plugins)
* [Installing Plugins](#installing-plugins)
* [Developing Plugins](#developing-plugins)
* [EMBEDDING YT-DLP](#embedding-yt-dlp)
* [Embedding examples](#embedding-examples)
* [DEPRECATED OPTIONS](#deprecated-options)
* [Opening an Issue](
* [Developer Instructions](
* [WIKI](
2022-09-10 00:16:54 +02:00
* [FAQ](
2021-01-04 18:50:13 +01:00
2021-01-08 18:20:49 +01:00
2021-12-01 01:16:15 +01:00
* Forked from [**yt-dlc@f9401f2**]( and merged with [**youtube-dl@66ab08**]( ([exceptions](
2021-01-08 18:20:49 +01:00
* **[SponsorBlock Integration](#sponsorblock-options)**: You can mark/remove sponsor sections in YouTube videos by utilizing the [SponsorBlock]( API
2021-01-08 18:20:49 +01:00
* **[Format Sorting](#sorting-formats)**: The default format sorting options have been changed so that higher resolution and better codecs will be now preferred instead of simply using larger bitrate. Furthermore, you can now specify the sort order using `-S`. This allows for much easier format selection than what is possible by simply using `--format` ([examples](#format-selection-examples))
2021-01-08 18:20:49 +01:00
* **Merged with animelover1984/youtube-dl**: You get most of the features and improvements from [animelover1984/youtube-dl]( including `--write-comments`, `BiliBiliSearch`, `BilibiliChannel`, Embedding thumbnail in mp4/ogg/opus, playlist infojson etc. Note that NicoNico livestreams are not available. See [#31]( for details.
2021-01-29 18:51:20 +01:00
2022-06-28 07:10:54 +02:00
* **YouTube improvements**:
* Supports Clips, Stories (`ytstories:<channel UCID>`), Search (including filters)**\***, YouTube Music Search, Channel-specific search, Search prefixes (`ytsearch:`, `ytsearchdate:`)**\***, Mixes, and Feeds (`:ytfav`, `:ytwatchlater`, `:ytsubs`, `:ythistory`, `:ytrec`, `:ytnotif`)
2022-06-28 07:10:54 +02:00
* Fix for [n-sig based throttling]( **\***
* Supports some (but not all) age-gated content without cookies
* Download livestreams from the start using `--live-from-start` (*experimental*)
* `255kbps` audio is extracted (if available) from YouTube Music when premium cookies are given
* Channel URLs download all uploads of the channel, including shorts and live
* **Cookies from browser**: Cookies can be automatically extracted from all major web browsers using `--cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER]`
* **Download time range**: Videos can be downloaded partially based on either timestamps or chapters using `--download-sections`
2021-03-15 01:00:18 +01:00
* **Split video by chapters**: Videos can be split into multiple files based on chapters using `--split-chapters`
2021-04-11 02:22:55 +02:00
* **Multi-threaded fragment downloads**: Download multiple fragments of m3u8/mpd videos in parallel. Use `--concurrent-fragments` (`-N`) option to set the number of threads used
2021-02-09 21:06:02 +01:00
2021-04-11 02:22:55 +02:00
* **Aria2c with HLS/DASH**: You can use `aria2c` as the external downloader for DASH(mpd) and HLS(m3u8) formats
* **New and fixed extractors**: Many new extractors have been added and a lot of existing ones have been fixed. See the [changelog]( or the [list of supported sites](
2021-11-06 05:00:38 +01:00
2022-06-10 21:03:54 +02:00
* **New MSOs**: Philo, Spectrum, SlingTV, Cablevision, RCN etc.
2021-06-01 00:04:31 +02:00
* **Subtitle extraction from manifests**: Subtitles can be extracted from streaming media manifests. See [commit/be6202f]( for details
2021-01-08 18:20:49 +01:00
2021-03-15 01:00:18 +01:00
* **Multiple paths and output templates**: You can give different [output templates](#output-template) and download paths for different types of files. You can also set a temporary path where intermediary files are downloaded to using `--paths` (`-P`)
2021-01-24 17:01:13 +01:00
* **Portable Configuration**: Configuration files are automatically loaded from the home and root directories. See [CONFIGURATION](#configuration) for details
2021-01-24 17:01:13 +01:00
2021-08-10 16:40:39 +02:00
* **Output template improvements**: Output templates can now have date-time formatting, numeric offsets, object traversal etc. See [output template](#output-template) for details. Even more advanced operations can also be done with the help of `--parse-metadata` and `--replace-in-metadata`
* **Other new options**: Many new options have been added such as `--alias`, `--print`, `--concat-playlist`, `--wait-for-video`, `--retry-sleep`, `--sleep-requests`, `--convert-thumbnails`, `--force-download-archive`, `--force-overwrites`, `--break-match-filter` etc
2021-01-24 17:01:13 +01:00
* **Improvements**: Regex and other operators in `--format`/`--match-filter`, multiple `--postprocessor-args` and `--downloader-args`, faster archive checking, more [format selection options](#format-selection), merge multi-video/audio, multiple `--config-locations`, `--exec` at different stages, etc
2021-01-20 22:21:45 +01:00
2021-11-06 05:00:38 +01:00
* **Plugins**: Extractors and PostProcessors can be loaded from an external file. See [plugins](#plugins) for details
2021-04-11 02:22:55 +02:00
* **Self updater**: The releases can be updated using `yt-dlp -U`, and downgraded using `--update-to` if required
* **Nightly builds**: [Automated nightly builds](#update-channels) can be used with `--update-to nightly`
2021-02-15 23:34:27 +01:00
See [changelog]( or [commits]( for the full list of changes
2021-01-07 21:35:52 +01:00
2022-06-28 07:10:54 +02:00
Features marked with a **\*** have been back-ported to youtube-dl
### Differences in default behavior
Some of yt-dlp's default options are different from that of youtube-dl and youtube-dlc:
2023-02-28 19:01:02 +01:00
* yt-dlp supports only [Python 3.7+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](; while [youtube-dl still supports Python 2.6+ and 3.2+](
* The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details
* `avconv` is not supported as an alternative to `ffmpeg`
* yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations
* The default [output template](#output-template) is `%(title)s [%(id)s].%(ext)s`. There is no real reason for this change. This was changed before yt-dlp was ever made public and now there are no plans to change it back to `%(title)s-%(id)s.%(ext)s`. Instead, you may use `--compat-options filename`
2021-07-31 08:08:39 +02:00
* The default [format sorting](#sorting-formats) is different from youtube-dl and prefers higher resolution and better codecs rather than higher bitrates. You can use the `--format-sort` option to change this to any order you prefer, or use `--compat-options format-sort` to use youtube-dl's sorting order
* The default format selector is `bv*+ba/b`. This means that if a combined video + audio format that is better than the best video-only format is found, the former will be preferred. Use `-f bv+ba/b` or `--compat-options format-spec` to revert this
* Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video streams into one file by default (since this conflicts with the use of `-f bv*+ba`). If needed, this feature must be enabled using `--audio-multistreams` and `--video-multistreams`. You can also use `--compat-options multistreams` to enable both
* `--no-abort-on-error` is enabled by default. Use `--abort-on-error` or `--compat-options abort-on-error` to abort on errors instead
* When writing metadata files such as thumbnails, description or infojson, the same information (if available) is also written for playlists. Use `--no-write-playlist-metafiles` or `--compat-options no-playlist-metafiles` to not write these files
* `--add-metadata` attaches the `infojson` to `mkv` files in addition to writing the metadata when used with `--write-info-json`. Use `--no-embed-info-json` or `--compat-options no-attach-info-json` to revert this
2022-01-03 20:37:24 +01:00
* Some metadata are embedded into different fields when using `--add-metadata` as compared to youtube-dl. Most notably, `comment` field contains the `webpage_url` and `synopsis` contains the `description`. You can [use `--parse-metadata`](#modifying-metadata) to modify this to your liking or use `--compat-options embed-metadata` to revert this
* `playlist_index` behaves differently when used with options like `--playlist-reverse` and `--playlist-items`. See [#302]( for details. You can use `--compat-options playlist-index` if you want to keep the earlier behavior
* The output of `-F` is listed in a new format. Use `--compat-options list-formats` to revert this
* Live chats (if available) are considered as subtitles. Use `--sub-langs all,-live_chat` to download all subtitles except live chat. You can also use `--compat-options no-live-chat` to prevent any live chat/danmaku from downloading
* YouTube channel URLs download all uploads of the channel. To download only the videos in a specific tab, pass the tab's URL. If the channel does not show the requested tab, an error will be raised. Also, `/live` URLs raise an error if there are no live videos instead of silently downloading the entire channel. You may use `--compat-options no-youtube-channel-redirect` to revert all these redirections
* Unavailable videos are also listed for YouTube playlists. Use `--compat-options no-youtube-unavailable-videos` to remove this
* The upload dates extracted from YouTube are in UTC [when available]( Use `--compat-options no-youtube-prefer-utc-upload-date` to prefer the non-UTC upload date.
* If `ffmpeg` is used as the downloader, the downloading and merging of formats happen in a single step when possible. Use `--compat-options no-direct-merge` to revert this
* Thumbnail embedding in `mp4` is done with mutagen if possible. Use `--compat-options embed-thumbnail-atomicparsley` to force the use of AtomicParsley instead
* Some internal metadata such as filenames are removed by default from the infojson. Use `--no-clean-infojson` or `--compat-options no-clean-infojson` to revert this
* When `--embed-subs` and `--write-subs` are used together, the subtitles are written to disk and also embedded in the media file. You can use just `--embed-subs` to embed the subs and automatically delete the separate file. See [#630 (comment)]( for more info. `--compat-options no-keep-subs` can be used to revert this
* `certifi` will be used for SSL root certificates, if installed. If you want to use system certificates (e.g. self-signed), use `--compat-options no-certifi`
2022-08-14 23:45:05 +02:00
* yt-dlp's sanitization of invalid characters in filenames is different/smarter than in youtube-dl. You can use `--compat-options filename-sanitization` to revert to youtube-dl's behavior
* yt-dlp tries to parse the external downloader outputs into the standard progress output if possible (Currently implemented: [~~aria2c~~]( You can use `--compat-options no-external-downloader-progress` to get the downloader output as-is
* yt-dlp versions between 2021.09.01 and 2023.01.02 applies `--match-filter` to nested playlists. This was an unintentional side-effect of [8f18ac]( and is fixed in [d7b460]( Use `--compat-options playlist-match-filter` to revert this
For ease of use, a few more compat options are available:
* `--compat-options all`: Use all compat options (Do NOT use)
* `--compat-options youtube-dl`: Same as `--compat-options all,-multistreams,-playlist-match-filter`
* `--compat-options youtube-dlc`: Same as `--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter`
* `--compat-options 2021`: Same as `--compat-options 2022,no-certifi,filename-sanitization,no-youtube-prefer-utc-upload-date`
* `--compat-options 2022`: Same as `--compat-options playlist-match-filter,no-external-downloader-progress`. Use this to enable all future compat options
2014-05-13 11:16:11 +02:00
2021-01-04 18:50:13 +01:00
2022-01-19 23:57:07 +01:00
2022-05-16 16:06:36 +02:00
2022-01-19 23:57:07 +01:00
[![Source Tarball](](
[![Other variants](](#release-files)
[![All versions](](
2022-01-19 23:57:07 +01:00
You can install yt-dlp using [the binaries](#release-files), [pip]( or one using a third-party package manager. See [the wiki]( for detailed instructions
2021-11-03 23:10:35 +01:00
2023-03-03 18:10:16 +01:00
You can use `yt-dlp -U` to update if you are using the [release binaries](#release-files)
If you [installed with pip](, simply re-run the same command that was used to install the program
For other third-party package managers, see [the wiki]( or refer their documentation
<a id="update-channels"/>
There are currently two release channels for binaries, `stable` and `nightly`.
2023-03-04 18:10:08 +01:00
`stable` is the default channel, and many of its changes have been tested by users of the nightly channel.
The `nightly` channel has releases built after each push to the master branch, and will have the most recent fixes and additions, but also have more risk of regressions. They are available in [their own repo](
When using `--update`/`-U`, a release binary will only update to its current channel.
`--update-to CHANNEL` can be used to switch to a different channel when a newer version is available. `--update-to [CHANNEL@]TAG` can also be used to upgrade or downgrade to specific tags from a channel.
You may also use `--update-to <repository>` (`<owner>/<repository>`) to update to a channel on a completely different repository. Be careful with what repository you are updating to though, there is no verification done for binaries from different repositories.
Example usage:
* `yt-dlp --update-to nightly` change to `nightly` channel and update to its latest release
* `yt-dlp --update-to stable@2023.02.17` upgrade/downgrade to release to `stable` channel tag `2023.02.17`
* `yt-dlp --update-to 2023.01.06` upgrade/downgrade to tag `2023.01.06` if it exists on the current channel
* `yt-dlp --update-to example/yt-dlp@2023.03.01` upgrade/downgrade to the release from the `example/yt-dlp` repository, tag `2023.03.01`
2021-11-03 23:10:35 +01:00
#### Recommended
[yt-dlp](|Platform-independent [zipimport]( binary. Needs Python (recommended for **Linux/BSD**)
[yt-dlp.exe](|Windows (Win7 SP1+) standalone x64 binary (recommended for **Windows**)
2022-07-08 21:37:47 +02:00
[yt-dlp_macos](|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**)
#### Alternatives
[yt-dlp_x86.exe](|Windows (Vista SP2+) standalone x86 (32-bit) binary
2022-06-20 07:18:29 +02:00
[yt-dlp_min.exe](|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`<br/> ([Not recommended](#standalone-py2exe-builds-windows))
2022-07-08 21:37:47 +02:00
[yt-dlp_linux](|Linux standalone x64 binary
[](|Unpackaged Linux executable (no auto-update)
[yt-dlp_linux_armv7l](|Linux standalone armv7l (32-bit) binary
[yt-dlp_linux_aarch64](|Linux standalone aarch64 (64-bit) binary
[](|Unpackaged Windows executable (no auto-update)
[](|Unpackaged MacOS (10.15+) executable (no auto-update)
[yt-dlp_macos_legacy](|MacOS (10.9+) standalone x64 executable
#### Misc
[yt-dlp.tar.gz](|Source tarball
[SHA2-512SUMS](|GNU-style SHA512 sums
[SHA2-512SUMS.sig](|GPG signature file for SHA512 sums
[SHA2-256SUMS](|GNU-style SHA256 sums
[SHA2-256SUMS.sig](|GPG signature file for SHA256 sums
The public key that can be used to verify the GPG signatures is [available here](
Example usage:
curl -L | gpg --import
gpg --verify SHA2-256SUMS.sig SHA2-256SUMS
gpg --verify SHA2-512SUMS.sig SHA2-512SUMS
**Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](
2021-11-03 23:10:35 +01:00
Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly.
2021-04-11 02:22:55 +02:00
<!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created
<!x-- --x>
On windows, [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)]( is also necessary to run yt-dlp. You probably already have this, but if the executable throws an error due to missing `MSVCR100.dll` you need to install it manually.
While all the other dependencies are optional, `ffmpeg` and `ffprobe` are highly recommended
2022-06-20 07:18:29 +02:00
### Strongly recommended
* [**ffmpeg** and **ffprobe**]( - Required for [merging separate video and audio files](#format-selection) as well as for various [post-processing](#post-processing-options) tasks. License [depends on the build](
2022-06-20 07:18:29 +02:00
There are bugs in ffmpeg that causes various issues when used alongside yt-dlp. Since ffmpeg is such an important dependency, we provide [custom builds]( with patches for some of these issues at [yt-dlp/FFmpeg-Builds]( See [the readme]( for details on the specific issues solved by these builds
**Important**: What you need is ffmpeg *binary*, **NOT** [the python package of the same name](
2022-06-20 07:18:29 +02:00
### Networking
* [**certifi**](\* - Provides Mozilla's root certificate bundle. Licensed under [MPLv2](
2022-06-20 07:18:29 +02:00
* [**brotli**](\* or [**brotlicffi**]( - [Brotli]( content encoding support. Both licensed under MIT <sup>[1]( [2]( </sup>
* [**websockets**](\* - For downloading over websocket. Licensed under [BSD-3-Clause](
### Metadata
* [**mutagen**](\* - For `--embed-thumbnail` in certain formats. Licensed under [GPLv2+](
* [**AtomicParsley**]( - For `--embed-thumbnail` in `mp4`/`m4a` files when `mutagen`/`ffmpeg` cannot. Licensed under [GPLv2+](
* [**xattr**](, [**pyxattr**]( or [**setfattr**]( - For writing xattr metadata (`--xattr`) on **Linux**. Licensed under [MIT](, [LGPL2.1]( and [GPLv2+]( respectively
### Misc
* [**pycryptodomex**](\* - For decrypting AES-128 HLS streams and various other data. Licensed under [BSD-2-Clause](
* [**phantomjs**]( - Used in extractors where javascript needs to be run. Licensed under [BSD-3-Clause](
2022-06-20 07:18:29 +02:00
* [**secretstorage**]( - For `--cookies-from-browser` to access the **Gnome** keyring while decrypting cookies of **Chromium**-based browsers on **Linux**. Licensed under [BSD-3-Clause](
* Any external downloader that you want to use with `--downloader`
2021-04-11 02:22:55 +02:00
2022-09-10 00:16:54 +02:00
### Deprecated
2022-06-20 07:18:29 +02:00
* [**avconv** and **avprobe**]( - Now **deprecated** alternative to ffmpeg. License [depends on the build](
* [**sponskrub**]( - For using the now **deprecated** [sponskrub options](#sponskrub-options). Licensed under [GPLv3+](
2022-06-22 00:17:41 +02:00
* [**rtmpdump**]( - For downloading `rtmp` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](
* [**mplayer**]( or [**mpv**]( - For downloading `rstp`/`mms` streams. ffmpeg can be used instead with `--downloader ffmpeg`. Licensed under [GPLv2+](
2022-06-20 07:18:29 +02:00
To use or redistribute the dependencies, you must agree to their respective licensing terms.
2022-07-08 21:37:47 +02:00
The standalone release binaries are built with the Python interpreter and the packages marked with **\*** included.
2022-06-20 07:18:29 +02:00
If you do not have the necessary dependencies for a task you are attempting, yt-dlp will warn you. All the currently available dependencies are visible at the top of the `--verbose` output
2021-11-03 23:10:35 +01:00
2022-06-20 07:18:29 +02:00
### Standalone PyInstaller Builds
To build the standalone executable, you must have Python and `pyinstaller` (plus any of yt-dlp's [optional dependencies](#dependencies) if needed). Once you have all the necessary dependencies installed, simply run ``. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used.
2022-06-20 07:18:29 +02:00
python3 -m pip install -U pyinstaller -r requirements.txt
python3 devscripts/
On some systems, you may need to use `py` or `python` instead of `python3`.
`` accepts any arguments that can be passed to `pyinstaller`, such as `--onefile/-F` or `--onedir/-D`, which is further [documented here](
**Note**: Pyinstaller versions below 4.4 [do not support]( Python installed from the Windows store without using a virtual environment.
2022-06-20 07:18:29 +02:00
**Important**: Running `pyinstaller` directly **without** using `` is **not** officially supported. This may or may not work correctly.
2022-06-20 07:18:29 +02:00
### Platform-independent Binary (UNIX)
2022-09-10 00:16:54 +02:00
You will need the build tools `python` (3.7+), `zip`, `make` (GNU), `pandoc`\* and `pytest`\*.
2022-06-20 07:18:29 +02:00
After installing these, simply run `make`.
2022-08-19 01:28:54 +02:00
You can also run `make yt-dlp` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\*** are not needed for this)
2014-05-13 11:16:11 +02:00
2022-06-20 07:18:29 +02:00
### Standalone Py2Exe Builds (Windows)
While we provide the option to build with [py2exe](, it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi` and needs VC++14** on the target computer to run.
If you wish to build it anyway, install Python and py2exe, and then simply run ` py2exe`
py -m pip install -U py2exe -r requirements.txt
py devscripts/
py py2exe
### Related scripts
* **`devscripts/`** - Update the version number based on current date.
* **`devscripts/`** - Set the build variant of the executable.
* **`devscripts/`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file.
2022-06-20 07:18:29 +02:00
* **`devscripts/`** - Create lazy extractors. Running this before building the binaries (any variant) will improve their startup performance. Set the environment variable `YTDLP_NO_LAZY_EXTRACTORS=1` if you wish to forcefully disable lazy extractor loading.
Note: See their `--help` for more info.
### Forking the project
If you fork the project on GitHub, you can run your fork's [build workflow](.github/workflows/build.yml) to automatically build the selected version(s) as artifacts. Alternatively, you can run the [release workflow](.github/workflows/release.yml) or enable the [nightly workflow](.github/workflows/release-nightly.yml) to create full (pre-)releases.
2021-04-11 02:22:55 +02:00
2011-08-06 01:14:13 +02:00
yt-dlp [OPTIONS] [--] URL [URL...]
2021-01-04 18:02:43 +01:00
`Ctrl+F` is your friend :D
2021-01-04 18:02:43 +01:00
<!-- Auto generated -->
2021-01-07 07:41:05 +01:00
## General Options:
-h, --help Print this help text and exit
--version Print program version and exit
-U, --update Update this program to the latest version
--no-update Do not check for updates (default)
--update-to [CHANNEL]@[TAG] Upgrade/downgrade to a specific version.
CHANNEL can be a repository as well. CHANNEL
and TAG default to "stable" and "latest"
respectively if omitted; See "UPDATE" for
details. Supported channels: stable, nightly
-i, --ignore-errors Ignore download and postprocessing errors.
The download will be considered successful
even if the postprocessing fails
--no-abort-on-error Continue with next video on download errors;
e.g. to skip unavailable videos in a
playlist (default)
--abort-on-error Abort downloading of further videos if an
error occurs (Alias: --no-ignore-errors)
--dump-user-agent Display the current user-agent and exit
--list-extractors List all supported extractors and exit
--extractor-descriptions Output descriptions of all supported
extractors and exit
--use-extractors NAMES Extractor names to use separated by commas.
You can also use regexes, "all", "default"
and "end" (end URL matching); e.g. --ies
"holodex.*,end,youtube". Prefix the name
with a "-" to exclude it, e.g. --ies
default,-generic. Use --list-extractors for
a list of extractor names. (Alias: --ies)
--default-search PREFIX Use this prefix for unqualified URLs. E.g.
"gvsearch2:python" downloads two videos from
google videos for the search term "python".
Use the value "auto" to let yt-dlp guess
("auto_warning" to emit a warning when
guessing). "error" just throws an error. The
default value "fixup_error" repairs broken
URLs, but emits an error if this is not
possible instead of searching
--ignore-config Don't load any more configuration files
except those given by --config-locations.
For backward compatibility, if this option
is found inside the system configuration
file, the user configuration is not loaded.
(Alias: --no-config)
--no-config-locations Do not load any custom configuration files
(default). When given inside a configuration
file, ignore all previous --config-locations
defined in the current file
--config-locations PATH Location of the main configuration file;
either the path to the config or its
containing directory ("-" for stdin). Can be
used multiple times and inside other
configuration files
--flat-playlist Do not extract the videos of a playlist,
only list them
--no-flat-playlist Fully extract the videos of a playlist
--live-from-start Download livestreams from the start.
Currently only supported for YouTube
--no-live-from-start Download livestreams from the current time
--wait-for-video MIN[-MAX] Wait for scheduled streams to become
available. Pass the minimum number of
seconds (or range) to wait between retries
--no-wait-for-video Do not wait for scheduled streams (default)
--mark-watched Mark videos watched (even with --simulate)
--no-mark-watched Do not mark videos watched (default)
--color [STREAM:]POLICY Whether to emit color codes in output,
optionally prefixed by the STREAM (stdout or
stderr) to apply the setting to. Can be one
of "always", "auto" (default), "never", or
"no_color" (use non color terminal
sequences). Can be used multiple times
--compat-options OPTS Options that can help keep compatibility
with youtube-dl or youtube-dlc
configurations by reverting some of the
changes made in yt-dlp. See "Differences in
default behavior" for details
--alias ALIASES OPTIONS Create aliases for an option string. Unless
an alias starts with a dash "-", it is
prefixed with "--". Arguments are parsed
according to the Python string formatting
mini-language. E.g. --alias get-audio,-X
"-S=aext:{0},abr -x --audio-format {0}"
creates options "--get-audio" and "-X" that
takes an argument (ARG0) and expands to
"-S=aext:ARG0,abr -x --audio-format ARG0".
All defined aliases are listed in the --help
output. Alias options can trigger more
aliases; so be careful to avoid defining
recursive options. As a safety measure, each
alias may be triggered a maximum of 100
times. This option can be used multiple times
2011-09-14 22:55:09 +02:00
2015-01-10 20:06:13 +01:00
## Network Options:
--proxy URL Use the specified HTTP/HTTPS/SOCKS proxy. To
enable SOCKS proxy, specify a proper scheme,
e.g. socks5://user:pass@
Pass in an empty string (--proxy "") for
direct connection
--socket-timeout SECONDS Time to wait before giving up, in seconds
--source-address IP Client-side IP address to bind to
-4, --force-ipv4 Make all connections via IPv4
-6, --force-ipv6 Make all connections via IPv6
--enable-file-urls Enable file:// URLs. This is disabled by
default for security reasons.
2017-02-21 17:48:24 +01:00
2021-04-11 02:22:55 +02:00
## Geo-restriction:
--geo-verification-proxy URL Use this proxy to verify the IP address for
some geo-restricted sites. The default proxy
specified by --proxy (or none, if the option
is not present) is used for the actual
--xff VALUE How to fake X-Forwarded-For HTTP header to
try bypassing geographic restriction. One of
"default" (only when known to be useful),
"never", an IP block in CIDR notation, or a
two-letter ISO 3166-2 country code
2015-01-10 20:06:13 +01:00
## Video Selection:
2022-11-30 07:04:51 +01:00
-I, --playlist-items ITEM_SPEC Comma separated playlist_index of the items
to download. You can specify a range using
"[START]:[STOP][:STEP]". For backward
compatibility, START-STOP is also supported.
Use negative indices to count from the right
and negative STEP to download in reverse
order. E.g. "-I 1:3,7,-5::2" used on a
2022-11-30 07:04:51 +01:00
playlist of size 15 will download the items
at index 1,2,3,7,11,13,15
2022-11-30 07:04:51 +01:00
--min-filesize SIZE Abort download if filesize is smaller than
SIZE, e.g. 50k or 44.6M
--max-filesize SIZE Abort download if filesize is larger than
SIZE, e.g. 50k or 44.6M
--date DATE Download only videos uploaded on this date.
The date can be "YYYYMMDD" or in the format
E.g. "--date today-2weeks" downloads only
videos uploaded on the same day two weeks ago
--datebefore DATE Download only videos uploaded on or before
this date. The date formats accepted is the
same as --date
--dateafter DATE Download only videos uploaded on or after
this date. The date formats accepted is the
same as --date
--match-filters FILTER Generic video filter. Any "OUTPUT TEMPLATE"
field can be compared with a number or a
string using the operators defined in
"Filtering Formats". You can also simply
specify a field to match if the field is
present, use "!field" to check if the field
is not present, and "&" to check multiple
conditions. Use a "\" to escape "&" or
quotes if needed. If used multiple times,
the filter matches if atleast one of the
conditions are met. E.g. --match-filter
!is_live --match-filter "like_count>?100 &
description~='(?i)\bcats \& dogs\b'" matches
only videos that are not live OR those that
have a like count more than 100 (or the like
field is not available) and also has a
description that contains the phrase "cats &
dogs" (caseless). Use "--match-filter -" to
interactively ask whether to download each
--no-match-filters Do not use any --match-filter (default)
--break-match-filters FILTER Same as "--match-filters" but stops the
download process when a video is rejected
--no-break-match-filters Do not use any --break-match-filters (default)
--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
--age-limit YEARS Download only videos suitable for the given
--download-archive FILE Download only videos not listed in the
archive file. Record the IDs of all
downloaded videos in it
--no-download-archive Do not use archive file (default)
--max-downloads NUMBER Abort after downloading NUMBER files
--break-on-existing Stop the download process when encountering
a file that is in the archive
2022-11-30 07:04:51 +01:00
--break-per-input Alters --max-downloads, --break-on-existing,
--break-match-filter, and autonumber to
reset per input URL
--no-break-per-input --break-on-existing and similar options
terminates the entire download queue
--skip-playlist-after-errors N Number of allowed failures until the rest of
the playlist is skipped
2011-08-06 01:14:13 +02:00
2013-07-02 09:14:09 +02:00
## Download Options:
-N, --concurrent-fragments N Number of fragments of a dash/hlsnative
video that should be downloaded concurrently
(default is 1)
-r, --limit-rate RATE Maximum download rate in bytes per second,
e.g. 50K or 4.2M
--throttled-rate RATE Minimum download rate in bytes per second
below which throttling is assumed and the
video data is re-extracted, e.g. 100K
-R, --retries RETRIES Number of retries (default is 10), or
--file-access-retries RETRIES Number of times to retry on file access
error (default is 3), or "infinite"
--fragment-retries RETRIES Number of retries for a fragment (default is
10), or "infinite" (DASH, hlsnative and ISM)
--retry-sleep [TYPE:]EXPR Time to sleep between retries in seconds
(optionally) prefixed by the type of retry
(http (default), fragment, file_access,
extractor) to apply the sleep to. EXPR can
be a number, linear=START[:END[:STEP=1]] or
exp=START[:END[:BASE=2]]. This option can be
used multiple times to set the sleep for the
different retry types, e.g. --retry-sleep
linear=1::2 --retry-sleep fragment:exp=1:20
--skip-unavailable-fragments Skip unavailable fragments for DASH,
hlsnative and ISM downloads (default)
(Alias: --no-abort-on-unavailable-fragments)
Abort download if a fragment is unavailable
(Alias: --no-skip-unavailable-fragments)
--keep-fragments Keep downloaded fragments on disk after
downloading is finished
--no-keep-fragments Delete downloaded fragments after
downloading is finished (default)
--buffer-size SIZE Size of download buffer, e.g. 1024 or 16K
(default is 1024)
--resize-buffer The buffer size is automatically resized
from an initial value of --buffer-size
--no-resize-buffer Do not automatically adjust the buffer size
--http-chunk-size SIZE Size of a chunk for chunk-based HTTP
downloading, e.g. 10485760 or 10M (default
is disabled). May be useful for bypassing
bandwidth throttling imposed by a webserver
--playlist-random Download playlist videos in random order
--lazy-playlist Process entries in the playlist as they are
received. This disables n_entries,
--playlist-random and --playlist-reverse
--no-lazy-playlist Process videos in the playlist only after
the entire playlist is parsed (default)
--xattr-set-filesize Set file xattribute ytdl.filesize with
expected file size
--hls-use-mpegts Use the mpegts container for HLS videos;
allowing some players to play the video
while downloading, and reducing the chance
of file corruption if download is
interrupted. This is enabled by default for
live streams
--no-hls-use-mpegts Do not use the mpegts container for HLS
videos. This is default when not downloading
live streams
--download-sections REGEX Download only chapters that match the
regular expression. A "*" prefix denotes
time-range instead of chapter. Negative
timestamps are calculated from the end.
"*from-url" can be used to download between
the "start_time" and "end_time" extracted
from the URL. Needs ffmpeg. This option can
be used multiple times to download multiple
sections, e.g. --download-sections
"*10:15-inf" --download-sections "intro"