diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 358 |
1 files changed, 117 insertions, 241 deletions
@@ -1,23 +1,4 @@ -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -<div align="center"> - -[](#readme) - -[](#installation "Installation") -[](https://pypi.org/project/yt-dlp "PyPi") -[](Collaborators.md#collaborators "Donate") -[](https://matrix.to/#/#yt-dlp:matrix.org "Matrix") -[](https://discord.gg/H5MNcFW63r "Discord") -[](supportedsites.md "Supported Sites") -[](LICENSE "License") -[](https://github.com/yt-dlp/yt-dlp/actions "CI Status") -[](https://github.com/yt-dlp/yt-dlp/commits "Commit History") -[](https://github.com/yt-dlp/yt-dlp/pulse/monthly "Last activity") - -</div> -<!-- MANPAGE: END EXCLUDED SECTION --> - -yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on the now inactive [youtube-dlc](https://github.com/blackjack4494/yt-dlc). The main focus of this project is adding new features and patches while also keeping up to date with the original project +hypervideo - A fork of yt-dlp without nonfree parts <!-- MANPAGE: MOVE "USAGE AND OPTIONS" SECTION HERE --> @@ -26,7 +7,6 @@ yt-dlp is a [youtube-dl](https://github.com/ytdl-org/youtube-dl) fork based on t * [Differences in default behavior](#differences-in-default-behavior) * [INSTALLATION](#installation) * [Detailed instructions](https://github.com/yt-dlp/yt-dlp/wiki/Installation) - * [Update](#update) * [Release Files](#release-files) * [Dependencies](#dependencies) * [Compile](#compile) @@ -130,16 +110,16 @@ 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: +Some of hypervideo's default options are different from that of youtube-dl and youtube-dlc: * yt-dlp supports only [Python 3.7+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743) * 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` +* hypervideo 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 hypervideo 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` * 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 +* Unlike youtube-dlc, hypervideo 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 @@ -170,106 +150,21 @@ For ease of use, a few more compat options are available: # INSTALLATION -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos) -[](https://pypi.org/project/yt-dlp) -[](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) -[](#release-files) -[](https://github.com/yt-dlp/yt-dlp/releases) -<!-- MANPAGE: END EXCLUDED SECTION --> - -You can install yt-dlp using [the binaries](#release-files), [pip](https://pypi.org/project/yt-dlp) or one using a third-party package manager. See [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation) for detailed instructions - - -## UPDATE -You can use `yt-dlp -U` to update if you are using the [release binaries](#release-files) - -If you [installed with pip](https://github.com/yt-dlp/yt-dlp/wiki/Installation#with-pip), simply re-run the same command that was used to install the program - -For other third-party package managers, see [the wiki](https://github.com/yt-dlp/yt-dlp/wiki/Installation#third-party-package-managers) or refer their documentation - -<a id="update-channels"/> - -There are currently two release channels for binaries, `stable` and `nightly`. -`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](https://github.com/yt-dlp/yt-dlp-nightly-builds/releases). - -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` - -<!-- MANPAGE: BEGIN EXCLUDED SECTION --> -## RELEASE FILES - -#### Recommended - -File|Description -:---|:--- -[yt-dlp](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp)|Platform-independent [zipimport](https://docs.python.org/3/library/zipimport.html) binary. Needs Python (recommended for **Linux/BSD**) -[yt-dlp.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe)|Windows (Win7 SP1+) standalone x64 binary (recommended for **Windows**) -[yt-dlp_macos](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos)|Universal MacOS (10.15+) standalone executable (recommended for **MacOS**) - -#### Alternatives - -File|Description -:---|:--- -[yt-dlp_x86.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_x86.exe)|Windows (Vista SP2+) standalone x86 (32-bit) binary -[yt-dlp_min.exe](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_min.exe)|Windows (Win7 SP1+) standalone x64 binary built with `py2exe`<br/> ([Not recommended](#standalone-py2exe-builds-windows)) -[yt-dlp_linux](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux)|Linux standalone x64 binary -[yt-dlp_linux.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux.zip)|Unpackaged Linux executable (no auto-update) -[yt-dlp_linux_armv7l](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_armv7l)|Linux standalone armv7l (32-bit) binary -[yt-dlp_linux_aarch64](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux_aarch64)|Linux standalone aarch64 (64-bit) binary -[yt-dlp_win.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_win.zip)|Unpackaged Windows executable (no auto-update) -[yt-dlp_macos.zip](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos.zip)|Unpackaged MacOS (10.15+) executable (no auto-update) -[yt-dlp_macos_legacy](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos_legacy)|MacOS (10.9+) standalone x64 executable - -#### Misc - -File|Description -:---|:--- -[yt-dlp.tar.gz](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)|Source tarball -[SHA2-512SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS)|GNU-style SHA512 sums -[SHA2-512SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-512SUMS.sig)|GPG signature file for SHA512 sums -[SHA2-256SUMS](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS)|GNU-style SHA256 sums -[SHA2-256SUMS.sig](https://github.com/yt-dlp/yt-dlp/releases/latest/download/SHA2-256SUMS.sig)|GPG signature file for SHA256 sums - -The public key that can be used to verify the GPG signatures is [available here](https://github.com/yt-dlp/yt-dlp/blob/master/public.key) -Example usage: -``` -curl -L https://github.com/yt-dlp/yt-dlp/raw/master/public.key | gpg --import -gpg --verify SHA2-256SUMS.sig SHA2-256SUMS -gpg --verify SHA2-512SUMS.sig SHA2-512SUMS +```console +# pacman -S hypervideo ``` -<!-- MANPAGE: END EXCLUDED SECTION --> - -**Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) ## DEPENDENCIES Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly. -<!-- Python 3.5+ uses VC++14 and it is already embedded in the binary created -<!x-- https://www.microsoft.com/en-us/download/details.aspx?id=26999 --x> -On windows, [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)](https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe) 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 ### Strongly recommended * [**ffmpeg** and **ffprobe**](https://www.ffmpeg.org) - 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](https://www.ffmpeg.org/legal.html) - 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](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for some of these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) 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](https://pypi.org/project/ffmpeg) + <!-- TODO: ffmpeg has merged this patch. Remove this note once there is new release --> + **Note**: There are some regressions in newer ffmpeg versions that causes various issues when used alongside hypervideo. Since ffmpeg is such an important dependency, we provide [custom builds](https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds) with patches for these issues at [yt-dlp/FFmpeg-Builds](https://github.com/yt-dlp/FFmpeg-Builds). See [the readme](https://github.com/yt-dlp/FFmpeg-Builds#patches-applied) for details on the specific issues solved by these builds ### Networking * [**certifi**](https://github.com/certifi/python-certifi)\* - Provides Mozilla's root certificate bundle. Licensed under [MPLv2](https://github.com/certifi/python-certifi/blob/master/LICENSE) @@ -300,13 +195,13 @@ To use or redistribute the dependencies, you must agree to their respective lice The standalone release binaries are built with the Python interpreter and the packages marked with **\*** included. -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 +If you do not have the necessary dependencies for a task you are attempting, hypervideo will warn you. All the currently available dependencies are visible at the top of the `--verbose` output ## COMPILE ### 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 `pyinst.py`. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used. +To build the standalone executable, you must have Python and `pyinstaller` (plus any of hypervideo's [optional dependencies](#dependencies) if needed). Once you have all the necessary dependencies installed, simply run `pyinst.py`. The executable will be built for the same architecture (x86/ARM, 32/64 bit) as the Python used. python3 -m pip install -U pyinstaller -r requirements.txt python3 devscripts/make_lazy_extractors.py @@ -325,7 +220,7 @@ You will need the build tools `python` (3.7+), `zip`, `make` (GNU), `pandoc`\* a After installing these, simply run `make`. -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) +You can also run `make hypervideo` instead to compile only the binary without updating any of the additional files. (The build tools marked with **\*** are not needed for this) ### Standalone Py2Exe Builds (Windows) @@ -339,9 +234,7 @@ If you wish to build it anyway, install Python and py2exe, and then simply run ` ### Related scripts -* **`devscripts/update-version.py`** - Update the version number based on current date. -* **`devscripts/set-variant.py`** - Set the build variant of the executable. -* **`devscripts/make_changelog.py`** - Create a markdown changelog using short commit messages and update `CONTRIBUTORS` file. +* **`devscripts/set-variant.py variant [-M update_message]`** - Set the build variant of the executable * **`devscripts/make_lazy_extractors.py`** - 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. @@ -352,7 +245,7 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git # USAGE AND OPTIONS <!-- MANPAGE: BEGIN EXCLUDED SECTION --> - yt-dlp [OPTIONS] [--] URL [URL...] + hypervideo [OPTIONS] [--] URL [URL...] `Ctrl+F` is your friend :D <!-- MANPAGE: END EXCLUDED SECTION --> @@ -361,13 +254,6 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git ## 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 @@ -493,7 +379,7 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git --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 + The date can be "YYYYMMDD" or in the format [now|today|yesterday][-N[day|week|month|year]]. E.g. "--date today-2weeks" downloads only videos uploaded on the same day two weeks ago @@ -1148,35 +1034,29 @@ Make chapter entries for, or remove various segments (sponsor, # CONFIGURATION -You can configure yt-dlp by placing any supported command line option to a configuration file. The configuration is loaded from the following locations: +You can configure hypervideo 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` 1. **Portable Configuration**: (Recommended for portable installations) - * If using a binary, `yt-dlp.conf` in the same directory as the binary - * If running from source-code, `yt-dlp.conf` in the parent directory of `yt_dlp` + * If using a binary, `hypervideo.conf` in the same directory as the binary + * If running from source-code, `hypervideo.conf` in the parent directory of `hypervideo` 1. **Home Configuration**: - * `yt-dlp.conf` in the home path given by `-P` + * `hypervideo.conf` in the home path given by `-P` * If `-P` is not given, the current directory is searched 1. **User Configuration**: - * `${XDG_CONFIG_HOME}/yt-dlp.conf` - * `${XDG_CONFIG_HOME}/yt-dlp/config` (recommended on Linux/macOS) - * `${XDG_CONFIG_HOME}/yt-dlp/config.txt` - * `${APPDATA}/yt-dlp.conf` - * `${APPDATA}/yt-dlp/config` (recommended on Windows) - * `${APPDATA}/yt-dlp/config.txt` - * `~/yt-dlp.conf` - * `~/yt-dlp.conf.txt` - * `~/.yt-dlp/config` - * `~/.yt-dlp/config.txt` + * `${XDG_CONFIG_HOME}/hypervideo/config` (recommended on Linux/macOS) + * `${XDG_CONFIG_HOME}/hypervideo.conf` + * `${APPDATA}/hypervideo/config` (recommended on Windows) + * `${APPDATA}/hypervideo/config.txt` + * `~/hypervideo.conf` + * `~/hypervideo.conf.txt` See also: [Notes about environment variables](#notes-about-environment-variables) 1. **System Configuration**: - * `/etc/yt-dlp.conf` - * `/etc/yt-dlp/config` - * `/etc/yt-dlp/config.txt` + * `/etc/hypervideo.conf` -E.g. with the following configuration file yt-dlp will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory: +E.g. with the following configuration file hypervideo will always extract the audio, not copy the mtime, use a proxy and save all videos under `YouTube` directory in your home directory: ``` # Lines starting with # are comments @@ -1195,7 +1075,7 @@ E.g. with the following configuration file yt-dlp will always extract the audio, **Note**: Options in configuration file are just the same options aka switches used in regular command line calls; thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. They must also be quoted when necessary as-if it were a UNIX shell. -You can use `--ignore-config` if you want to disable all configuration files for a particular yt-dlp run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded. +You can use `--ignore-config` if you want to disable all configuration files for a particular hypervideo run. If `--ignore-config` is found inside any configuration file, no further configuration will be loaded. For example, having the option in the portable configuration file prevents loading of home, user, and system configurations. Additionally, (for backward compatibility) if `--ignore-config` is found inside the system configuration file, the user configuration is not loaded. ### Configuration file encoding @@ -1205,7 +1085,7 @@ If you want your file to be decoded differently, add `# coding: ENCODING` to the ### Authentication with netrc -You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every yt-dlp execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you: +You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every hypervideo execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per-extractor basis. For that you will need to create a `.netrc` file in `--netrc-location` and restrict permissions to read/write by only you: ``` touch ${HOME}/.netrc chmod a-rwx,u+rw ${HOME}/.netrc @@ -1219,7 +1099,7 @@ E.g. machine youtube login myaccount@gmail.com password my_youtube_password machine twitch login my_twitch_account_name password my_twitch_password ``` -To activate authentication with the `.netrc` file you should pass `--netrc` to yt-dlp or place it in the [configuration file](#configuration). +To activate authentication with the `.netrc` file you should pass `--netrc` to hypervideo or place it in the [configuration file](#configuration). The default location of the .netrc file is `~` (see below). @@ -1233,7 +1113,7 @@ yt-dlp --netrc-cmd 'gpg --decrypt ~/.authinfo.gpg' https://www.youtube.com/watch ### Notes about environment variables * Environment variables are normally specified as `${VARIABLE}`/`$VARIABLE` on UNIX and `%VARIABLE%` on Windows; but is always shown as `${VARIABLE}` in this documentation -* yt-dlp also allow using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-location` +* hypervideo also allow using UNIX-style variables on Windows for path-like options; e.g. `--output`, `--config-location` * If unset, `${XDG_CONFIG_HOME}` defaults to `~/.config` and `${XDG_CACHE_HOME}` to `~/.cache` * On Windows, `~` points to `${HOME}` if present; or, `${USERPROFILE}` or `${HOMEDRIVE}${HOMEPATH}` otherwise * On Windows, `${USERPROFILE}` generally points to `C:\Users\<user name>` and `${APPDATA}` to `${USERPROFILE}\AppData\Roaming` @@ -1246,7 +1126,7 @@ The `-o` option is used to indicate a template for the output file names while ` **tl;dr:** [navigate me to examples](#output-template-examples). <!-- MANPAGE: END EXCLUDED SECTION --> -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). +The simplest usage of `-o` is not to set any template arguments when downloading a single file, like in `hypervideo -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. @@ -1264,7 +1144,7 @@ The field names themselves (the part inside the parenthesis) can also have some 1. **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` -1. **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) +1. **More Conversions**: In addition to the normal format types `diouxXeEfFgGcrs`, hypervideo 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) 1. **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 @@ -1334,11 +1214,11 @@ The available fields are: - `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` (string): A URL to the video webpage which if given to hypervideo 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](#filtering-formats) can also be used Available for the video that belongs to some logical chapter or section: @@ -1385,10 +1265,6 @@ Available only when used in `--print`: - `thumbnails_table` (table): The thumbnail format table as printed by `--list-thumbnails` - `subtitles_table` (table): The subtitle format table as printed by `--list-subs` - `automatic_captions_table` (table): The automatic subtitle format table as printed by `--list-subs` - - Available only after the video is downloaded (`post_process`/`after_move`): - - - `filepath`: Actual path of downloaded video file Available only in `--sponsorblock-chapter-title`: @@ -1400,7 +1276,7 @@ Available only in `--sponsorblock-chapter-title`: - `name` (string): Friendly name of the smallest category - `type` (string): The [SponsorBlock action type](https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter -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. +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 `hypervideo test video` and id `BaW_jenozKc`, this will result in a `hypervideo test video-BaW_jenozKc.mp4` file created in the current directory. **Note**: 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). @@ -1419,50 +1295,50 @@ In some cases, you don't want special characters such as 中, spaces, or &, such #### Output template examples ```bash -$ yt-dlp --print filename -o "test video.%(ext)s" BaW_jenozKc +$ hypervideo --print filename -o "test video.%(ext)s" BaW_jenozKc test video.webm # Literal name with correct extension -$ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc +$ hypervideo --print filename -o "%(title)s.%(ext)s" BaW_jenozKc youtube-dl test video ''_ä↭𝕐.webm # All kinds of weird characters -$ yt-dlp --print filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames +$ hypervideo --print filename -o "%(title)s.%(ext)s" BaW_jenozKc --restrict-filenames youtube-dl_test_video_.webm # Restricted file name # Download YouTube playlist videos in separate directory indexed by video order in a playlist -$ yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" +$ hypervideo -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Download YouTube playlist videos in separate directories according to their uploaded year -$ yt-dlp -o "%(upload_date>%Y)s/%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" +$ hypervideo -o "%(upload_date>%Y)s/%(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" # Prefix playlist index with " - " separator, but only if it is available -$ yt-dlp -o "%(playlist_index&{} - |)s%(title)s.%(ext)s" BaW_jenozKc "https://www.youtube.com/user/TheLinuxFoundation/playlists" +$ hypervideo -o '%(playlist_index|)s%(playlist_index& - |)s%(title)s.%(ext)s' BaW_jenozKc "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download all playlists of YouTube channel/user keeping each playlist in separate directory: -$ yt-dlp -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/user/TheLinuxFoundation/playlists" +$ hypervideo -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/user/TheLinuxFoundation/playlists" # Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home -$ yt-dlp -u user -p password -P "~/MyVideos" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s" "https://www.udemy.com/java-tutorial" +$ hypervideo -u user -p password -P "~/MyVideos" -o "%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s" "https://www.udemy.com/java-tutorial" # Download entire series season keeping each series and each season in separate directory under C:/MyVideos -$ yt-dlp -P "C:/MyVideos" -o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" "https://videomore.ru/kino_v_detalayah/5_sezon/367617" +$ hypervideo -P "C:/MyVideos" -o "%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" "https://videomore.ru/kino_v_detalayah/5_sezon/367617" # Download video as "C:\MyVideos\uploader\title.ext", subtitles as "C:\MyVideos\subs\uploader\title.ext" # and put all temporary files in "C:\MyVideos\tmp" -$ yt-dlp -P "C:/MyVideos" -P "temp:tmp" -P "subtitle:subs" -o "%(uploader)s/%(title)s.%(ext)s" BaW_jenoz --write-subs +$ hypervideo -P "C:/MyVideos" -P "temp:tmp" -P "subtitle:subs" -o "%(uploader)s/%(title)s.%(ext)s" BaW_jenoz --write-subs # Download video as "C:\MyVideos\uploader\title.ext" and subtitles as "C:\MyVideos\uploader\subs\title.ext" -$ yt-dlp -P "C:/MyVideos" -o "%(uploader)s/%(title)s.%(ext)s" -o "subtitle:%(uploader)s/subs/%(title)s.%(ext)s" BaW_jenozKc --write-subs +$ hypervideo -P "C:/MyVideos" -o "%(uploader)s/%(title)s.%(ext)s" -o "subtitle:%(uploader)s/subs/%(title)s.%(ext)s" BaW_jenozKc --write-subs # Stream the video being downloaded to stdout -$ yt-dlp -o - BaW_jenozKc +$ hypervideo -o - BaW_jenozKc ``` # FORMAT SELECTION -By default, yt-dlp tries to download the best available quality if you **don't** pass any options. -This is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`. +By default, hypervideo tries to download the best available quality if you **don't** pass any options. +This is generally equivalent to using `-f bestvideo*+bestaudio/best`. However, if multiple audiostreams is enabled (`--audio-multistreams`), the default format changes to `-f bestvideo+bestaudio/best`. Similarly, if ffmpeg is unavailable, or if you use hypervideo to stream to `stdout` (`-o -`), the default becomes `-f best/bestvideo+bestaudio`. -**Deprecation warning**: Latest versions of yt-dlp can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options. +**Deprecation warning**: Latest versions of hypervideo can stream multiple formats to the stdout simultaneously using ffmpeg. So, in future versions, the default for this will be set to `-f bv*+ba/b` similar to normal downloads. If you want to preserve the `-f b/bv+ba` setting, it is recommended to explicitly specify it in the configuration options. The general syntax for format selection is `-f FORMAT` (or `--format FORMAT`) where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download. @@ -1582,7 +1458,7 @@ The available fields are: - `abr`: Average audio bitrate in KBit/s - `br`: Average bitrate in KBit/s, `tbr`/`vbr`/`abr` - `asr`: Audio sample rate in Hz - + **Deprecation warning**: Many of these fields have (currently undocumented) aliases, that may be removed in a future version. It is recommended to use only the documented field names. All fields, unless specified otherwise, are sorted in descending order. To reverse this, prefix the field with a `+`. E.g. `+res` prefers format with the smallest resolution. Additionally, you can suffix a preferred value for the fields, separated by a `:`. E.g. `res:720` prefers larger videos, but no larger than 720p and the smallest video if there are no videos less than 720p. For `codec` and `ext`, you can provide two preferred values, the first for video and the second for audio. E.g. `+codec:avc:m4a` (equivalent to `+vcodec:avc,+acodec:m4a`) sets the video codec preference to `h264` > `h265` > `vp9` > `vp9.2` > `av01` > `vp8` > `h263` > `theora` and audio codec preference to `mp4a` > `aac` > `vorbis` > `opus` > `mp3` > `ac3` > `dts`. You can also make the sorting prefer the nearest values to the provided by using `~` as the delimiter. E.g. `filesize~1G` prefers the format with filesize closest to 1 GiB. @@ -1600,102 +1476,102 @@ If your format selector is `worst`, the last item is selected after sorting. Thi ```bash # Download and merge the best video-only format and the best audio-only format, # or download the best combined format if video-only format is not available -$ yt-dlp -f "bv+ba/b" +$ hypervideo -f "bv+ba/b" # Download best format that contains video, # and if it doesn't already have an audio stream, merge it with best audio-only format -$ yt-dlp -f "bv*+ba/b" +$ hypervideo -f "bv*+ba/b" # Same as above -$ yt-dlp +$ hypervideo # Download the best video-only format and the best audio-only format without merging them # For this case, an output template should be used since # by default, bestvideo and bestaudio will have the same file name. -$ yt-dlp -f "bv,ba" -o "%(title)s.f%(format_id)s.%(ext)s" +$ hypervideo -f "bv,ba" -o "%(title)s.f%(format_id)s.%(ext)s" # Download and merge the best format that has a video stream, # and all audio-only formats into one file -$ yt-dlp -f "bv*+mergeall[vcodec=none]" --audio-multistreams +$ hypervideo -f "bv*+mergeall[vcodec=none]" --audio-multistreams # Download and merge the best format that has a video stream, # and the best 2 audio-only formats into one file -$ yt-dlp -f "bv*+ba+ba.2" --audio-multistreams +$ hypervideo -f "bv*+ba+ba.2" --audio-multistreams # The following examples show the old method (without -S) of format selection # and how to use -S to achieve a similar but (generally) better result # Download the worst video available (old method) -$ yt-dlp -f "wv*+wa/w" +$ hypervideo -f "wv*+wa/w" # Download the best video available but with the smallest resolution -$ yt-dlp -S "+res" +$ hypervideo -S "+res" # Download the smallest video available -$ yt-dlp -S "+size,+br" +$ hypervideo -S "+size,+br" # Download the best mp4 video available, or the best video if no mp4 available -$ yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" +$ hypervideo -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" # Download the best video with the best extension # (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...) -$ yt-dlp -S "ext" +$ hypervideo -S "ext" # Download the best video available but no better than 480p, # or the worst video if there is no video under 480p -$ yt-dlp -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w" +$ hypervideo -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w" # Download the best video available with the largest height but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p -$ yt-dlp -S "height:480" +$ hypervideo -S "height:480" # Download the best video available with the largest resolution but no better than 480p, # or the best video with the smallest resolution if there is no video under 480p # Resolution is determined by using the smallest dimension. # So this works correctly for vertical videos as well -$ yt-dlp -S "res:480" +$ hypervideo -S "res:480" # Download the best video (that also has audio) but no bigger than 50 MB, # or the worst video (that also has audio) if there is no video under 50 MB -$ yt-dlp -f "b[filesize<50M] / w" +$ hypervideo -f "b[filesize<50M] / w" # Download largest video (that also has audio) but no bigger than 50 MB, # or the smallest video (that also has audio) if there is no video under 50 MB -$ yt-dlp -f "b" -S "filesize:50M" +$ hypervideo -f "b" -S "filesize:50M" # Download best video (that also has audio) that is closest in size to 50 MB -$ yt-dlp -f "b" -S "filesize~50M" +$ hypervideo -f "b" -S "filesize~50M" # Download best video available via direct link over HTTP/HTTPS protocol, # or the best video available via any protocol if there is no such video -$ yt-dlp -f "(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)" +$ hypervideo -f "(bv*+ba/b)[protocol^=http][protocol!*=dash] / (bv*+ba/b)" # Download best video available via the best protocol # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...) -$ yt-dlp -S "proto" +$ hypervideo -S "proto" # Download the best video with either h264 or h265 codec, # or the best video if there is no such video -$ yt-dlp -f "(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)" +$ hypervideo -f "(bv*[vcodec~='^((he|a)vc|h26[45])']+ba) / (bv*+ba/b)" # Download the best video with best codec no better than h264, # or the best video with worst codec if there is no such video -$ yt-dlp -S "codec:h264" +$ hypervideo -S "codec:h264" # Download the best video with worst codec no worse than h264, # or the best video with best codec if there is no such video -$ yt-dlp -S "+codec:h264" +$ hypervideo -S "+codec:h264" @@ -1703,19 +1579,19 @@ $ yt-dlp -S "+codec:h264" # Download the best video no better than 720p preferring framerate greater than 30, # or the worst video (still preferring framerate greater than 30) if there is no such video -$ yt-dlp -f "((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)" +$ hypervideo -f "((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)" # Download the video with the largest resolution no better than 720p, # or the video with the smallest resolution available if there is no such video, # preferring larger framerate for formats with the same resolution -$ yt-dlp -S "res:720,fps" +$ hypervideo -S "res:720,fps" # Download the video with smallest resolution no worse than 480p, # or the video with the largest resolution available if there is no such video, # preferring better codec and then larger total bitrate for the same resolution -$ yt-dlp -S "+res:480,codec,br" +$ hypervideo -S "+res:480,codec,br" ``` # MODIFYING METADATA @@ -1736,7 +1612,7 @@ This option also has a few special uses: **Note**: Metadata modification happens before format selection, post-extraction and other post-processing operations. Some fields may be added or changed during these steps, overriding your changes. -For reference, these are the fields yt-dlp adds by default to the file metadata: +For reference, these are the fields hypervideo adds by default to the file metadata: Metadata fields | From :--------------------------|:------------------------------------------------ @@ -1763,29 +1639,29 @@ Metadata fields | From ```bash # Interpret the title as "Artist - Title" -$ yt-dlp --parse-metadata "title:%(artist)s - %(title)s" +$ hypervideo --parse-metadata "title:%(artist)s - %(title)s" # Regex example -$ yt-dlp --parse-metadata "description:Artist - (?P<artist>.+)" +$ hypervideo --parse-metadata "description:Artist - (?P<artist>.+)" # Set title as "Series name S01E05" -$ yt-dlp --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s" +$ hypervideo --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s" # Prioritize uploader as the "artist" field in video metadata -$ yt-dlp --parse-metadata "%(uploader|)s:%(meta_artist)s" --embed-metadata +$ hypervideo --parse-metadata "%(uploader|)s:%(meta_artist)s" --embed-metadata # Set "comment" field in video metadata using description instead of webpage_url, # handling multiple lines correctly -$ yt-dlp --parse-metadata "description:(?s)(?P<meta_comment>.+)" --embed-metadata +$ hypervideo --parse-metadata "description:(?s)(?P<meta_comment>.+)" --embed-metadata # Do not set any "synopsis" in the video metadata -$ yt-dlp --parse-metadata ":(?P<meta_synopsis>)" +$ hypervideo --parse-metadata ":(?P<meta_synopsis>)" # Remove "formats" field from the infojson by setting it to an empty string -$ yt-dlp --parse-metadata "video::(?P<formats>)" --write-info-json +$ hypervideo --parse-metadata ":(?P<formats>)" -j # Replace all spaces and "_" in title and uploader with a `-` -$ yt-dlp --replace-in-metadata "title,uploader" "[ _]" "-" +$ hypervideo --replace-in-metadata "title,uploader" "[ _]" "-" ``` @@ -1872,10 +1748,10 @@ The following extractors use this feature: # PLUGINS -Note that **all** plugins are imported even if not invoked, and that **there are no checks** performed on plugin code. **Use plugins at your own risk and only if you trust the code!** +Plugins are loaded from `<root-dir>/ytdlp_plugins/<type>/__init__.py`; where `<root-dir>` is the directory of the binary (`<root-dir>/hypervideo`), or the root directory of the module if you are running directly from source-code (`<root dir>/hypervideo_dl/__main__.py`). Plugins are currently not supported for the `pip` version -Plugins can be of `<type>`s `extractor` or `postprocessor`. -- Extractor plugins do not need to be enabled from the CLI and are automatically invoked when the input URL is suitable for it. +Plugins can be of `<type>`s `extractor` or `postprocessor`. +- Extractor plugins do not need to be enabled from the CLI and are automatically invoked when the input URL is suitable for it. - Extractor plugins take priority over builtin extractors. - Postprocessor plugins can be invoked using `--use-postprocessor NAME`. @@ -1883,7 +1759,7 @@ Plugins can be of `<type>`s `extractor` or `postprocessor`. Plugins are loaded from the namespace packages `yt_dlp_plugins.extractor` and `yt_dlp_plugins.postprocessor`. In other words, the file structure on the disk looks something like: - + yt_dlp_plugins/ extractor/ myplugin.py @@ -1938,25 +1814,25 @@ If you are a plugin author, add [yt-dlp-plugins](https://github.com/topics/yt-dl See the [Developer Instructions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions) on how to write and test an extractor. -# EMBEDDING YT-DLP +# EMBEDDING HYPERVIDEO -yt-dlp makes the best effort to be a good command-line program, and thus should be callable from any programming language. +hypervideo makes the best effort to be a good command-line program, and thus should be callable from any programming language. Your program should avoid parsing the normal stdout since they may change in future versions. Instead they should use options such as `-J`, `--print`, `--progress-template`, `--exec` etc to create console output that you can reliably reproduce and parse. -From a Python program, you can embed yt-dlp in a more powerful fashion, like this: +From a Python program, you can embed hypervideo in a more powerful fashion, like this: ```python -from yt_dlp import YoutubeDL +from hypervideo_dl import YoutubeDL URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] with YoutubeDL() as ydl: ydl.download(URLS) ``` -Most likely, you'll want to use various options. For a list of options available, have a look at [`yt_dlp/YoutubeDL.py`](yt_dlp/YoutubeDL.py#L183) or `help(yt_dlp.YoutubeDL)` in a Python shell. If you are already familiar with the CLI, you can use [`devscripts/cli_to_api.py`](https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/cli_to_api.py) to translate any CLI switches to `YoutubeDL` params. +Most likely, you'll want to use various options. For a list of options available, have a look at [`hypervideo_dl/YoutubeDL.py`](hypervideo_dl/YoutubeDL.py#L180). -**Tip**: If you are porting your code from youtube-dl to yt-dlp, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information) +**Tip**: If you are porting your code from youtube-dl to hypervideo, one important point to look out for is that we do not guarantee the return value of `YoutubeDL.extract_info` to be json serializable, or even be a dictionary. It will be dictionary-like, but if you want to ensure it is a serializable dictionary, pass it through `YoutubeDL.sanitize_info` as shown in the [example below](#extracting-information) ## Embedding examples @@ -1964,13 +1840,13 @@ Most likely, you'll want to use various options. For a list of options available ```python import json -import yt_dlp +import hypervideo_dl URL = 'https://www.youtube.com/watch?v=BaW_jenozKc' -# ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions +# ℹ️ See help(hypervideo_dl.YoutubeDL) for a list of available options and public functions ydl_opts = {} -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: info = ydl.extract_info(URL, download=False) # ℹ️ ydl.sanitize_info makes the info json-serializable @@ -1979,11 +1855,11 @@ with yt_dlp.YoutubeDL(ydl_opts) as ydl: #### Download using an info-json ```python -import yt_dlp +import hypervideo_dl INFO_FILE = 'path/to/video.info.json' -with yt_dlp.YoutubeDL() as ydl: +with hypervideo_dl.YoutubeDL() as ydl: error_code = ydl.download_with_info_file(INFO_FILE) print('Some videos failed to download' if error_code @@ -1993,27 +1869,27 @@ print('Some videos failed to download' if error_code #### Extract audio ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] ydl_opts = { 'format': 'm4a/bestaudio/best', - # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments + # ℹ️ See help(hypervideo_dl.postprocessor) for a list of available Postprocessors and their arguments 'postprocessors': [{ # Extract audio using ffmpeg 'key': 'FFmpegExtractAudio', 'preferredcodec': 'm4a', }] } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Filter videos ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2027,14 +1903,14 @@ ydl_opts = { 'match_filter': longer_than_a_minute, } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: error_code = ydl.download(URLS) ``` #### Adding logger and progress hook ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2057,7 +1933,7 @@ class MyLogger: print(msg) -# ℹ️ See "progress_hooks" in help(yt_dlp.YoutubeDL) +# ℹ️ See "progress_hooks" in help(hypervideo_dl.YoutubeDL) def my_hook(d): if d['status'] == 'finished': print('Done downloading, now post-processing ...') @@ -2068,26 +1944,26 @@ ydl_opts = { 'progress_hooks': [my_hook], } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` #### Add a custom PostProcessor ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] -# ℹ️ See help(yt_dlp.postprocessor.PostProcessor) -class MyCustomPP(yt_dlp.postprocessor.PostProcessor): +# ℹ️ See help(hypervideo_dl.postprocessor.PostProcessor) +class MyCustomPP(hypervideo_dl.postprocessor.PostProcessor): def run(self, info): self.to_screen('Doing stuff') return [], info -with yt_dlp.YoutubeDL() as ydl: - # ℹ️ "when" can take any value in yt_dlp.utils.POSTPROCESS_WHEN +with hypervideo_dl.YoutubeDL() as ydl: + # ℹ️ "when" can take any value in hypervideo_dl.utils.POSTPROCESS_WHEN ydl.add_post_processor(MyCustomPP(), when='pre_process') ydl.download(URLS) ``` @@ -2096,7 +1972,7 @@ with yt_dlp.YoutubeDL() as ydl: #### Use a custom format selector ```python -import yt_dlp +import hypervideo_dl URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] @@ -2131,7 +2007,7 @@ ydl_opts = { 'format': format_selector, } -with yt_dlp.YoutubeDL(ydl_opts) as ydl: +with hypervideo_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(URLS) ``` @@ -2247,7 +2123,7 @@ Support for [SponSkrub](https://github.com/faissaloo/SponSkrub) has been depreca #### No longer supported These options may no longer work as intended - --prefer-avconv avconv is not officially supported by yt-dlp (Alias: --no-prefer-ffmpeg) + --prefer-avconv avconv is not officially supported by hypervideo (Alias: --no-prefer-ffmpeg) --prefer-ffmpeg Default (Alias: --no-prefer-avconv) -C, --call-home Not implemented --no-call-home Default |