### Install yt-dlp with Snap Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install the edge version of yt-dlp using Snap on Linux. ```bash sudo snap install --edge yt-dlp ``` -------------------------------- ### Install yt-dlp with APT Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Add the yt-dlp PPA to your APT sources and install yt-dlp on Debian-based systems. ```bash sudo add-apt-repository ppa:tomtomtom/yt-dlp # Add ppa repo to apt sudo apt update # Update package list sudo apt install yt-dlp # Install yt-dlp ``` -------------------------------- ### Install yt-dlp with pip (default) Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp and its default optional dependencies using pip. ```bash python3 -m pip install -U "yt-dlp[default]" ``` -------------------------------- ### Install yt-dlp from master branch with pip Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install the latest development version from the master branch using pip. This requires installing build tools first. ```bash python3 -m pip install -U pip hatchling wheel python3 -m pip install --force-reinstall "yt-dlp[default] @ https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz" ``` -------------------------------- ### Install yt-dlp with pip (no dependencies) Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp without any optional dependencies using pip. ```bash python3 -m pip install --no-deps -U yt-dlp ``` -------------------------------- ### Install yt-dlp-core on Alpine Linux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp without optional dependencies on Alpine Linux. This is an alternative to the standard installation. ```sh doas apk -U add yt-dlp-core ``` -------------------------------- ### Install yt-dlp with Homebrew Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp on macOS or Linux using the Homebrew package manager. ```bash brew install yt-dlp ``` -------------------------------- ### Install yt-dlp with MacPorts Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp on macOS using the MacPorts package manager. ```bash sudo port install yt-dlp ``` -------------------------------- ### Download and Install yt-dlp using wget Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Use wget to download the yt-dlp binary and place it in ~/.local/bin. Ensure it's executable. ```bash wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/.local/bin/yt-dlp chmod a+rx ~/.local/bin/yt-dlp # Make executable ``` -------------------------------- ### Install yt-dlp nightly version with pip Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install the pre-release (nightly) version of yt-dlp with its default optional dependencies. ```bash python3 -m pip install -U --pre "yt-dlp[default]" ``` -------------------------------- ### Install yt-dlp with Scoop on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp using the Scoop package manager on Windows. This is a common method for Windows users. ```powershell scoop install yt-dlp ``` -------------------------------- ### Install yt-dlp with pacman Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp on Arch Linux using pacman. The package manager handles dependencies and updates. ```bash sudo pacman -Syu yt-dlp ``` -------------------------------- ### Download and Install yt-dlp using curl Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Use curl to download the yt-dlp binary and place it in ~/.local/bin. Ensure it's executable. ```bash curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp chmod a+rx ~/.local/bin/yt-dlp # Make executable ``` -------------------------------- ### Install Python and pip in Termux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install Python and pip, the package installer for Python, within Termux. These are necessary for installing yt-dlp with pip. ```bash pkg install python python-pip ``` -------------------------------- ### Install yt-dlp with winget on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp using the winget package manager on Windows. winget is Microsoft's official package manager. ```powershell winget install yt-dlp ``` -------------------------------- ### Install yt-dlp with default dependencies in Termux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp along with its default dependencies using pip within Termux. This is the primary method for installing yt-dlp on Android via Termux. ```bash pip install -U "yt-dlp[default]" ``` -------------------------------- ### Install yt-dlp on Alpine Linux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Use this command to install yt-dlp on Alpine Linux. Ensure you are using the latest version of the OS. ```sh doas apk -U add yt-dlp ``` -------------------------------- ### Install yt-dlp with Chocolatey on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install yt-dlp using the Chocolatey package manager on Windows. This is another popular option for Windows package management. ```powershell choco install yt-dlp ``` -------------------------------- ### Download and Install yt-dlp using aria2c Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Use aria2c to download the yt-dlp binary to ~/.local/bin. Ensure it's executable. ```bash aria2c https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp --dir ~/.local/bin -o yt-dlp chmod a+rx ~/.local/bin/yt-dlp # Make executable ``` -------------------------------- ### Install yt-dlp-ejs package directly Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Install the yt-dlp-ejs Python package directly from PyPI. Ensure the version matches yt-dlp's pyproject.toml to avoid compatibility issues. This package should be updated alongside yt-dlp. ```bash pip install -U yt-dlp-ejs ``` -------------------------------- ### Update yt-dlp with Snap Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Manually refresh the edge version of yt-dlp installed via Snap. ```bash sudo snap refresh --edge yt-dlp ``` -------------------------------- ### Set up Termux storage on Android Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Allow Termux to access your phone's storage for downloading files. This is a prerequisite for installing yt-dlp via Termux. ```bash termux-setup-storage ``` -------------------------------- ### Install ffmpeg optionally in Termux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Install ffmpeg as an optional dependency within Termux. ffmpeg is useful for advanced video processing tasks. ```bash pkg install ffmpeg ``` -------------------------------- ### Configure Poetry for Plugin Packages Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Plugin Development.md Add the 'packages' configuration to your pyproject.toml file to make your plugin installable with Poetry. This ensures that the 'yt_dlp_plugins' directory is included. ```toml [tool.poetry] ... packages = [{ include = "yt_dlp_plugins" }] ... ``` -------------------------------- ### Install yt-dlp with EJS dependency Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Install the yt-dlp Python package including the EJS dependency using pip. This ensures the EJS scripts are available for challenge solving. ```bash pip install -U "yt-dlp[default]" ``` -------------------------------- ### Update and upgrade Termux packages Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Update all installed packages within Termux and upgrade them. This ensures a stable environment for installing yt-dlp. ```bash pkg update && pkg upgrade ``` -------------------------------- ### Upgrade yt-dlp on Alpine Linux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Explicitly upgrade yt-dlp on Alpine Linux. This command ensures you have the latest version installed. ```sh doas apk -U upgrade yt-dlp ``` -------------------------------- ### Pass cookies from Chrome browser Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Extract cookies directly from the Chrome browser. For Flatpak installations, specify the Flatpak Chrome path. ```bash yt-dlp --cookies-from-browser chrome ``` ```bash yt-dlp --cookies-from-browser chrome:~/.var/app/com.google.Chrome/ ``` -------------------------------- ### Enable QuickJS Runtime Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Enable QuickJS as the JavaScript runtime for yt-dlp. Specify the path to the executable if its filename is not 'qjs' or 'qjs.exe'. It's recommended to add this to your configuration file. ```bash --js-runtimes quickjs ``` ```bash --js-runtimes quickjs:/path/to/qjs ``` -------------------------------- ### Add Plugin Files and Commit Changes Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Plugin Development.md Use git commands to add new plugin files, commit them with a descriptive message, and push the changes to your repository. ```bash git add yt_dlp_plugins setup.cfg README.md git commit -m 'Add yourplugin plugin' git push origin master ``` -------------------------------- ### Update yt-dlp with Homebrew Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Upgrade yt-dlp to the latest version using Homebrew. ```bash brew upgrade yt-dlp ``` -------------------------------- ### Enable Node.js Runtime Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Enable Node.js as the JavaScript runtime for yt-dlp. It's recommended to add this to your configuration file to avoid passing it repeatedly. ```bash --js-runtimes node ``` ```bash --js-runtimes node:/path/to/node ``` -------------------------------- ### Enable EJS script downloads from npm Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Configure yt-dlp to download EJS scripts from npm. This option is compatible with Deno and Bun runtimes. It is recommended to add this to the yt-dlp configuration file for persistent use and automatic updates. ```bash --remote-components ejs:npm ``` -------------------------------- ### Enable Bun Runtime Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Enable Bun as the JavaScript runtime for yt-dlp. Note that support for Bun is deprecated and only specific versions are compatible. It's recommended to add this to your configuration file. ```bash --js-runtimes bun ``` ```bash --js-runtimes bun:/path/to/bun ``` -------------------------------- ### Prepare Bug Report with Verbose Output Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md When filing a bug report, use the `-Uv` flags with your command to provide verbose output, which is essential for debugging and reproducing issues. ```bash yt-dlp -Uv ``` -------------------------------- ### Update yt-dlp Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Run this command to update yt-dlp to the latest version. ```bash yt-dlp -U ``` -------------------------------- ### Update yt-dlp with Scoop on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Update yt-dlp to the latest version using Scoop on Windows. Run this command periodically to stay updated. ```powershell scoop update yt-dlp ``` -------------------------------- ### Enable EJS script downloads from GitHub Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Configure yt-dlp to download EJS scripts directly from GitHub. This method may be affected by network restrictions to GitHub. It is recommended to add this to the yt-dlp configuration file for persistent use and automatic updates. ```bash --remote-components ejs:github ``` -------------------------------- ### Download Only New Videos from a Playlist Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Utilize the `--download-archive` option to keep track of downloaded videos. Subsequent runs will only download videos not present in the archive file. ```bash yt-dlp --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" ``` -------------------------------- ### Upgrade yt-dlp with winget on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Upgrade yt-dlp to the latest version using winget on Windows. This command is essential for maintaining the latest yt-dlp version. ```powershell winget upgrade yt-dlp ``` -------------------------------- ### Stream Best Quality Video with FFmpeg Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md When streaming to stdout with FFmpeg as the downloader, use this command to ensure the best available video and audio quality are selected. ```bash yt-dlp -o - --downloader ffmpeg -f "bv*+ba/b" ``` -------------------------------- ### Select Player Client with Extractor Argument Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/PO Token Guide.md Specify the `player_client` extractor argument to control which YouTube client yt-dlp uses for requests. This can affect PO Token requirements. ```python yt-dlp --extractor-args "youtube:player_client=" ``` -------------------------------- ### Upgrade yt-dlp with Chocolatey on Windows Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Upgrade yt-dlp to the latest version using Chocolatey on Windows. This command ensures you have the most recent features and fixes. ```powershell choco upgrade yt-dlp ``` -------------------------------- ### Update yt-dlp with MacPorts Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Update MacPorts and then upgrade yt-dlp to the latest version. ```bash sudo port selfupdate sudo port upgrade yt-dlp ``` -------------------------------- ### Specify Path to JS Runtime Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/EJS.md Use this argument to specify the path to a JS runtime executable or its containing folder if it's not in your system's PATH. ```bash --js-runtimes "deno:/path/to/deno" ``` -------------------------------- ### Workaround for FFmpeg 'incorrect codec parameters' error Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Use this argument when older FFmpeg versions have experimental support for Opus audio in mp4 or webm containers and throw an error. Update FFmpeg if possible. ```bash --postprocessor-args "ffmpeg:-strict -2" ``` -------------------------------- ### Provide PO Token via Extractor Argument Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/PO Token Guide.md Use the `po_token` extractor argument to supply a PO Token for YouTube requests. This is useful when a plugin is not used. ```python yt-dlp --extractor-args "youtube:po_token=" ``` -------------------------------- ### Export browser cookies to a file Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Extract cookies from a browser and save them to a specified file using `--cookies-from-browser` and `--cookies`. Be cautious as this exports all site cookies. ```bash yt-dlp --cookies-from-browser chrome --cookies cookies.txt ``` -------------------------------- ### Import Extractor from Plugin Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Plugin Development.md Import an extractor class from a plugin package. This import will work at runtime if yt-dlp can find the plugin, even if your IDE cannot resolve it. ```python from yt_dlp_plugins.extractor.example import ExampleIE ``` -------------------------------- ### Stream Video to VLC Media Player Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Stream video content directly to VLC by piping yt-dlp's stdout to VLC's stdin. Ensure VLC is capable of reading from stdin. ```bash yt-dlp -o - "https://www.youtube.com/watch?v=BaW_jenozKcj" | vlc - ``` -------------------------------- ### Add Delay Between Downloads Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Extractors.md To avoid exceeding YouTube's request rate limit, add a delay between downloads using the `-t sleep` option or other sleep options. This is crucial for preventing 'This content isn't available, try again later' errors. ```bash -t sleep ``` -------------------------------- ### Manually pass cookies from a file Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Use the `--cookies` option to specify a file containing cookies in Mozilla/Netscape format. Ensure correct newline characters (CRLF for Windows, LF for Unix-like systems). ```bash --cookies /path/to/cookies/file.txt ``` -------------------------------- ### Shorten Filenames with Output Template Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md To avoid 'File name too long' errors, use the output template to limit the length of parts of the filename, such as the uploader name and title. This can also be configured globally in a configuration file. ```bash %(uploader).30B - %(title).200B.%(ext)s ``` -------------------------------- ### Pass Visitor Data without Cookies Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Extractors.md Use this method to pass visitor data instead of cookies. It requires skipping webpage requests, which may lead to more requests and less stable extraction. Ensure VISITOR_DATA_VALUE_HERE is replaced with the actual value. ```bash --extractor-args "youtubetab:skip=webpage" --extractor-args "youtube:player_skip=webpage,configs;visitor_data=VISITOR_DATA_VALUE_HERE" ``` -------------------------------- ### Uninstall yt-dlp on Alpine Linux Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/Installation.md Use this command to remove yt-dlp from your Alpine Linux system. ```sh doas apk del yt-dlp ``` -------------------------------- ### Handle URLs with Ampersands in Shell Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md When a video URL contains an ampersand (&), it can be misinterpreted by the shell. Enclose the URL in quotes or escape the ampersand to pass it correctly to yt-dlp. ```bash yt-dlp "https://www.youtube.com/watch?t=4&v=BaW_jenozKc" ``` ```bash yt-dlp https://www.youtube.com/watch?t=4\&v=BaW_jenozKc ``` -------------------------------- ### Bypass Cloudflare 403 errors with cookies and User-Agent Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md Pass your browser's User-Agent string and extract cookies from a specified browser to bypass Cloudflare's anti-bot measures. Ensure cookies are from a recent session. ```bash --user-agent "USERAGENT" --cookies-from-browser firefox ``` ```bash --cookies cookies.txt ``` -------------------------------- ### Escape Percent Characters in Windows Batch Files Source: https://github.com/yt-dlp/yt-dlp-wiki/blob/master/FAQ.md When using output templates in Windows batch files, plain percent characters (%) must be doubled to avoid being interpreted as batch variable expansions. Environment variables should not be escaped. ```batch -o "%%(title)s-%%(id)s.%%(ext)s" ``` ```batch -o "C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.