diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1c0bfbd25368d1f614cb677027b2603c601ed463 Binary files /dev/null and b/.DS_Store differ diff --git a/.venv/bin/Activate.ps1 b/.venv/bin/Activate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b49d77ba44b24fe6d69f6bbe75139b3b5dc23075 --- /dev/null +++ b/.venv/bin/Activate.ps1 @@ -0,0 +1,247 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } + $env:VIRTUAL_ENV_PROMPT = $Prompt +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/.venv/bin/activate b/.venv/bin/activate new file mode 100644 index 0000000000000000000000000000000000000000..91b11e1bfb7dbf05062175ca3cd87d31ad5a181b --- /dev/null +++ b/.venv/bin/activate @@ -0,0 +1,69 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/Users/sc-gladiator/cv.github.io/.venv" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1="(.venv) ${PS1:-}" + export PS1 + VIRTUAL_ENV_PROMPT="(.venv) " + export VIRTUAL_ENV_PROMPT +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null +fi diff --git a/.venv/bin/activate.csh b/.venv/bin/activate.csh new file mode 100644 index 0000000000000000000000000000000000000000..749932e03123fc55c1002e5f548699a4a8d442d4 --- /dev/null +++ b/.venv/bin/activate.csh @@ -0,0 +1,26 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/.venv" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = "(.venv) $prompt" + setenv VIRTUAL_ENV_PROMPT "(.venv) " +endif + +alias pydoc python -m pydoc + +rehash diff --git a/.venv/bin/activate.fish b/.venv/bin/activate.fish new file mode 100644 index 0000000000000000000000000000000000000000..7d59cfe2ccb4283c1d85f5c9056a50b893508189 --- /dev/null +++ b/.venv/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/); you cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/.venv" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) "(.venv) " (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" + set -gx VIRTUAL_ENV_PROMPT "(.venv) " +end diff --git a/.venv/bin/f2py b/.venv/bin/f2py new file mode 100755 index 0000000000000000000000000000000000000000..d0e9000ccd91d448a16ad07247da37b83bc07b81 --- /dev/null +++ b/.venv/bin/f2py @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/flask b/.venv/bin/flask new file mode 100755 index 0000000000000000000000000000000000000000..767b897c094c2149eae7508941033aad573bb6f0 --- /dev/null +++ b/.venv/bin/flask @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from flask.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/fonttools b/.venv/bin/fonttools new file mode 100755 index 0000000000000000000000000000000000000000..b456eea8f1d51020d4c18a7d02e06d6fd6e9b229 --- /dev/null +++ b/.venv/bin/fonttools @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/futurize b/.venv/bin/futurize new file mode 100755 index 0000000000000000000000000000000000000000..cbd4ed68e57c4cd0d1b4622208069a2e3763ce15 --- /dev/null +++ b/.venv/bin/futurize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libfuturize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/import_pb_to_tensorboard b/.venv/bin/import_pb_to_tensorboard new file mode 100755 index 0000000000000000000000000000000000000000..0b8633886c3905d4b98d339357717dd536b74397 --- /dev/null +++ b/.venv/bin/import_pb_to_tensorboard @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.import_pb_to_tensorboard import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/isympy b/.venv/bin/isympy new file mode 100755 index 0000000000000000000000000000000000000000..83b4e1fdbcab477a6cfde89922a4fe3ae5959ee1 --- /dev/null +++ b/.venv/bin/isympy @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from isympy import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/markdown-it b/.venv/bin/markdown-it new file mode 100755 index 0000000000000000000000000000000000000000..0ff1aef987e10602abf56584ae9ab660b30e0194 --- /dev/null +++ b/.venv/bin/markdown-it @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from markdown_it.cli.parse import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/markdown_py b/.venv/bin/markdown_py new file mode 100755 index 0000000000000000000000000000000000000000..9be2c667ccea3dcbbacb0e6edc947a552380a885 --- /dev/null +++ b/.venv/bin/markdown_py @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from markdown.__main__ import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/.venv/bin/normalizer b/.venv/bin/normalizer new file mode 100755 index 0000000000000000000000000000000000000000..3323f31fec1338645df0b623a29aa03b159b2a9b --- /dev/null +++ b/.venv/bin/normalizer @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from charset_normalizer import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli.cli_detect()) diff --git a/.venv/bin/pasteurize b/.venv/bin/pasteurize new file mode 100755 index 0000000000000000000000000000000000000000..baa811f2bfb12e72aee784ad0d0dcfb0685be2e6 --- /dev/null +++ b/.venv/bin/pasteurize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libpasteurize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip b/.venv/bin/pip new file mode 100755 index 0000000000000000000000000000000000000000..41bdabb0ae8040e6108acd415954d3c88da95689 --- /dev/null +++ b/.venv/bin/pip @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3 b/.venv/bin/pip3 new file mode 100755 index 0000000000000000000000000000000000000000..41bdabb0ae8040e6108acd415954d3c88da95689 --- /dev/null +++ b/.venv/bin/pip3 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3.10 b/.venv/bin/pip3.10 new file mode 100755 index 0000000000000000000000000000000000000000..41bdabb0ae8040e6108acd415954d3c88da95689 --- /dev/null +++ b/.venv/bin/pip3.10 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pyftmerge b/.venv/bin/pyftmerge new file mode 100755 index 0000000000000000000000000000000000000000..230718df6a158f0135c778bf978c2b1d2d95ad45 --- /dev/null +++ b/.venv/bin/pyftmerge @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.merge import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pyftsubset b/.venv/bin/pyftsubset new file mode 100755 index 0000000000000000000000000000000000000000..e14f65640f2a8ccb10d12c2ac69a6f8bd5bdf194 --- /dev/null +++ b/.venv/bin/pyftsubset @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.subset import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pygmentize b/.venv/bin/pygmentize new file mode 100755 index 0000000000000000000000000000000000000000..742cbda7b619592f1e75caa5b5b65c68e39bc8cb --- /dev/null +++ b/.venv/bin/pygmentize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/python b/.venv/bin/python new file mode 120000 index 0000000000000000000000000000000000000000..2d67087128220b9fcf57ceb17bca934c96080432 --- /dev/null +++ b/.venv/bin/python @@ -0,0 +1 @@ +/Users/sc-gladiator/.pyenv/versions/3.10.13/bin/python \ No newline at end of file diff --git a/.venv/bin/python3 b/.venv/bin/python3 new file mode 120000 index 0000000000000000000000000000000000000000..d8654aa0e2f2f3c1760e0fcbcbb52c1c5941fba7 --- /dev/null +++ b/.venv/bin/python3 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/.venv/bin/python3.10 b/.venv/bin/python3.10 new file mode 120000 index 0000000000000000000000000000000000000000..d8654aa0e2f2f3c1760e0fcbcbb52c1c5941fba7 --- /dev/null +++ b/.venv/bin/python3.10 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/.venv/bin/saved_model_cli b/.venv/bin/saved_model_cli new file mode 100755 index 0000000000000000000000000000000000000000..9b5cbb4110fa04fe2518b25ae8a945ec90d76dee --- /dev/null +++ b/.venv/bin/saved_model_cli @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.saved_model_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/tensorboard b/.venv/bin/tensorboard new file mode 100755 index 0000000000000000000000000000000000000000..214217acc38b7832ffc06a2edd1605bde02814da --- /dev/null +++ b/.venv/bin/tensorboard @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorboard.main import run_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_main()) diff --git a/.venv/bin/tf_upgrade_v2 b/.venv/bin/tf_upgrade_v2 new file mode 100755 index 0000000000000000000000000000000000000000..911396c642b453a1b68e6a9009c4a3ad70791e1b --- /dev/null +++ b/.venv/bin/tf_upgrade_v2 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.tools.compatibility.tf_upgrade_v2_main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/tflite_convert b/.venv/bin/tflite_convert new file mode 100755 index 0000000000000000000000000000000000000000..0349b1b12e984122ec02b69c1bd6ce777b9ed270 --- /dev/null +++ b/.venv/bin/tflite_convert @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/toco b/.venv/bin/toco new file mode 100755 index 0000000000000000000000000000000000000000..0349b1b12e984122ec02b69c1bd6ce777b9ed270 --- /dev/null +++ b/.venv/bin/toco @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/torchfrtrace b/.venv/bin/torchfrtrace new file mode 100755 index 0000000000000000000000000000000000000000..962ed947762a2c0009cabc31e0484569299efbab --- /dev/null +++ b/.venv/bin/torchfrtrace @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tools.flight_recorder.fr_trace import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/torchrun b/.venv/bin/torchrun new file mode 100755 index 0000000000000000000000000000000000000000..890b17b50abc689bf4c3d2d2e82dea429eab1099 --- /dev/null +++ b/.venv/bin/torchrun @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from torch.distributed.run import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/tqdm b/.venv/bin/tqdm new file mode 100755 index 0000000000000000000000000000000000000000..9a02d061d4cbb673bf645b124548a6b8e29ce8b5 --- /dev/null +++ b/.venv/bin/tqdm @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tqdm.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/ttx b/.venv/bin/ttx new file mode 100755 index 0000000000000000000000000000000000000000..0c07ca8df2d75e153ea15153094a30ebe0336294 --- /dev/null +++ b/.venv/bin/ttx @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.ttx import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/wheel b/.venv/bin/wheel new file mode 100755 index 0000000000000000000000000000000000000000..a851285635635a24433369777ac963a0e5c0526c --- /dev/null +++ b/.venv/bin/wheel @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/yt-dlp b/.venv/bin/yt-dlp new file mode 100755 index 0000000000000000000000000000000000000000..c597fb5f9f62711c84a4f945570fa23293a69237 --- /dev/null +++ b/.venv/bin/yt-dlp @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from yt_dlp import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/pyvenv.cfg b/.venv/pyvenv.cfg new file mode 100644 index 0000000000000000000000000000000000000000..0822927e6895f29c27a9666ea3d5c8ce9a9d208f --- /dev/null +++ b/.venv/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /Users/sc-gladiator/cv.github.io/.venv/bin +include-system-site-packages = false +version = 3.10.13 diff --git a/.venv/share/bash-completion/completions/yt-dlp b/.venv/share/bash-completion/completions/yt-dlp new file mode 100644 index 0000000000000000000000000000000000000000..1cea33b622b4be5c3f6fdd5318e961fd082722f7 --- /dev/null +++ b/.venv/share/bash-completion/completions/yt-dlp @@ -0,0 +1,29 @@ +__yt_dlp() +{ + local cur prev opts fileopts diropts keywords + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--help --version --update --no-update --update-to --ignore-errors --no-abort-on-error --abort-on-error --dump-user-agent --list-extractors --extractor-descriptions --use-extractors --force-generic-extractor --default-search --ignore-config --no-config-locations --config-locations --plugin-dirs --no-plugin-dirs --flat-playlist --no-flat-playlist --live-from-start --no-live-from-start --wait-for-video --no-wait-for-video --mark-watched --no-mark-watched --no-colors --color --compat-options --alias --preset-alias --proxy --socket-timeout --source-address --impersonate --list-impersonate-targets --force-ipv4 --force-ipv6 --enable-file-urls --geo-verification-proxy --cn-verification-proxy --xff --geo-bypass --no-geo-bypass --geo-bypass-country --geo-bypass-ip-block --playlist-start --playlist-end --playlist-items --match-title --reject-title --min-filesize --max-filesize --date --datebefore --dateafter --min-views --max-views --match-filters --no-match-filters --break-match-filters --no-break-match-filters --no-playlist --yes-playlist --age-limit --download-archive --no-download-archive --max-downloads --break-on-existing --no-break-on-existing --break-on-reject --break-per-input --no-break-per-input --skip-playlist-after-errors --include-ads --no-include-ads --concurrent-fragments --limit-rate --throttled-rate --retries --file-access-retries --fragment-retries --retry-sleep --skip-unavailable-fragments --abort-on-unavailable-fragments --keep-fragments --no-keep-fragments --buffer-size --resize-buffer --no-resize-buffer --http-chunk-size --test --playlist-reverse --no-playlist-reverse --playlist-random --lazy-playlist --no-lazy-playlist --xattr-set-filesize --hls-prefer-native --hls-prefer-ffmpeg --hls-use-mpegts --no-hls-use-mpegts --download-sections --downloader --downloader-args --batch-file --no-batch-file --id --paths --output --output-na-placeholder --autonumber-size --autonumber-start --restrict-filenames --no-restrict-filenames --windows-filenames --no-windows-filenames --trim-filenames --no-overwrites --force-overwrites --no-force-overwrites --continue --no-continue --part --no-part --mtime --no-mtime --write-description --no-write-description --write-info-json --no-write-info-json --write-annotations --no-write-annotations --write-playlist-metafiles --no-write-playlist-metafiles --clean-info-json --no-clean-info-json --write-comments --no-write-comments --load-info-json --cookies --no-cookies --cookies-from-browser --no-cookies-from-browser --cache-dir --no-cache-dir --rm-cache-dir --write-thumbnail --no-write-thumbnail --write-all-thumbnails --list-thumbnails --write-link --write-url-link --write-webloc-link --write-desktop-link --quiet --no-quiet --no-warnings --simulate --no-simulate --ignore-no-formats-error --no-ignore-no-formats-error --skip-download --print --print-to-file --get-url --get-title --get-id --get-thumbnail --get-description --get-duration --get-filename --get-format --dump-json --dump-single-json --print-json --force-write-archive --newline --no-progress --progress --console-title --progress-template --progress-delta --verbose --dump-pages --write-pages --load-pages --youtube-print-sig-code --print-traffic --call-home --no-call-home --encoding --legacy-server-connect --no-check-certificates --prefer-insecure --user-agent --referer --add-headers --bidi-workaround --sleep-requests --sleep-interval --max-sleep-interval --sleep-subtitles --format --format-sort --format-sort-force --no-format-sort-force --video-multistreams --no-video-multistreams --audio-multistreams --no-audio-multistreams --all-formats --prefer-free-formats --no-prefer-free-formats --check-formats --check-all-formats --no-check-formats --list-formats --list-formats-as-table --list-formats-old --merge-output-format --allow-unplayable-formats --no-allow-unplayable-formats --write-subs --no-write-subs --write-auto-subs --no-write-auto-subs --all-subs --list-subs --sub-format --sub-langs --username --password --twofactor --netrc --netrc-location --netrc-cmd --video-password --ap-mso --ap-username --ap-password --ap-list-mso --client-certificate --client-certificate-key --client-certificate-password --extract-audio --audio-format --audio-quality --remux-video --recode-video --postprocessor-args --keep-video --no-keep-video --post-overwrites --no-post-overwrites --embed-subs --no-embed-subs --embed-thumbnail --no-embed-thumbnail --embed-metadata --no-embed-metadata --embed-chapters --no-embed-chapters --embed-info-json --no-embed-info-json --metadata-from-title --parse-metadata --replace-in-metadata --xattrs --concat-playlist --fixup --prefer-avconv --prefer-ffmpeg --ffmpeg-location --exec --no-exec --exec-before-download --no-exec-before-download --convert-subs --convert-thumbnails --split-chapters --no-split-chapters --remove-chapters --no-remove-chapters --force-keyframes-at-cuts --no-force-keyframes-at-cuts --use-postprocessor --sponsorblock-mark --sponsorblock-remove --sponsorblock-chapter-title --no-sponsorblock --sponsorblock-api --sponskrub --no-sponskrub --sponskrub-cut --no-sponskrub-cut --sponskrub-force --no-sponskrub-force --sponskrub-location --sponskrub-args --extractor-retries --allow-dynamic-mpd --ignore-dynamic-mpd --hls-split-discontinuity --no-hls-split-discontinuity --extractor-args --youtube-include-dash-manifest --youtube-skip-dash-manifest --youtube-include-hls-manifest --youtube-skip-hls-manifest" + keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory" + fileopts="-a|--batch-file|--download-archive|--cookies|--load-info" + diropts="--cache-dir" + + if [[ ${prev} =~ ${fileopts} ]]; then + COMPREPLY=( $(compgen -f -- ${cur}) ) + return 0 + elif [[ ${prev} =~ ${diropts} ]]; then + COMPREPLY=( $(compgen -d -- ${cur}) ) + return 0 + fi + + if [[ ${cur} =~ : ]]; then + COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) ) + return 0 + elif [[ ${cur} == * ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi +} + +complete -F __yt_dlp yt-dlp diff --git a/.venv/share/doc/yt_dlp/README.txt b/.venv/share/doc/yt_dlp/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..5fc475dd9ec0d15f0699db65fd688d090ec611af --- /dev/null +++ b/.venv/share/doc/yt_dlp/README.txt @@ -0,0 +1,3121 @@ +[YT-DLP] + +[Release version] [PyPI] [Donate] [Discord] [Supported Sites] [License: +Unlicense] [CI Status] [Commits] [Last Commit] + +yt-dlp is a feature-rich command-line audio/video downloader with +support for thousands of sites. The project is a fork of youtube-dl +based on the now inactive youtube-dlc. + +- INSTALLATION + - Detailed instructions + - Release Files + - Update + - Dependencies + - Compile +- USAGE AND OPTIONS + - General Options + - Network Options + - Geo-restriction + - Video Selection + - Download Options + - Filesystem Options + - Thumbnail Options + - Internet Shortcut Options + - Verbosity and Simulation Options + - Workarounds + - Video Format Options + - Subtitle Options + - Authentication Options + - Post-processing Options + - SponsorBlock Options + - Extractor Options +- CONFIGURATION + - Configuration file encoding + - Authentication with netrc + - Notes about environment variables +- OUTPUT TEMPLATE + - Output template examples +- FORMAT SELECTION + - Filtering Formats + - Sorting Formats + - Format Selection examples +- MODIFYING METADATA + - Modifying metadata examples +- EXTRACTOR ARGUMENTS +- PLUGINS + - Installing Plugins + - Developing Plugins +- EMBEDDING YT-DLP + - Embedding examples +- CHANGES FROM YOUTUBE-DL + - New features + - Differences in default behavior + - Deprecated options +- CONTRIBUTING + - Opening an Issue + - Developer Instructions +- WIKI + - FAQ + +INSTALLATION + +[Windows] [Unix] [MacOS] [PyPI] [Source Tarball] [Other variants] [All +versions] + +You can install yt-dlp using the binaries, pip or one using a +third-party package manager. See the wiki for detailed instructions + +RELEASE FILES + +Recommended + + ----------------------------------------------------------------------- + File Description + ----------------------------------- ----------------------------------- + yt-dlp Platform-independent zipimport + binary. Needs Python (recommended + for Linux/BSD) + + yt-dlp.exe Windows (Win8+) standalone x64 + binary (recommended for Windows) + + yt-dlp_macos Universal MacOS (10.15+) standalone + executable (recommended for MacOS) + ----------------------------------------------------------------------- + +Alternatives + + ----------------------------------------------------------------------- + File Description + ----------------------------------- ----------------------------------- + yt-dlp_x86.exe Windows (Win8+) standalone x86 + (32-bit) binary + + yt-dlp_linux Linux standalone x64 binary + + yt-dlp_linux_armv7l Linux standalone armv7l (32-bit) + binary + + yt-dlp_linux_aarch64 Linux standalone aarch64 (64-bit) + binary + + yt-dlp_win.zip Unpackaged Windows executable (no + auto-update) + + yt-dlp_macos.zip Unpackaged MacOS (10.15+) + executable (no auto-update) + + yt-dlp_macos_legacy MacOS (10.9+) standalone x64 + executable + ----------------------------------------------------------------------- + +Misc + + ----------------------------------------------------------------------- + File Description + ----------------------------------- ----------------------------------- + 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 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 + +Note: The manpages, shell completion (autocomplete) files etc. are +available inside the source tarball + +UPDATE + +You can use yt-dlp -U to update if you are using the release binaries + +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 to their +documentation + +There are currently three release channels for binaries: stable, nightly +and master. + +- stable is the default channel, and many of its changes have been + tested by users of the nightly and master channels. +- The nightly channel has releases scheduled to build every day around + midnight UTC, for a snapshot of the project's new patches and + changes. This is the recommended channel for regular users of + yt-dlp. The nightly releases are available from + yt-dlp/yt-dlp-nightly-builds or as development releases of the + yt-dlp PyPI package (which can be installed with pip's --pre flag). +- The master channel features releases that are built after each push + to the master branch, and these will have the very latest fixes and + additions, but may also be more prone to regressions. They are + available from yt-dlp/yt-dlp-master-builds. + +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 (/) 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 master switch to the master channel and update to + its latest release +- yt-dlp --update-to stable@2023.07.06 upgrade/downgrade to release to + stable channel tag 2023.07.06 +- yt-dlp --update-to 2023.10.07 upgrade/downgrade to tag 2023.10.07 if + it exists on the current channel +- yt-dlp --update-to example/yt-dlp@2023.09.24 upgrade/downgrade to + the release from the example/yt-dlp repository, tag 2023.09.24 + +Important: Any user experiencing an issue with the stable release should +install or update to the nightly release before submitting a bug report: + + # To update to nightly from stable executable/binary: + yt-dlp --update-to nightly + + # To install nightly with pip: + python3 -m pip install -U --pre "yt-dlp[default]" + +DEPENDENCIES + +Python versions 3.9+ (CPython) and 3.10+ (PyPy) are supported. Other +versions and implementations may or may not work correctly. + +While all the other dependencies are optional, ffmpeg and ffprobe are +highly recommended + +Strongly recommended + +- ffmpeg and ffprobe - Required for merging separate video and audio + files, as well as for various post-processing tasks. License depends + on the build + + There are bugs in ffmpeg that cause 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 + +Networking + +- certifi* - Provides Mozilla's root certificate bundle. Licensed + under MPLv2 +- brotli* or brotlicffi - Brotli content encoding support. Both + licensed under MIT 1 2 +- websockets* - For downloading over websocket. Licensed under + BSD-3-Clause +- requests* - HTTP library. For HTTPS proxy and persistent connections + support. Licensed under Apache-2.0 + +Impersonation + +The following provide support for impersonating browser requests. This +may be required for some sites that employ TLS fingerprinting. + +- curl_cffi (recommended) - Python binding for curl-impersonate. + Provides impersonation targets for Chrome, Edge and Safari. Licensed + under MIT + - Can be installed with the curl-cffi group, e.g. + pip install "yt-dlp[default,curl-cffi]" + - Currently included in yt-dlp.exe, yt-dlp_linux and yt-dlp_macos + builds + +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 + Mac and BSD. 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 +- 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 + +Deprecated + +- avconv and avprobe - Now deprecated alternative to ffmpeg. License + depends on the build +- sponskrub - For using the now deprecated sponskrub options. Licensed + under GPLv3+ +- 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+ + +To use or redistribute the dependencies, you must agree to their +respective licensing terms. + +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 + +COMPILE + +Standalone PyInstaller Builds + +To build the standalone executable, you must have Python and pyinstaller +(plus any of yt-dlp's optional dependencies if needed). The executable +will be built for the same CPU architecture as the Python used. + +You can run the following commands: + + python3 devscripts/install_deps.py --include pyinstaller + python3 devscripts/make_lazy_extractors.py + python3 -m bundle.pyinstaller + +On some systems, you may need to use py or python instead of python3. + +python -m bundle.pyinstaller 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. + +Important: Running pyinstaller directly instead of using +python -m bundle.pyinstaller is not officially supported. This may or +may not work correctly. + +Platform-independent Binary (UNIX) + +You will need the build tools python (3.9+), zip, make (GNU), pandoc* +and pytest*. + +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) + +Related scripts + +- devscripts/install_deps.py - Install dependencies for yt-dlp. +- devscripts/update-version.py - Update the version number based on + the 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/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 to something nonempty 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 to automatically build the selected version(s) as artifacts. +Alternatively, you can run the release workflow or enable the nightly +workflow to create full (pre-)releases. + +USAGE AND OPTIONS + + yt-dlp [OPTIONS] [--] URL [URL...] + +Ctrl+F is your friend :D + +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, master + -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 to --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 + --plugin-dirs PATH Path to an additional directory to search + for plugins. This option can be used + multiple times to add multiple directories. + Use "default" to search the default plugin + directories (default) + --no-plugin-dirs Clear plugin directories to search, + including defaults and those provided by + previous --plugin-dirs + --flat-playlist Do not extract a playlist's URL result + entries; some entry metadata may be missing + and downloading may be bypassed + --no-flat-playlist Fully extract the videos of a playlist + (default) + --live-from-start Download livestreams from the start. + Currently only supported for YouTube + (Experimental) + --no-live-from-start Download livestreams from the current time + (default) + --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). Use "auto-tty" or "no_color-tty" + to decide based on terminal support only. + 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 + -t, --preset-alias PRESET Applies a predefined set of options. e.g. + --preset-alias mp3. The following presets + are available: mp3, aac, mp4, mkv, sleep. + See the "Preset Aliases" section at the end + for more info. This option can be used + multiple times + +Network Options: + + --proxy URL Use the specified HTTP/HTTPS/SOCKS proxy. To + enable SOCKS proxy, specify a proper scheme, + e.g. socks5://user:pass@127.0.0.1:1080/. + 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 + --impersonate CLIENT[:OS] Client to impersonate for requests. E.g. + chrome, chrome-110, chrome:windows-10. Pass + --impersonate="" to impersonate any client. + Note that forcing impersonation for all + requests may have a detrimental impact on + download speed and stability + --list-impersonate-targets List available clients to impersonate. + -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. + +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 + downloading + --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 + +Video Selection: + + -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 + playlist of size 15 will download the items + at index 1,2,3,7,11,13,15 + --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 + [now|today|yesterday][-N[day|week|month|year]]. + 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 are the + same as --date + --dateafter DATE Download only videos uploaded on or after + this date. The date formats accepted are 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 at least one of the + conditions is met. E.g. --match-filters + !is_live --match-filters "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-filters -" to + interactively ask whether to download each + video + --no-match-filters Do not use any --match-filters (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 + age + --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 supplied with + the --download-archive option + --no-break-on-existing Do not stop the download process when + encountering a file that is in the archive + (default) + --break-per-input Alters --max-downloads, --break-on-existing, + --break-match-filters, 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 + +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 + "infinite" + --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-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 + (default) + --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 + (experimental) + --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" + --downloader [PROTO:]NAME Name or path of the external downloader to + use (optionally) prefixed by the protocols + (http, ftp, m3u8, dash, rstp, rtmp, mms) to + use it for. Currently supports native, + aria2c, avconv, axel, curl, ffmpeg, httpie, + wget. You can use this option multiple times + to set different downloaders for different + protocols. E.g. --downloader aria2c + --downloader "dash,m3u8:native" will use + aria2c for http/ftp downloads, and the + native downloader for dash/m3u8 downloads + (Alias: --external-downloader) + --downloader-args NAME:ARGS Give these arguments to the external + downloader. Specify the downloader name and + the arguments separated by a colon ":". For + ffmpeg, arguments can be passed to different + positions using the same syntax as + --postprocessor-args. You can use this + option multiple times to give different + arguments to different downloaders (Alias: + --external-downloader-args) + +Filesystem Options: + + -a, --batch-file FILE File containing URLs to download ("-" for + stdin), one URL per line. Lines starting + with "#", ";" or "]" are considered as + comments and ignored + --no-batch-file Do not read URLs from batch file (default) + -P, --paths [TYPES:]PATH The paths where the files should be + downloaded. Specify the type of file and the + path separated by a colon ":". All the same + TYPES as --output are supported. + Additionally, you can also provide "home" + (default) and "temp" paths. All intermediary + files are first downloaded to the temp path + and then the final files are moved over to + the home path after download is finished. + This option is ignored if --output is an + absolute path + -o, --output [TYPES:]TEMPLATE Output filename template; see "OUTPUT + TEMPLATE" for details + --output-na-placeholder TEXT Placeholder for unavailable fields in + --output (default: "NA") + --restrict-filenames Restrict filenames to only ASCII characters, + and avoid "&" and spaces in filenames + --no-restrict-filenames Allow Unicode characters, "&" and spaces in + filenames (default) + --windows-filenames Force filenames to be Windows-compatible + --no-windows-filenames Sanitize filenames only minimally + --trim-filenames LENGTH Limit the filename length (excluding + extension) to the specified number of + characters + -w, --no-overwrites Do not overwrite any files + --force-overwrites Overwrite all video and metadata files. This + option includes --no-continue + --no-force-overwrites Do not overwrite the video, but overwrite + related files (default) + -c, --continue Resume partially downloaded files/fragments + (default) + --no-continue Do not resume partially downloaded + fragments. If the file is not fragmented, + restart download of the entire file + --part Use .part files instead of writing directly + into output file (default) + --no-part Do not use .part files - write directly into + output file + --mtime Use the Last-modified header to set the file + modification time (default) + --no-mtime Do not use the Last-modified header to set + the file modification time + --write-description Write video description to a .description file + --no-write-description Do not write video description (default) + --write-info-json Write video metadata to a .info.json file + (this may contain personal information) + --no-write-info-json Do not write video metadata (default) + --write-playlist-metafiles Write playlist metadata in addition to the + video metadata when using --write-info-json, + --write-description etc. (default) + --no-write-playlist-metafiles Do not write playlist metadata when using + --write-info-json, --write-description etc. + --clean-info-json Remove some internal metadata such as + filenames from the infojson (default) + --no-clean-info-json Write all fields to the infojson + --write-comments Retrieve video comments to be placed in the + infojson. The comments are fetched even + without this option if the extraction is + known to be quick (Alias: --get-comments) + --no-write-comments Do not retrieve video comments unless the + extraction is known to be quick (Alias: + --no-get-comments) + --load-info-json FILE JSON file containing the video information + (created with the "--write-info-json" option) + --cookies FILE Netscape formatted file to read cookies from + and dump cookie jar in + --no-cookies Do not read/dump cookies from/to file + (default) + --cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER] + The name of the browser to load cookies + from. Currently supported browsers are: + brave, chrome, chromium, edge, firefox, + opera, safari, vivaldi, whale. Optionally, + the KEYRING used for decrypting Chromium + cookies on Linux, the name/path of the + PROFILE to load cookies from, and the + CONTAINER name (if Firefox) ("none" for no + container) can be given with their + respective separators. By default, all + containers of the most recently accessed + profile are used. Currently supported + keyrings are: basictext, gnomekeyring, + kwallet, kwallet5, kwallet6 + --no-cookies-from-browser Do not load cookies from browser (default) + --cache-dir DIR Location in the filesystem where yt-dlp can + store some downloaded information (such as + client ids and signatures) permanently. By + default ${XDG_CACHE_HOME}/yt-dlp + --no-cache-dir Disable filesystem caching + --rm-cache-dir Delete all filesystem cache files + +Thumbnail Options: + + --write-thumbnail Write thumbnail image to disk + --no-write-thumbnail Do not write thumbnail image to disk (default) + --write-all-thumbnails Write all thumbnail image formats to disk + --list-thumbnails List available thumbnails of each video. + Simulate unless --no-simulate is used + +Internet Shortcut Options: + + --write-link Write an internet shortcut file, depending + on the current platform (.url, .webloc or + .desktop). The URL may be cached by the OS + --write-url-link Write a .url Windows internet shortcut. The + OS caches the URL based on the file path + --write-webloc-link Write a .webloc macOS internet shortcut + --write-desktop-link Write a .desktop Linux internet shortcut + +Verbosity and Simulation Options: + + -q, --quiet Activate quiet mode. If used with --verbose, + print the log to stderr + --no-quiet Deactivate quiet mode. (Default) + --no-warnings Ignore warnings + -s, --simulate Do not download the video and do not write + anything to disk + --no-simulate Download the video even if printing/listing + options are used + --ignore-no-formats-error Ignore "No video formats" error. Useful for + extracting metadata even if the videos are + not actually available for download + (experimental) + --no-ignore-no-formats-error Throw error when no downloadable video + formats are found (default) + --skip-download Do not download the video but write all + related files (Alias: --no-download) + -O, --print [WHEN:]TEMPLATE Field name or output template to print to + screen, optionally prefixed with when to + print it, separated by a ":". Supported + values of "WHEN" are the same as that of + --use-postprocessor (default: video). + Implies --quiet. Implies --simulate unless + --no-simulate or later stages of WHEN are + used. This option can be used multiple times + --print-to-file [WHEN:]TEMPLATE FILE + Append given template to the file. The + values of WHEN and TEMPLATE are the same as + that of --print. FILE uses the same syntax + as the output template. This option can be + used multiple times + -j, --dump-json Quiet, but print JSON information for each + video. Simulate unless --no-simulate is + used. See "OUTPUT TEMPLATE" for a + description of available keys + -J, --dump-single-json Quiet, but print JSON information for each + URL or infojson passed. Simulate unless + --no-simulate is used. If the URL refers to + a playlist, the whole playlist information + is dumped in a single line + --force-write-archive Force download archive entries to be written + as far as no errors occur, even if -s or + another simulation option is used (Alias: + --force-download-archive) + --newline Output progress bar as new lines + --no-progress Do not print progress bar + --progress Show progress bar, even if in quiet mode + --console-title Display progress in console titlebar + --progress-template [TYPES:]TEMPLATE + Template for progress outputs, optionally + prefixed with one of "download:" (default), + "download-title:" (the console title), + "postprocess:", or "postprocess-title:". + The video's fields are accessible under the + "info" key and the progress attributes are + accessible under "progress" key. E.g. + --console-title --progress-template + "download-title:%(info.id)s-%(progress.eta)s" + --progress-delta SECONDS Time between progress output (default: 0) + -v, --verbose Print various debugging information + --dump-pages Print downloaded pages encoded using base64 + to debug problems (very verbose) + --write-pages Write downloaded intermediary pages to files + in the current directory to debug problems + --print-traffic Display sent and read HTTP traffic + +Workarounds: + + --encoding ENCODING Force the specified encoding (experimental) + --legacy-server-connect Explicitly allow HTTPS connection to servers + that do not support RFC 5746 secure + renegotiation + --no-check-certificates Suppress HTTPS certificate validation + --prefer-insecure Use an unencrypted connection to retrieve + information about the video (Currently + supported only for YouTube) + --add-headers FIELD:VALUE Specify a custom HTTP header and its value, + separated by a colon ":". You can use this + option multiple times + --bidi-workaround Work around terminals that lack + bidirectional text support. Requires bidiv + or fribidi executable in PATH + --sleep-requests SECONDS Number of seconds to sleep between requests + during data extraction + --sleep-interval SECONDS Number of seconds to sleep before each + download. This is the minimum time to sleep + when used along with --max-sleep-interval + (Alias: --min-sleep-interval) + --max-sleep-interval SECONDS Maximum number of seconds to sleep. Can only + be used along with --min-sleep-interval + --sleep-subtitles SECONDS Number of seconds to sleep before each + subtitle download + +Video Format Options: + + -f, --format FORMAT Video format code, see "FORMAT SELECTION" + for more details + -S, --format-sort SORTORDER Sort the formats by the fields given, see + "Sorting Formats" for more details + --format-sort-force Force user specified sort order to have + precedence over all fields, see "Sorting + Formats" for more details (Alias: --S-force) + --no-format-sort-force Some fields have precedence over the user + specified sort order (default) + --video-multistreams Allow multiple video streams to be merged + into a single file + --no-video-multistreams Only one video stream is downloaded for each + output file (default) + --audio-multistreams Allow multiple audio streams to be merged + into a single file + --no-audio-multistreams Only one audio stream is downloaded for each + output file (default) + --prefer-free-formats Prefer video formats with free containers + over non-free ones of the same quality. Use + with "-S ext" to strictly prefer free + containers irrespective of quality + --no-prefer-free-formats Don't give any special preference to free + containers (default) + --check-formats Make sure formats are selected only from + those that are actually downloadable + --check-all-formats Check all formats for whether they are + actually downloadable + --no-check-formats Do not check that the formats are actually + downloadable + -F, --list-formats List available formats of each video. + Simulate unless --no-simulate is used + --merge-output-format FORMAT Containers that may be used when merging + formats, separated by "/", e.g. "mp4/mkv". + Ignored if no merge is required. (currently + supported: avi, flv, mkv, mov, mp4, webm) + +Subtitle Options: + + --write-subs Write subtitle file + --no-write-subs Do not write subtitle file (default) + --write-auto-subs Write automatically generated subtitle file + (Alias: --write-automatic-subs) + --no-write-auto-subs Do not write auto-generated subtitles + (default) (Alias: --no-write-automatic-subs) + --list-subs List available subtitles of each video. + Simulate unless --no-simulate is used + --sub-format FORMAT Subtitle format; accepts formats preference + separated by "/", e.g. "srt" or "ass/srt/best" + --sub-langs LANGS Languages of the subtitles to download (can + be regex) or "all" separated by commas, e.g. + --sub-langs "en.*,ja" (where "en.*" is a + regex pattern that matches "en" followed by + 0 or more of any character). You can prefix + the language code with a "-" to exclude it + from the requested languages, e.g. --sub- + langs all,-live_chat. Use --list-subs for a + list of available language tags + +Authentication Options: + + -u, --username USERNAME Login with this account ID + -p, --password PASSWORD Account password. If this option is left + out, yt-dlp will ask interactively + -2, --twofactor TWOFACTOR Two-factor authentication code + -n, --netrc Use .netrc authentication data + --netrc-location PATH Location of .netrc authentication data; + either the path or its containing directory. + Defaults to ~/.netrc + --netrc-cmd NETRC_CMD Command to execute to get the credentials + for an extractor. + --video-password PASSWORD Video-specific password + --ap-mso MSO Adobe Pass multiple-system operator (TV + provider) identifier, use --ap-list-mso for + a list of available MSOs + --ap-username USERNAME Multiple-system operator account login + --ap-password PASSWORD Multiple-system operator account password. + If this option is left out, yt-dlp will ask + interactively + --ap-list-mso List all supported multiple-system operators + --client-certificate CERTFILE Path to client certificate file in PEM + format. May include the private key + --client-certificate-key KEYFILE + Path to private key file for client + certificate + --client-certificate-password PASSWORD + Password for client certificate private key, + if encrypted. If not provided, and the key + is encrypted, yt-dlp will ask interactively + +Post-Processing Options: + + -x, --extract-audio Convert video files to audio-only files + (requires ffmpeg and ffprobe) + --audio-format FORMAT Format to convert the audio to when -x is + used. (currently supported: best (default), + aac, alac, flac, m4a, mp3, opus, vorbis, + wav). You can specify multiple rules using + similar syntax as --remux-video + --audio-quality QUALITY Specify ffmpeg audio quality to use when + converting the audio with -x. Insert a value + between 0 (best) and 10 (worst) for VBR or a + specific bitrate like 128K (default 5) + --remux-video FORMAT Remux the video into another container if + necessary (currently supported: avi, flv, + gif, mkv, mov, mp4, webm, aac, aiff, alac, + flac, m4a, mka, mp3, ogg, opus, vorbis, + wav). If the target container does not + support the video/audio codec, remuxing will + fail. You can specify multiple rules; e.g. + "aac>m4a/mov>mp4/mkv" will remux aac to m4a, + mov to mp4 and anything else to mkv + --recode-video FORMAT Re-encode the video into another format if + necessary. The syntax and supported formats + are the same as --remux-video + --postprocessor-args NAME:ARGS Give these arguments to the postprocessors. + Specify the postprocessor/executable name + and the arguments separated by a colon ":" + to give the argument to the specified + postprocessor/executable. Supported PP are: + Merger, ModifyChapters, SplitChapters, + ExtractAudio, VideoRemuxer, VideoConvertor, + Metadata, EmbedSubtitle, EmbedThumbnail, + SubtitlesConvertor, ThumbnailsConvertor, + FixupStretched, FixupM4a, FixupM3u8, + FixupTimestamp and FixupDuration. The + supported executables are: AtomicParsley, + FFmpeg and FFprobe. You can also specify + "PP+EXE:ARGS" to give the arguments to the + specified executable only when being used by + the specified postprocessor. Additionally, + for ffmpeg/ffprobe, "_i"/"_o" can be + appended to the prefix optionally followed + by a number to pass the argument before the + specified input/output file, e.g. --ppa + "Merger+ffmpeg_i1:-v quiet". You can use + this option multiple times to give different + arguments to different postprocessors. + (Alias: --ppa) + -k, --keep-video Keep the intermediate video file on disk + after post-processing + --no-keep-video Delete the intermediate video file after + post-processing (default) + --post-overwrites Overwrite post-processed files (default) + --no-post-overwrites Do not overwrite post-processed files + --embed-subs Embed subtitles in the video (only for mp4, + webm and mkv videos) + --no-embed-subs Do not embed subtitles (default) + --embed-thumbnail Embed thumbnail in the video as cover art + --no-embed-thumbnail Do not embed thumbnail (default) + --embed-metadata Embed metadata to the video file. Also + embeds chapters/infojson if present unless + --no-embed-chapters/--no-embed-info-json are + used (Alias: --add-metadata) + --no-embed-metadata Do not add metadata to file (default) + (Alias: --no-add-metadata) + --embed-chapters Add chapter markers to the video file + (Alias: --add-chapters) + --no-embed-chapters Do not add chapter markers (default) (Alias: + --no-add-chapters) + --embed-info-json Embed the infojson as an attachment to + mkv/mka video files + --no-embed-info-json Do not embed the infojson as an attachment + to the video file + --parse-metadata [WHEN:]FROM:TO + Parse additional metadata like title/artist + from other fields; see "MODIFYING METADATA" + for details. Supported values of "WHEN" are + the same as that of --use-postprocessor + (default: pre_process) + --replace-in-metadata [WHEN:]FIELDS REGEX REPLACE + Replace text in a metadata field using the + given regex. This option can be used + multiple times. Supported values of "WHEN" + are the same as that of --use-postprocessor + (default: pre_process) + --xattrs Write metadata to the video file's xattrs + (using Dublin Core and XDG standards) + --concat-playlist POLICY Concatenate videos in a playlist. One of + "never", "always", or "multi_video" + (default; only when the videos form a single + show). All the video files must have the + same codecs and number of streams to be + concatenable. The "pl_video:" prefix can be + used with "--paths" and "--output" to set + the output filename for the concatenated + files. See "OUTPUT TEMPLATE" for details + --fixup POLICY Automatically correct known faults of the + file. One of never (do nothing), warn (only + emit a warning), detect_or_warn (the + default; fix the file if we can, warn + otherwise), force (try fixing even if the + file already exists) + --ffmpeg-location PATH Location of the ffmpeg binary; either the + path to the binary or its containing directory + --exec [WHEN:]CMD Execute a command, optionally prefixed with + when to execute it, separated by a ":". + Supported values of "WHEN" are the same as + that of --use-postprocessor (default: + after_move). The same syntax as the output + template can be used to pass any field as + arguments to the command. If no fields are + passed, %(filepath,_filename|)q is appended + to the end of the command. This option can + be used multiple times + --no-exec Remove any previously defined --exec + --convert-subs FORMAT Convert the subtitles to another format + (currently supported: ass, lrc, srt, vtt). + Use "--convert-subs none" to disable + conversion (default) (Alias: --convert- + subtitles) + --convert-thumbnails FORMAT Convert the thumbnails to another format + (currently supported: jpg, png, webp). You + can specify multiple rules using similar + syntax as "--remux-video". Use "--convert- + thumbnails none" to disable conversion + (default) + --split-chapters Split video into multiple files based on + internal chapters. The "chapter:" prefix can + be used with "--paths" and "--output" to set + the output filename for the split files. See + "OUTPUT TEMPLATE" for details + --no-split-chapters Do not split video based on chapters (default) + --remove-chapters REGEX Remove chapters whose title matches the + given regular expression. The syntax is the + same as --download-sections. This option can + be used multiple times + --no-remove-chapters Do not remove any chapters from the file + (default) + --force-keyframes-at-cuts Force keyframes at cuts when + downloading/splitting/removing sections. + This is slow due to needing a re-encode, but + the resulting video may have fewer artifacts + around the cuts + --no-force-keyframes-at-cuts Do not force keyframes around the chapters + when cutting/splitting (default) + --use-postprocessor NAME[:ARGS] + The (case-sensitive) name of plugin + postprocessors to be enabled, and + (optionally) arguments to be passed to it, + separated by a colon ":". ARGS are a + semicolon ";" delimited list of NAME=VALUE. + The "when" argument determines when the + postprocessor is invoked. It can be one of + "pre_process" (after video extraction), + "after_filter" (after video passes filter), + "video" (after --format; before + --print/--output), "before_dl" (before each + video download), "post_process" (after each + video download; default), "after_move" + (after moving the video file to its final + location), "after_video" (after downloading + and processing all formats of a video), or + "playlist" (at end of playlist). This option + can be used multiple times to add different + postprocessors + +SponsorBlock Options: + +Make chapter entries for, or remove various segments (sponsor, +introductions, etc.) from downloaded YouTube videos using the +SponsorBlock API + + --sponsorblock-mark CATS SponsorBlock categories to create chapters + for, separated by commas. Available + categories are sponsor, intro, outro, + selfpromo, preview, filler, interaction, + music_offtopic, poi_highlight, chapter, all + and default (=all). You can prefix the + category with a "-" to exclude it. See [1] + for descriptions of the categories. E.g. + --sponsorblock-mark all,-preview + [1] https://wiki.sponsor.ajay.app/w/Segment_Categories + --sponsorblock-remove CATS SponsorBlock categories to be removed from + the video file, separated by commas. If a + category is present in both mark and remove, + remove takes precedence. The syntax and + available categories are the same as for + --sponsorblock-mark except that "default" + refers to "all,-filler" and poi_highlight, + chapter are not available + --sponsorblock-chapter-title TEMPLATE + An output template for the title of the + SponsorBlock chapters created by + --sponsorblock-mark. The only available + fields are start_time, end_time, category, + categories, name, category_names. Defaults + to "[SponsorBlock]: %(category_names)l" + --no-sponsorblock Disable both --sponsorblock-mark and + --sponsorblock-remove + --sponsorblock-api URL SponsorBlock API location, defaults to + https://sponsor.ajay.app + +Extractor Options: + + --extractor-retries RETRIES Number of retries for known extractor errors + (default is 3), or "infinite" + --allow-dynamic-mpd Process dynamic DASH manifests (default) + (Alias: --no-ignore-dynamic-mpd) + --ignore-dynamic-mpd Do not process dynamic DASH manifests + (Alias: --no-allow-dynamic-mpd) + --hls-split-discontinuity Split HLS playlists to different formats at + discontinuities such as ad breaks + --no-hls-split-discontinuity Do not split HLS playlists into different + formats at discontinuities such as ad breaks + (default) + --extractor-args IE_KEY:ARGS Pass ARGS arguments to the IE_KEY extractor. + See "EXTRACTOR ARGUMENTS" for details. You + can use this option multiple times to give + arguments for different extractors + +Preset Aliases: + + -t mp3 -f 'ba[acodec^=mp3]/ba/b' -x --audio-format + mp3 + + -t aac -f + 'ba[acodec^=aac]/ba[acodec^=mp4a.40.]/ba/b' + -x --audio-format aac + + -t mp4 --merge-output-format mp4 --remux-video mp4 + -S vcodec:h264,lang,quality,res,fps,hdr:12,a + codec:aac + + -t mkv --merge-output-format mkv --remux-video mkv + + -t sleep --sleep-subtitles 5 --sleep-requests 0.75 + --sleep-interval 10 --max-sleep-interval 20 + +CONFIGURATION + +You can configure yt-dlp by placing any supported command line option in +a configuration file. The configuration is loaded from the following +locations: + +1. Main Configuration: + - The file given to --config-location +2. 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 +3. Home Configuration: + - yt-dlp.conf in the home path given to -P + - If -P is not given, the current directory is searched +4. 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 + + See also: Notes about environment variables +5. System Configuration: + - /etc/yt-dlp.conf + - /etc/yt-dlp/config + - /etc/yt-dlp/config.txt + +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: + + # Lines starting with # are comments + + # Always extract audio + -x + + # Do not copy the mtime + --no-mtime + + # Use this proxy + --proxy 127.0.0.1:3128 + + # Save all videos under YouTube directory in your home directory + -o ~/YouTube/%(title)s.%(ext)s + +Note: Options in a 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. + +Configuration file encoding + +The configuration files are decoded according to the UTF BOM if present, +and in the encoding from system locale otherwise. + +If you want your file to be decoded differently, add # coding: ENCODING +to the beginning of the file (e.g. # coding: shift-jis). There must be +no characters before that, even spaces or BOM. + +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 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 + +After that, you can add credentials for an extractor in the following +format, where extractor is the name of the extractor in lowercase: + + machine login password + +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. + +The default location of the .netrc file is ~ (see below). + +As an alternative to using the .netrc file, which has the disadvantage +of keeping your passwords in a plain text file, you can configure a +custom shell command to provide the credentials for an extractor. This +is done by providing the --netrc-cmd parameter, it shall output the +credentials in the netrc format and return 0 on success, other values +will be treated as an error. {} in the command will be replaced by the +name of the extractor to make it possible to select the credentials for +the right extractor. + +E.g. To use an encrypted .netrc file stored as .authinfo.gpg + + yt-dlp --netrc-cmd 'gpg --decrypt ~/.authinfo.gpg' 'https://www.youtube.com/watch?v=BaW_jenozKc' + +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 allows 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\ + and ${APPDATA} to ${USERPROFILE}\AppData\Roaming + +OUTPUT TEMPLATE + +The -o option is used to indicate a template for the output file names +while -P option is used to specify the path each type of file should be +saved to. + +tl;dr: navigate me to examples. + +The simplest usage of -o is not to set any template arguments when +downloading a single file, like in +yt-dlp -o funny_video.flv "https://some/video" (hard-coding file +extension like this is not recommended and could break some +post-processing). + +It may however also contain special sequences that will be replaced when +downloading each video. The special sequences may be formatted according +to Python string formatting operations, e.g. %(NAME)s or %(NAME)05d. To +clarify, that is a percent symbol followed by a name in parentheses, +followed by formatting operations. + +The field names themselves (the part inside the parenthesis) can also +have some special formatting: + +1. Object traversal: The dictionaries and lists available in metadata + can be traversed by using a dot . separator; e.g. %(tags.0)s, + %(subtitles.en.-1.ext)s. You can do Python slicing with colon :; + E.g. %(id.3:7)s, %(id.6:2:-1)s, %(formats.:.format_id)s. Curly + braces {} can be used to build dictionaries with only specific keys; + e.g. %(formats.:.{format_id,height})#j. An empty field name %()s + refers to the entire infodict; e.g. %(.{id,title})s. Note that all + the fields that become available using this method are not listed + below. Use -j to see such fields + +2. Arithmetic: Simple arithmetic can be done on numeric fields using + +, - and *. E.g. %(playlist_index+10)03d, + %(n_entries+1-playlist_index)d + +3. Date/time Formatting: Date/time fields can be formatted according to + strftime formatting by specifying it separated from the field name + using a >. E.g. %(duration>%H-%M-%S)s, %(upload_date>%Y-%m-%d)s, + %(epoch-3600>%H-%M-%S)s + +4. Alternatives: Alternate fields can be specified separated with a ,. + E.g. %(release_date>%Y,upload_date>%Y|Unknown)s + +5. Replacement: A replacement value can be specified using a & + separator according to the str.format mini-language. If the field is + not empty, this replacement value will be used instead of the actual + field content. This is done after alternate fields are considered; + thus the replacement is used if any of the alternative fields is not + empty. E.g. %(chapters&has chapters|no chapters)s, + %(title&TITLE={:>20}|NO TITLE)s + +6. Default: A literal default value can be specified for when the field + is empty using a | separator. This overrides + --output-na-placeholder. E.g. %(uploader|Unknown)s + +7. More Conversions: In addition to the normal format types + diouxXeEfFgGcrs, yt-dlp additionally supports converting to B = + Bytes, j = json (flag # for pretty-printing, + for Unicode), h = + HTML escaping, l = a comma separated list (flag # for \n + newline-separated), q = a string quoted for the terminal (flag # to + split a list into different arguments), D = add Decimal suffixes + (e.g. 10M) (flag # to use 1024 as factor), and S = Sanitize as + filename (flag # for restricted) + +8. Unicode normalization: The format type U can be used for NFC Unicode + normalization. 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 + +To summarize, the general syntax for a field is: + + %(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type + +Additionally, you can set different output templates for the various +metadata files separately from the general output template by specifying +the type of file followed by the template separated by a colon :. The +different file types supported are subtitle, thumbnail, description, +annotation (deprecated), infojson, link, pl_thumbnail, pl_description, +pl_infojson, chapter, pl_video. E.g. +-o "%(title)s.%(ext)s" -o "thumbnail:%(title)s\%(title)s.%(ext)s" will +put the thumbnails in a folder with the same name as the video. If any +of the templates is empty, that type of file will not be written. E.g. +--write-thumbnail -o "thumbnail:" will write thumbnails only for +playlists and not for video. + +Note: Due to post-processing (i.e. merging etc.), the actual output +filename might differ. Use --print after_move:filepath to get the name +after all post-processing is complete. + +The available fields are: + +- id (string): Video identifier +- title (string): Video title +- fulltitle (string): Video title ignoring live timestamp and generic + title +- ext (string): Video filename extension +- alt_title (string): A secondary title of the video +- description (string): The description of the video +- display_id (string): An alternative identifier for the video +- uploader (string): Full name of the video uploader +- uploader_id (string): Nickname or id of the video uploader +- uploader_url (string): URL to the video uploader's profile +- license (string): License name the video is licensed under +- creators (list): The creators of the video +- creator (string): The creators of the video; comma-separated +- timestamp (numeric): UNIX timestamp of the moment the video became + available +- upload_date (string): Video upload date in UTC (YYYYMMDD) +- release_timestamp (numeric): UNIX timestamp of the moment the video + was released +- release_date (string): The date (YYYYMMDD) when the video was + released in UTC +- release_year (numeric): Year (YYYY) when the video or album was + released +- modified_timestamp (numeric): UNIX timestamp of the moment the video + was last modified +- modified_date (string): The date (YYYYMMDD) when the video was last + modified in UTC +- channel (string): Full name of the channel the video is uploaded on +- channel_id (string): Id of the channel +- channel_url (string): URL of the channel +- channel_follower_count (numeric): Number of followers of the channel +- channel_is_verified (boolean): Whether the channel is verified on + the platform +- location (string): Physical location where the video was filmed +- duration (numeric): Length of the video in seconds +- duration_string (string): Length of the video (HH:mm:ss) +- view_count (numeric): How many users have watched the video on the + platform +- concurrent_view_count (numeric): How many users are currently + watching the video on the platform. +- like_count (numeric): Number of positive ratings of the video +- dislike_count (numeric): Number of negative ratings of the video +- repost_count (numeric): Number of reposts of the video +- average_rating (numeric): Average rating given by users, the scale + used depends on the webpage +- comment_count (numeric): Number of comments on the video (For some + extractors, comments are only downloaded at the end, and so this + field cannot be used) +- age_limit (numeric): Age restriction for the video (years) +- live_status (string): One of "not_live", "is_live", "is_upcoming", + "was_live", "post_live" (was live, but VOD is not yet processed) +- is_live (boolean): Whether this video is a live stream or a + fixed-length video +- was_live (boolean): Whether this video was originally a live stream +- playable_in_embed (string): Whether this video is allowed to play in + embedded players on other sites +- availability (string): Whether the video is "private", + "premium_only", "subscriber_only", "needs_auth", "unlisted" or + "public" +- media_type (string): The type of media as classified by the site, + e.g. "episode", "clip", "trailer" +- start_time (numeric): Time in seconds where the reproduction should + start, as specified in the URL +- end_time (numeric): Time in seconds where the reproduction should + end, as specified in the URL +- extractor (string): Name of the extractor +- extractor_key (string): Key name of the extractor +- epoch (numeric): Unix epoch of when the information extraction was + completed +- autonumber (numeric): Number that will be increased with each + download, starting at --autonumber-start, padded with leading zeros + to 5 digits +- video_autonumber (numeric): Number that will be increased with each + video +- n_entries (numeric): Total number of extracted items in the playlist +- playlist_id (string): Identifier of the playlist that contains the + video +- playlist_title (string): Name of the playlist that contains the + video +- playlist (string): playlist_title if available or else playlist_id +- playlist_count (numeric): Total number of items in the playlist. May + not be known if entire playlist is not extracted +- playlist_index (numeric): Index of the video in the playlist padded + with leading zeros according the final index +- playlist_autonumber (numeric): Position of the video in the playlist + download queue padded with leading zeros according to the total + length of the playlist +- playlist_uploader (string): Full name of the playlist uploader +- playlist_uploader_id (string): Nickname or id of the playlist + uploader +- playlist_channel (string): Display name of the channel that uploaded + the playlist +- playlist_channel_id (string): Identifier of the channel that + uploaded the playlist +- playlist_webpage_url (string): URL of the playlist webpage +- webpage_url (string): A URL to the video webpage which, if given to + yt-dlp, should yield 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 the same as + webpage_url for playlist entries) +- categories (list): List of categories the video belongs to +- tags (list): List of tags assigned to the video +- cast (list): List of cast members + +All the fields in Filtering Formats can also be used + +Available for the video that belongs to some logical chapter or section: + +- chapter (string): Name or title of the chapter the video belongs to +- chapter_number (numeric): Number of the chapter the video belongs to +- chapter_id (string): Id of the chapter the video belongs to + +Available for the video that is an episode of some series or program: + +- series (string): Title of the series or program the video episode + belongs to +- series_id (string): Id of the series or program the video episode + belongs to +- season (string): Title of the season the video episode belongs to +- season_number (numeric): Number of the season the video episode + belongs to +- season_id (string): Id of the season the video episode belongs to +- episode (string): Title of the video episode +- episode_number (numeric): Number of the video episode within a + season +- episode_id (string): Id of the video episode + +Available for the media that is a track or a part of a music album: + +- track (string): Title of the track +- track_number (numeric): Number of the track within an album or a + disc +- track_id (string): Id of the track +- artists (list): Artist(s) of the track +- artist (string): Artist(s) of the track; comma-separated +- genres (list): Genre(s) of the track +- genre (string): Genre(s) of the track; comma-separated +- composers (list): Composer(s) of the piece +- composer (string): Composer(s) of the piece; comma-separated +- album (string): Title of the album the track belongs to +- album_type (string): Type of the album +- album_artists (list): All artists appeared on the album +- album_artist (string): All artists appeared on the album; + comma-separated +- disc_number (numeric): Number of the disc or other physical medium + the track belongs to + +Available only when using --download-sections and for chapter: prefix +when using --split-chapters for videos with internal chapters: + +- section_title (string): Title of the chapter +- section_number (numeric): Number of the chapter within the file +- section_start (numeric): Start time of the chapter in seconds +- section_end (numeric): End time of the chapter in seconds + +Available only when used in --print: + +- urls (string): The URLs of all requested formats, one in each line +- filename (string): Name of the video file. Note that the actual + filename may differ +- formats_table (table): The video format table as printed by + --list-formats +- 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: + +- start_time (numeric): Start time of the chapter in seconds +- end_time (numeric): End time of the chapter in seconds +- categories (list): The SponsorBlock categories the chapter belongs + to +- category (string): The smallest SponsorBlock category the chapter + belongs to +- category_names (list): Friendly names of the categories +- name (string): Friendly name of the smallest category +- type (string): The SponsorBlock 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. + +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). + +Tip: Look at the -j output to identify which fields are available for +the particular URL + +For numeric sequences, you can use numeric related formatting; e.g. +%(view_count)05d will result in a string with view count padded with +zeros up to 5 characters, like in 00042. + +Output templates can also contain arbitrary hierarchical path, e.g. +-o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" which will +result in downloading each video in a directory corresponding to this +path template. Any missing directory will be automatically created for +you. + +To use percent literals in an output template use %%. To output to +stdout use -o -. + +The current default template is %(title)s [%(id)s].%(ext)s. + +In some cases, you don't want special characters such as 中, spaces, or +&, such as when transferring the downloaded filename to a Windows system +or the filename through an 8bit-unsafe channel. In these cases, add the +--restrict-filenames flag to get a shorter title. + +Output template examples + + $ yt-dlp --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 + youtube-dl test video ''_ä↭𝕐.webm # All kinds of weird characters + + $ yt-dlp --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" + + # 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" + + # 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" + + # 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" + + # 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" + + # 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" + + # 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_jenozKc --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 + + # Stream the video being downloaded to stdout + $ yt-dlp -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. + +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. + +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. + +tl;dr: navigate me to examples. + +The simplest case is requesting a specific format; e.g. with -f 22 you +can download the format with format code equal to 22. You can get the +list of available format codes for particular video using --list-formats +or -F. Note that these format codes are extractor specific. + +You can also use a file extension (currently 3gp, aac, flv, m4a, mp3, +mp4, ogg, wav, webm are supported) to download the best quality format +of a particular file extension served as a single file, e.g. -f webm +will download the best quality format with the webm extension served as +a single file. + +You can use -f - to interactively provide the format selector for each +video + +You can also use special names to select particular edge case formats: + +- all: Select all formats separately +- mergeall: Select and merge all formats (Must be used with + --audio-multistreams, --video-multistreams or both) +- b*, best*: Select the best quality format that contains either a + video or an audio or both (i.e.; vcodec!=none or acodec!=none) +- b, best: Select the best quality format that contains both video and + audio. Equivalent to best*[vcodec!=none][acodec!=none] +- bv, bestvideo: Select the best quality video-only format. Equivalent + to best*[acodec=none] +- bv*, bestvideo*: Select the best quality format that contains video. + It may also contain audio. Equivalent to best*[vcodec!=none] +- ba, bestaudio: Select the best quality audio-only format. Equivalent + to best*[vcodec=none] +- ba*, bestaudio*: Select the best quality format that contains audio. + It may also contain video. Equivalent to best*[acodec!=none] (Do not + use!) +- w*, worst*: Select the worst quality format that contains either a + video or an audio +- w, worst: Select the worst quality format that contains both video + and audio. Equivalent to worst*[vcodec!=none][acodec!=none] +- wv, worstvideo: Select the worst quality video-only format. + Equivalent to worst*[acodec=none] +- wv*, worstvideo*: Select the worst quality format that contains + video. It may also contain audio. Equivalent to worst*[vcodec!=none] +- wa, worstaudio: Select the worst quality audio-only format. + Equivalent to worst*[vcodec=none] +- wa*, worstaudio*: Select the worst quality format that contains + audio. It may also contain video. Equivalent to worst*[acodec!=none] + +For example, to download the worst quality video-only format you can use +-f worstvideo. It is, however, recommended not to use worst and related +options. When your format selector is worst, the format which is worst +in all respects is selected. Most of the time, what you actually want is +the video with the smallest filesize instead. So it is generally better +to use -S +size or more rigorously, -S +size,+br,+res,+fps instead of +-f worst. See Sorting Formats for more details. + +You can select the n'th best format of a type by using best.. +For example, best.2 will select the 2nd best combined format. Similarly, +bv*.3 will select the 3rd best format that contains a video stream. + +If you want to download multiple videos, and they don't have the same +formats available, you can specify the order of preference using +slashes. Note that formats on the left hand side are preferred; e.g. +-f 22/17/18 will download format 22 if it's available, otherwise it will +download format 17 if it's available, otherwise it will download format +18 if it's available, otherwise it will complain that no suitable +formats are available for download. + +If you want to download several formats of the same video use a comma as +a separator, e.g. -f 22,17,18 will download all these three formats, of +course if they are available. Or a more sophisticated example combined +with the precedence feature: -f 136/137/mp4/bestvideo,140/m4a/bestaudio. + +You can merge the video and audio of multiple formats into a single file +using -f ++... (requires ffmpeg installed); e.g. +-f bestvideo+bestaudio will download the best video-only format, the +best audio-only format and mux them together with ffmpeg. + +Deprecation warning: Since the below described behavior is complex and +counter-intuitive, this will be removed and multistreams will be enabled +by default in the future. A new operator will be instead added to limit +formats to single audio/video + +Unless --video-multistreams is used, all formats with a video stream +except the first one are ignored. Similarly, unless --audio-multistreams +is used, all formats with an audio stream except the first one are +ignored. E.g. +-f bestvideo+best+bestaudio --video-multistreams --audio-multistreams +will download and merge all 3 given formats. The resulting file will +have 2 video streams and 2 audio streams. But +-f bestvideo+best+bestaudio --no-video-multistreams will download and +merge only bestvideo and bestaudio. best is ignored since another format +containing a video stream (bestvideo) has already been selected. The +order of the formats is therefore important. +-f best+bestaudio --no-audio-multistreams will download only best while +-f bestaudio+best --no-audio-multistreams will ignore best and download +only bestaudio. + +Filtering Formats + +You can also filter the video formats by putting a condition in +brackets, as in -f "best[height=720]" (or -f "[filesize>10M]" since +filters without a selector are interpreted as best). + +The following numeric meta fields can be used with comparisons <, <=, >, +>=, = (equals), != (not equals): + +- filesize: The number of bytes, if known in advance +- filesize_approx: An estimate for the number of bytes +- width: Width of the video, if known +- height: Height of the video, if known +- aspect_ratio: Aspect ratio of the video, if known +- tbr: Average bitrate of audio and video in kbps +- abr: Average audio bitrate in kbps +- vbr: Average video bitrate in kbps +- asr: Audio sampling rate in Hertz +- fps: Frame rate +- audio_channels: The number of audio channels +- stretched_ratio: width:height of the video's pixels, if not square + +Also filtering work for comparisons = (equals), ^= (starts with), $= +(ends with), *= (contains), ~= (matches regex) and following string meta +fields: + +- url: Video URL +- ext: File extension +- acodec: Name of the audio codec in use +- vcodec: Name of the video codec in use +- container: Name of the container format +- protocol: The protocol that will be used for the actual download, + lower-case (http, https, rtsp, rtmp, rtmpe, mms, f4m, ism, + http_dash_segments, m3u8, or m3u8_native) +- language: Language code +- dynamic_range: The dynamic range of the video +- format_id: A short description of the format +- format: A human-readable description of the format +- format_note: Additional info about the format +- resolution: Textual description of width and height + +Any string comparison may be prefixed with negation ! in order to +produce an opposite comparison, e.g. !*= (does not contain). The +comparand of a string comparison needs to be quoted with either double +or single quotes if it contains spaces or special characters other than +._-. + +Note: None of the aforementioned meta fields are guaranteed to be +present since this solely depends on the metadata obtained by the +particular extractor, i.e. the metadata offered by the website. Any +other field made available by the extractor can also be used for +filtering. + +Formats for which the value is not known are excluded unless you put a +question mark (?) after the operator. You can combine format filters, so +-f "bv[height<=?720][tbr>500]" selects up to 720p videos (or videos +where the height is not known) with a bitrate of at least 500 kbps. You +can also use the filters with all to download all formats that satisfy +the filter, e.g. -f "all[vcodec=none]" selects all audio-only formats. + +Format selectors can also be grouped using parentheses; e.g. +-f "(mp4,webm)[height<480]" will download the best pre-merged mp4 and +webm formats with a height lower than 480. + +Sorting Formats + +You can change the criteria for being considered the best by using -S +(--format-sort). The general format for this is +--format-sort field1,field2.... + +The available fields are: + +- hasvid: Gives priority to formats that have a video stream +- hasaud: Gives priority to formats that have an audio stream +- ie_pref: The format preference +- lang: The language preference as determined by the extractor (e.g. + original language preferred over audio description) +- quality: The quality of the format +- source: The preference of the source +- proto: Protocol used for download (https/ftps > http/ftp > + m3u8_native/m3u8 > http_dash_segments> websocket_frag > mms/rtsp > + f4f/f4m) +- vcodec: Video Codec (av01 > vp9.2 > vp9 > h265 > h264 > vp8 > h263 > + theora > other) +- acodec: Audio Codec (flac/alac > wav/aiff > opus > vorbis > aac > + mp4a > mp3 > ac4 > eac3 > ac3 > dts > other) +- codec: Equivalent to vcodec,acodec +- vext: Video Extension (mp4 > mov > webm > flv > other). If + --prefer-free-formats is used, webm is preferred. +- aext: Audio Extension (m4a > aac > mp3 > ogg > opus > webm > other). + If --prefer-free-formats is used, the order changes to ogg > opus > + webm > mp3 > m4a > aac +- ext: Equivalent to vext,aext +- filesize: Exact filesize, if known in advance +- fs_approx: Approximate filesize +- size: Exact filesize if available, otherwise approximate filesize +- height: Height of video +- width: Width of video +- res: Video resolution, calculated as the smallest dimension. +- fps: Framerate of video +- hdr: The dynamic range of the video (DV > HDR12 > HDR10+ > HDR10 > + HLG > SDR) +- channels: The number of audio channels +- tbr: Total average bitrate in kbps +- vbr: Average video bitrate in kbps +- abr: Average audio bitrate in kbps +- br: Average bitrate in kbps, 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. + +The fields hasvid and ie_pref are always given highest priority in +sorting, irrespective of the user-defined order. This behavior can be +changed by using --format-sort-force. Apart from these, the default +order used is: +lang,quality,res,fps,hdr:12,vcodec,channels,acodec,size,br,asr,proto,ext,hasaud,source,id. +The extractors may override this default order, but they cannot override +the user-provided order. + +Note that the default for hdr is hdr:12; i.e. Dolby Vision is not +preferred. This choice was made since DV formats are not yet fully +compatible with most devices. This may be changed in the future. + +If your format selector is worst, the last item is selected after +sorting. This means it will select the format that is worst in all +respects. Most of the time, what you actually want is the video with the +smallest filesize instead. So it is generally better to use +-f best -S +size,+br,+res,+fps. + +Tip: You can use the -v -F to see how the formats have been sorted +(worst to best). + +Format Selection examples + + # 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" + + # 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" + + # Same as above + $ yt-dlp + + # 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" + + # 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 + + # 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 + + + # 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" + + # Download the best video available but with the smallest resolution + $ yt-dlp -S "+res" + + # Download the smallest video available + $ yt-dlp -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" + + # Download the best video with the best extension + # (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...) + $ yt-dlp -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" + + # 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" + + # 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" + + + + # 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" + + # Download the 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" + + # Download the best video (that also has audio) that is closest in size to 50 MB + $ yt-dlp -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)" + + # Download best video available via the best protocol + # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...) + $ yt-dlp -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)" + + # 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" + + # 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" + + + + # More complex examples + + # 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)" + + # 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" + + + + # 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" + +MODIFYING METADATA + +The metadata obtained by the extractors can be modified by using +--parse-metadata and --replace-in-metadata + +--replace-in-metadata FIELDS REGEX REPLACE is used to replace text in +any metadata field using Python regular expression. Backreferences can +be used in the replace string for advanced use. + +The general syntax of --parse-metadata FROM:TO is to give the name of a +field or an output template to extract data from, and the format to +interpret it as, separated by a colon :. Either a Python regular +expression with named capture groups, a single field name, or a similar +syntax to the output template (only %(field)s formatting is supported) +can be used for TO. The option can be used multiple times to parse and +modify various fields. + +Note that these options preserve their relative order, allowing +replacements to be made in parsed fields and vice versa. Also, any field +thus created can be used in the output template and will also affect the +media file's metadata added when using --embed-metadata. + +This option also has a few special uses: + +- You can download an additional URL based on the metadata of the + currently downloaded video. To do this, set the field + additional_urls to the URL that you want to download. E.g. + --parse-metadata "description:(?Phttps?://www\.vimeo\.com/\d+)" + will download the first vimeo video found in the description + +- You can use this to change the metadata that is embedded in the + media file. To do this, set the value of the corresponding field + with a meta_ prefix. For example, any value you set to + meta_description field will be added to the description field in the + file - you can use this to set a different "description" and + "synopsis". To modify the metadata of individual streams, use the + meta_ prefix (e.g. meta1_language). Any value set to the meta_ + field will overwrite all default values. + +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: + + ----------------------------------------------------------------------- + Metadata fields From + ------------------------- --------------------------------------------- + title track or title + + date upload_date + + description, synopsis description + + purl, comment webpage_url + + track track_number + + artist artist, artists, creator, creators, uploader + or uploader_id + + composer composer or composers + + genre genre or genres + + album album + + album_artist album_artist or album_artists + + disc disc_number + + show series + + season_number season_number + + episode_id episode or episode_id + + episode_sort episode_number + + language of each stream the format's language + ----------------------------------------------------------------------- + +Note: The file format may not support some of these fields + +Modifying metadata examples + + # Interpret the title as "Artist - Title" + $ yt-dlp --parse-metadata "title:%(artist)s - %(title)s" + + # Regex example + $ yt-dlp --parse-metadata "description:Artist - (?P.+)" + + # Set title as "Series name S01E05" + $ yt-dlp --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 + + # Set "comment" field in video metadata using description instead of webpage_url, + # handling multiple lines correctly + $ yt-dlp --parse-metadata "description:(?s)(?P.+)" --embed-metadata + + # Do not set any "synopsis" in the video metadata + $ yt-dlp --parse-metadata ":(?P)" + + # Remove "formats" field from the infojson by setting it to an empty string + $ yt-dlp --parse-metadata "video::(?P)" --write-info-json + + # Replace all spaces and "_" in title and uploader with a `-` + $ yt-dlp --replace-in-metadata "title,uploader" "[ _]" "-" + +EXTRACTOR ARGUMENTS + +Some extractors accept additional arguments which can be passed using +--extractor-args KEY:ARGS. ARGS is a ; (semicolon) separated string of +ARG=VAL1,VAL2. E.g. +--extractor-args "youtube:player-client=tv,mweb;formats=incomplete" --extractor-args "twitter:api=syndication" + +Note: In CLI, ARG can use - instead of _; e.g. youtube:player-client" +becomes youtube:player_client" + +The following extractors use this feature: + +youtube + +- lang: Prefer translated metadata (title, description etc) of this + language code (case-sensitive). By default, the video primary + language metadata is preferred, with a fallback to en translated. + See youtube.py for list of supported content language codes +- skip: One or more of hls, dash or translated_subs to skip extraction + of the m3u8 manifests, dash manifests and auto-translated subtitles + respectively +- player_client: Clients to extract video data from. The currently + available clients are web, web_safari, web_embedded, web_music, + web_creator, mweb, ios, android, android_vr, tv and tv_embedded. By + default, tv,ios,web is used, or tv,web is used when authenticating + with cookies. The web_music client is added for music.youtube.com + URLs when logged-in cookies are used. The tv_embedded and + web_creator clients are added for age-restricted videos if account + age-verification is required. Some clients, such as web and + web_music, require a po_token for their formats to be downloadable. + Some clients, such as web_creator, will only work with + authentication. Not all clients support authentication via cookies. + You can use default for the default clients, or you can use all for + all clients (not recommended). You can prefix a client with - to + exclude it, e.g. youtube:player_client=default,-ios +- player_skip: Skip some network requests that are generally needed + for robust extraction. One or more of configs (skip client configs), + webpage (skip initial webpage), js (skip js player), initial_data + (skip initial data/next ep request). While these options can help + reduce the number of requests needed or avoid some rate-limiting, + they could cause issues such as missing formats or metadata. See + #860 and #12826 for more details +- player_params: YouTube player parameters to use for player requests. + Will overwrite any default ones set by yt-dlp. +- comment_sort: top or new (default) - choose comment sorting mode (on + YouTube's side) +- max_comments: Limit the amount of comments to gather. + Comma-separated list of integers representing + max-comments,max-parents,max-replies,max-replies-per-thread. Default + is all,all,all,all + - E.g. all,all,1000,10 will get a maximum of 1000 replies total, + with up to 10 replies per thread. 1000,all,100 will get a + maximum of 1000 comments, with a maximum of 100 replies total +- formats: Change the types of formats to return. dashy (convert HTTP + to DASH), duplicate (identical content but different URLs or + protocol; includes dashy), incomplete (cannot be downloaded + completely - live dash and post-live m3u8), missing_pot (include + formats that require a PO Token but are missing one) +- innertube_host: Innertube API host to use for all API requests; e.g. + studio.youtube.com, youtubei.googleapis.com. Note that cookies + exported from one subdomain will not work on others +- innertube_key: Innertube API key to use for all API requests. By + default, no API key is used +- raise_incomplete_data: Incomplete Data Received raises an error + instead of reporting a warning +- data_sync_id: Overrides the account Data Sync ID used in Innertube + API requests. This may be needed if you are using an account with + youtube:player_skip=webpage,configs or youtubetab:skip=webpage +- visitor_data: Overrides the Visitor Data used in Innertube API + requests. This should be used with player_skip=webpage,configs and + without cookies. Note: this may have adverse effects if used + improperly. If a session from a browser is wanted, you should pass + cookies instead (which contain the Visitor ID) +- po_token: Proof of Origin (PO) Token(s) to use. Comma seperated list + of PO Tokens in the format CLIENT.CONTEXT+PO_TOKEN, e.g. + youtube:po_token=web.gvs+XXX,web.player=XXX,web_safari.gvs+YYY. + Context can be either gvs (Google Video Server URLs) or player + (Innertube player request) +- player_js_variant: The player javascript variant to use for + signature and nsig deciphering. The known variants are: main, tce, + tv, tv_es6, phone, tablet. Only main is recommended as a possible + workaround; the others are for debugging purposes. The default is to + use what is prescribed by the site, and can be selected with actual + +youtubetab (YouTube playlists, channels, feeds, etc.) + +- skip: One or more of webpage (skip initial webpage download), + authcheck (allow the download of playlists requiring authentication + when no initial webpage is downloaded. This may cause unwanted + behavior, see #1122 for more details) +- approximate_date: Extract approximate upload_date and timestamp in + flat-playlist. This may cause date-based filters to be slightly off + +generic + +- fragment_query: Passthrough any query in mpd/m3u8 manifest URLs to + their fragments if no value is provided, or else apply the query + string given as fragment_query=VALUE. Note that if the stream has an + HLS AES-128 key, then the query parameters will be passed to the key + URI as well, unless the key_query extractor-arg is passed, or unless + an external key URI is provided via the hls_key extractor-arg. Does + not apply to ffmpeg +- variant_query: Passthrough the master m3u8 URL query to its variant + playlist URLs if no value is provided, or else apply the query + string given as variant_query=VALUE +- key_query: Passthrough the master m3u8 URL query to its HLS AES-128 + decryption key URI if no value is provided, or else apply the query + string given as key_query=VALUE. Note that this will have no effect + if the key URI is provided via the hls_key extractor-arg. Does not + apply to ffmpeg +- hls_key: An HLS AES-128 key URI or key (as hex), and optionally the + IV (as hex), in the form of (URI|KEY)[,IV]; e.g. + generic:hls_key=ABCDEF1234567980,0xFEDCBA0987654321. Passing any of + these values will force usage of the native HLS downloader and + override the corresponding values found in the m3u8 playlist +- is_live: Bypass live HLS detection and manually set live_status - a + value of false will set not_live, any other value (or no value) will + set is_live +- impersonate: Target(s) to try and impersonate with the initial + webpage request; e.g. generic:impersonate=safari,chrome-110. Use + generic:impersonate to impersonate any available target, and use + generic:impersonate=false to disable impersonation (default) + +vikichannel + +- video_types: Types of videos to download - one or more of episodes, + movies, clips, trailers + +youtubewebarchive + +- check_all: Try to check more at the cost of more requests. One or + more of thumbnails, captures + +gamejolt + +- comment_sort: hot (default), you (cookies needed), top, new - choose + comment sorting mode (on GameJolt's side) + +hotstar + +- res: resolution to ignore - one or more of sd, hd, fhd +- vcodec: vcodec to ignore - one or more of h264, h265, dvh265 +- dr: dynamic range to ignore - one or more of sdr, hdr10, dv + +instagram + +- app_id: The value of the X-IG-App-ID header used for API requests. + Default is the web app ID, 936619743392459 + +niconicochannelplus + +- max_comments: Maximum number of comments to extract - default is 120 + +tiktok + +- api_hostname: Hostname to use for mobile API calls, e.g. + api22-normal-c-alisg.tiktokv.com +- app_name: Default app name to use with mobile API calls, e.g. trill +- app_version: Default app version to use with mobile API calls - + should be set along with manifest_app_version, e.g. 34.1.2 +- manifest_app_version: Default numeric app version to use with mobile + API calls, e.g. 2023401020 +- aid: Default app ID to use with mobile API calls, e.g. 1180 +- app_info: Enable mobile API extraction with one or more app info + strings in the format of + /[app_name]/[app_version]/[manifest_app_version]/[aid], where + iid is the unique app install ID. iid is the only required value; + all other values and their / separators can be omitted, e.g. + tiktok:app_info=1234567890123456789 or + tiktok:app_info=123,456/trill///1180,789//34.0.1/340001 +- device_id: Enable mobile API extraction with a genuine device ID to + be used with mobile API calls. Default is a random 19-digit string + +rokfinchannel + +- tab: Which tab to download - one of new, top, videos, podcasts, + streams, stacks + +twitter + +- api: Select one of graphql (default), legacy or syndication as the + API for tweet extraction. Has no effect if logged in + +stacommu, wrestleuniverse + +- device_id: UUID value assigned by the website and used to enforce + device limits for paid livestream content. Can be found in browser + local storage + +twitch + +- client_id: Client ID value to be sent with GraphQL requests, e.g. + twitch:client_id=kimne78kx3ncx6brgo4mv6wki5h1ko + +nhkradirulive (NHK らじる★らじる LIVE) + +- area: Which regional variation to extract. Valid areas are: sapporo, + sendai, tokyo, nagoya, osaka, hiroshima, matsuyama, fukuoka. + Defaults to tokyo + +nflplusreplay + +- type: Type(s) of game replays to extract. Valid types are: + full_game, full_game_spanish, condensed_game and all_22. You can use + all to extract all available replay types, which is the default + +jiocinema + +- refresh_token: The refreshToken UUID from browser local storage can + be passed to extend the life of your login session when logging in + with token as username and the accessToken from browser local + storage as password + +jiosaavn + +- bitrate: Audio bitrates to request. One or more of 16, 32, 64, 128, + 320. Default is 128,320 + +afreecatvlive + +- cdn: One or more CDN IDs to use with the API call for stream URLs, + e.g. gcp_cdn, gs_cdn_pc_app, gs_cdn_mobile_web, gs_cdn_pc_web + +soundcloud + +- formats: Formats to request from the API. Requested values should be + in the format of {protocol}_{codec}, e.g. hls_opus,http_aac. The * + character functions as a wildcard, e.g. *_mp3, and can be passed by + itself to request all formats. Known protocols include http, hls and + hls-aes; known codecs include aac, opus and mp3. Original download + formats are always extracted. Default is + http_aac,hls_aac,http_opus,hls_opus,http_mp3,hls_mp3 + +orfon (orf:on) + +- prefer_segments_playlist: Prefer a playlist of program segments + instead of a single complete video when available. If individual + segments are desired, use + --concat-playlist never --extractor-args "orfon:prefer_segments_playlist" + +bilibili + +- prefer_multi_flv: Prefer extracting flv formats over mp4 for older + videos that still provide legacy formats + +sonylivseries + +- sort_order: Episode sort order for series extraction - one of asc + (ascending, oldest first) or desc (descending, newest first). + Default is asc + +tver + +- backend: Backend API to use for extraction - one of streaks + (default) or brightcove (deprecated) + +Note: These options may be changed/removed in the future without concern +for backward compatibility + +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 can be of 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 built-in extractors. - Postprocessor plugins can be +invoked using --use-postprocessor NAME. + +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 + postprocessor/ + myplugin.py + +yt-dlp looks for these yt_dlp_plugins namespace folders in many +locations (see below) and loads in plugins from all of them. Set the +environment variable YTDLP_NO_PLUGINS to something nonempty to disable +loading plugins entirely. + +See the wiki for some known plugins + +Installing Plugins + +Plugins can be installed using various methods and locations. + +1. Configuration directories: Plugin packages (containing a + yt_dlp_plugins namespace folder) can be dropped into the following + standard configuration locations: + - User Plugins + - ${XDG_CONFIG_HOME}/yt-dlp/plugins//yt_dlp_plugins/ + (recommended on Linux/macOS) + - ${XDG_CONFIG_HOME}/yt-dlp-plugins//yt_dlp_plugins/ + - ${APPDATA}/yt-dlp/plugins//yt_dlp_plugins/ + (recommended on Windows) + - ${APPDATA}/yt-dlp-plugins//yt_dlp_plugins/ + - ~/.yt-dlp/plugins//yt_dlp_plugins/ + - ~/yt-dlp-plugins//yt_dlp_plugins/ + - System Plugins + - /etc/yt-dlp/plugins//yt_dlp_plugins/ + - /etc/yt-dlp-plugins//yt_dlp_plugins/ +2. Executable location: Plugin packages can similarly be installed in a + yt-dlp-plugins directory under the executable location (recommended + for portable installations): + - Binary: where /yt-dlp.exe, + /yt-dlp-plugins//yt_dlp_plugins/ + - Source: where /yt_dlp/__main__.py, + /yt-dlp-plugins//yt_dlp_plugins/ +3. pip and other locations in PYTHONPATH + - Plugin packages can be installed and managed using pip. See + yt-dlp-sample-plugins for an example. + - Note: plugin files between plugin packages installed with + pip must have unique filenames. + - Any path in PYTHONPATH is searched in for the yt_dlp_plugins + namespace folder. + - Note: This does not apply for Pyinstaller builds. + +.zip, .egg and .whl archives containing a yt_dlp_plugins namespace +folder in their root are also supported as plugin packages. + +- e.g. ${XDG_CONFIG_HOME}/yt-dlp/plugins/mypluginpkg.zip where + mypluginpkg.zip contains yt_dlp_plugins//myplugin.py + +Run yt-dlp with --verbose to check if the plugin has been loaded. + +Developing Plugins + +See the yt-dlp-sample-plugins repo for a template plugin package and the +Plugin Development section of the wiki for a plugin development guide. + +All public classes with a name ending in IE/PP are imported from each +file for extractors and postprocessors respectively. This respects +underscore prefix (e.g. _MyBasePluginIE is private) and __all__. Modules +can similarly be excluded by prefixing the module name with an +underscore (e.g. _myplugin.py). + +To replace an existing extractor with a subclass of one, set the +plugin_name class keyword argument (e.g. +class MyPluginIE(ABuiltInIE, plugin_name='myplugin') will replace +ABuiltInIE with MyPluginIE). Since the extractor replaces the parent, +you should exclude the subclass extractor from being imported separately +by making it private using one of the methods described above. + +If you are a plugin author, add yt-dlp-plugins as a topic to your +repository for discoverability. + +See the Developer Instructions on how to write and test an extractor. + +EMBEDDING YT-DLP + +yt-dlp 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 yt_dlp 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 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 to translate any CLI switches to YoutubeDL +params. + +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 + +Embedding examples + +Extracting information + + import json + import yt_dlp + + URL = 'https://www.youtube.com/watch?v=BaW_jenozKc' + + # ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions + ydl_opts = {} + with yt_dlp.YoutubeDL(ydl_opts) as ydl: + info = ydl.extract_info(URL, download=False) + + # ℹ️ ydl.sanitize_info makes the info json-serializable + print(json.dumps(ydl.sanitize_info(info))) + +Download using an info-json + + import yt_dlp + + INFO_FILE = 'path/to/video.info.json' + + with yt_dlp.YoutubeDL() as ydl: + error_code = ydl.download_with_info_file(INFO_FILE) + + print('Some videos failed to download' if error_code + else 'All videos successfully downloaded') + +Extract audio + + import yt_dlp + + 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 + 'postprocessors': [{ # Extract audio using ffmpeg + 'key': 'FFmpegExtractAudio', + 'preferredcodec': 'm4a', + }] + } + + with yt_dlp.YoutubeDL(ydl_opts) as ydl: + error_code = ydl.download(URLS) + +Filter videos + + import yt_dlp + + URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] + + def longer_than_a_minute(info, *, incomplete): + """Download only videos longer than a minute (or with unknown duration)""" + duration = info.get('duration') + if duration and duration < 60: + return 'The video is too short' + + ydl_opts = { + 'match_filter': longer_than_a_minute, + } + + with yt_dlp.YoutubeDL(ydl_opts) as ydl: + error_code = ydl.download(URLS) + +Adding logger and progress hook + + import yt_dlp + + URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] + + class MyLogger: + def debug(self, msg): + # For compatibility with youtube-dl, both debug and info are passed into debug + # You can distinguish them by the prefix '[debug] ' + if msg.startswith('[debug] '): + pass + else: + self.info(msg) + + def info(self, msg): + pass + + def warning(self, msg): + pass + + def error(self, msg): + print(msg) + + + # ℹ️ See "progress_hooks" in help(yt_dlp.YoutubeDL) + def my_hook(d): + if d['status'] == 'finished': + print('Done downloading, now post-processing ...') + + + ydl_opts = { + 'logger': MyLogger(), + 'progress_hooks': [my_hook], + } + + with yt_dlp.YoutubeDL(ydl_opts) as ydl: + ydl.download(URLS) + +Add a custom PostProcessor + + import yt_dlp + + URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] + + # ℹ️ See help(yt_dlp.postprocessor.PostProcessor) + class MyCustomPP(yt_dlp.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 + ydl.add_post_processor(MyCustomPP(), when='pre_process') + ydl.download(URLS) + +Use a custom format selector + + import yt_dlp + + URLS = ['https://www.youtube.com/watch?v=BaW_jenozKc'] + + def format_selector(ctx): + """ Select the best video and the best audio that won't result in an mkv. + NOTE: This is just an example and does not handle all cases """ + + # formats are already sorted worst to best + formats = ctx.get('formats')[::-1] + + # acodec='none' means there is no audio + best_video = next(f for f in formats + if f['vcodec'] != 'none' and f['acodec'] == 'none') + + # find compatible audio extension + audio_ext = {'mp4': 'm4a', 'webm': 'webm'}[best_video['ext']] + # vcodec='none' means there is no video + best_audio = next(f for f in formats if ( + f['acodec'] != 'none' and f['vcodec'] == 'none' and f['ext'] == audio_ext)) + + # These are the minimum required fields for a merged format + yield { + 'format_id': f'{best_video["format_id"]}+{best_audio["format_id"]}', + 'ext': best_video['ext'], + 'requested_formats': [best_video, best_audio], + # Must be + separated list of protocols + 'protocol': f'{best_video["protocol"]}+{best_audio["protocol"]}' + } + + + ydl_opts = { + 'format': format_selector, + } + + with yt_dlp.YoutubeDL(ydl_opts) as ydl: + ydl.download(URLS) + +CHANGES FROM YOUTUBE-DL + +New features + +- Forked from yt-dlc@f9401f2 and merged with youtube-dl@a08f2b7 + (exceptions) + +- SponsorBlock Integration: You can mark/remove sponsor sections in + YouTube videos by utilizing the SponsorBlock API + +- Format Sorting: 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) + +- 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. See #31 for + details. + +- YouTube improvements: + + - Supports Clips, Stories (ytstories:), Search + (including filters)*, YouTube Music Search, Channel-specific + search, Search prefixes (ytsearch:, ytsearchdate:)*, Mixes, and + Feeds (:ytfav, :ytwatchlater, :ytsubs, :ythistory, :ytrec, + :ytnotif) + - Fix for n-sig based throttling * + - Download livestreams from the start using --live-from-start + (experimental) + - Channel URLs download all uploads of the channel, including + shorts and live + - Support for logging in with OAuth + +- 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 + +- Split video by chapters: Videos can be split into multiple files + based on chapters using --split-chapters + +- 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 + +- 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 + +- New MSOs: Philo, Spectrum, SlingTV, Cablevision, RCN etc. + +- Subtitle extraction from manifests: Subtitles can be extracted from + streaming media manifests. See commit/be6202f for details + +- Multiple paths and output templates: You can give different output + templates and download paths for different types of files. You can + also set a temporary path where intermediary files are downloaded to + using --paths (-P) + +- Portable Configuration: Configuration files are automatically loaded + from the home and root directories. See CONFIGURATION for details + +- Output template improvements: Output templates can now have + date-time formatting, numeric offsets, object traversal etc. See + 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-filters etc + +- Improvements: Regex and other operators in --format/--match-filters, + multiple --postprocessor-args and --downloader-args, faster archive + checking, more format selection options, merge multi-video/audio, + multiple --config-locations, --exec at different stages, etc + +- Plugins: Extractors and PostProcessors can be loaded from an + external file. See plugins for details + +- Self updater: The releases can be updated using yt-dlp -U, and + downgraded using --update-to if required + +- Automated builds: Nightly/master builds can be used with + --update-to nightly and --update-to master + +See changelog or commits for the full list of changes + +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: + +- yt-dlp supports only Python 3.9+, and will 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 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 for a list of correct locations +- The default 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 +- The default format sorting 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. Older versions of yt-dlp preferred VP9 due to its + broader compatibility; you can use --compat-options prefer-vp9-sort + to revert to that format sorting preference. These two compat + options cannot be used together +- 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 +- 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 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. +- 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 +- 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-filters 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 +- yt-dlp versions between 2021.11.10 and 2023.06.21 estimated + filesize_approx values for fragmented/manifest formats. This was + added for convenience in f2fe69, but was reverted in 0dff8e due to + the potentially extreme inaccuracy of the estimated values. Use + --compat-options manifest-filesize-approx to keep extracting the + estimated values +- yt-dlp uses modern http client backends such as requests. Use + --compat-options prefer-legacy-http-handler to prefer the legacy + http handler (urllib) to be used for standard http requests. +- The sub-modules swfinterp, casefold are removed. +- Passing --simulate (or calling extract_info with download=False) no + longer alters the default format selection. See #9843 for details. + +For ease of use, a few more compat options are available: + +- --compat-options all: Use all compat options (Do NOT use this!) +- --compat-options youtube-dl: Same as + --compat-options all,-multistreams,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort +- --compat-options youtube-dlc: Same as + --compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort +- --compat-options 2021: Same as + --compat-options 2022,no-certifi,filename-sanitization +- --compat-options 2022: Same as + --compat-options 2023,playlist-match-filter,no-external-downloader-progress,prefer-legacy-http-handler,manifest-filesize-approx +- --compat-options 2023: Same as --compat-options 2024,prefer-vp9-sort +- --compat-options 2024: Currently does nothing. Use this to enable + all future compat options + +The following compat options restore vulnerable behavior from before +security patches: + +- --compat-options allow-unsafe-ext: Allow files with any extension + (including unsafe ones) to be downloaded (GHSA-79w7-vh3h-8g4j) + + :warning: Only use if a valid file download is rejected because + its extension is detected as uncommon + + This option can enable remote code execution! Consider opening an + issue instead! + +Deprecated options + +These are all the deprecated options and the current alternative to +achieve the same effect + +Almost redundant options + +While these options are almost the same as their new counterparts, there +are some differences that prevents them being redundant + + -j, --dump-json --print "%()j" + -F, --list-formats --print formats_table + --list-thumbnails --print thumbnails_table --print playlist:thumbnails_table + --list-subs --print automatic_captions_table --print subtitles_table + +Redundant options + +While these options are redundant, they are still expected to be used +due to their ease of use + + --get-description --print description + --get-duration --print duration_string + --get-filename --print filename + --get-format --print format + --get-id --print id + --get-thumbnail --print thumbnail + -e, --get-title --print title + -g, --get-url --print urls + --match-title REGEX --match-filters "title ~= (?i)REGEX" + --reject-title REGEX --match-filters "title !~= (?i)REGEX" + --min-views COUNT --match-filters "view_count >=? COUNT" + --max-views COUNT --match-filters "view_count <=? COUNT" + --break-on-reject Use --break-match-filters + --user-agent UA --add-headers "User-Agent:UA" + --referer URL --add-headers "Referer:URL" + --playlist-start NUMBER -I NUMBER: + --playlist-end NUMBER -I :NUMBER + --playlist-reverse -I ::-1 + --no-playlist-reverse Default + --no-colors --color no_color + +Not recommended + +While these options still work, their use is not recommended since there +are other alternatives to achieve the same + + --force-generic-extractor --ies generic,default + --exec-before-download CMD --exec "before_dl:CMD" + --no-exec-before-download --no-exec + --all-formats -f all + --all-subs --sub-langs all --write-subs + --print-json -j --no-simulate + --autonumber-size NUMBER Use string formatting, e.g. %(autonumber)03d + --autonumber-start NUMBER Use internal field formatting like %(autonumber+NUMBER)s + --id -o "%(id)s.%(ext)s" + --metadata-from-title FORMAT --parse-metadata "%(title)s:FORMAT" + --hls-prefer-native --downloader "m3u8:native" + --hls-prefer-ffmpeg --downloader "m3u8:ffmpeg" + --list-formats-old --compat-options list-formats (Alias: --no-list-formats-as-table) + --list-formats-as-table --compat-options -list-formats [Default] (Alias: --no-list-formats-old) + --youtube-skip-dash-manifest --extractor-args "youtube:skip=dash" (Alias: --no-youtube-include-dash-manifest) + --youtube-skip-hls-manifest --extractor-args "youtube:skip=hls" (Alias: --no-youtube-include-hls-manifest) + --youtube-include-dash-manifest Default (Alias: --no-youtube-skip-dash-manifest) + --youtube-include-hls-manifest Default (Alias: --no-youtube-skip-hls-manifest) + --geo-bypass --xff "default" + --no-geo-bypass --xff "never" + --geo-bypass-country CODE --xff CODE + --geo-bypass-ip-block IP_BLOCK --xff IP_BLOCK + +Developer options + +These options are not intended to be used by the end-user + + --test Download only part of video for testing extractors + --load-pages Load pages dumped by --write-pages + --youtube-print-sig-code For testing youtube signatures + --allow-unplayable-formats List unplayable formats also + --no-allow-unplayable-formats Default + +Old aliases + +These are aliases that are no longer documented for various reasons + + --avconv-location --ffmpeg-location + --clean-infojson --clean-info-json + --cn-verification-proxy URL --geo-verification-proxy URL + --dump-headers --print-traffic + --dump-intermediate-pages --dump-pages + --force-write-download-archive --force-write-archive + --load-info --load-info-json + --no-clean-infojson --no-clean-info-json + --no-split-tracks --no-split-chapters + --no-write-srt --no-write-subs + --prefer-unsecure --prefer-insecure + --rate-limit RATE --limit-rate RATE + --split-tracks --split-chapters + --srt-lang LANGS --sub-langs LANGS + --trim-file-names LENGTH --trim-filenames LENGTH + --write-srt --write-subs + --yes-overwrites --force-overwrites + +Sponskrub Options + +Support for SponSkrub has been deprecated in favor of the --sponsorblock +options + + --sponskrub --sponsorblock-mark all + --no-sponskrub --no-sponsorblock + --sponskrub-cut --sponsorblock-remove all + --no-sponskrub-cut --sponsorblock-remove -all + --sponskrub-force Not applicable + --no-sponskrub-force Not applicable + --sponskrub-location Not applicable + --sponskrub-args Not applicable + +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-ffmpeg Default (Alias: --no-prefer-avconv) + -C, --call-home Not implemented + --no-call-home Default + --include-ads No longer supported + --no-include-ads Default + --write-annotations No supported site has annotations now + --no-write-annotations Default + --compat-options seperate-video-versions No longer needed + --compat-options no-youtube-prefer-utc-upload-date No longer supported + +Removed + +These options were deprecated since 2014 and have now been entirely +removed + + -A, --auto-number -o "%(autonumber)s-%(id)s.%(ext)s" + -t, -l, --title, --literal -o "%(title)s-%(id)s.%(ext)s" + +CONTRIBUTING + +See CONTRIBUTING.md for instructions on Opening an Issue and +Contributing code to the project + +WIKI + +See the Wiki for more information diff --git a/.venv/share/fish/vendor_completions.d/yt-dlp.fish b/.venv/share/fish/vendor_completions.d/yt-dlp.fish new file mode 100644 index 0000000000000000000000000000000000000000..ab79ab33282408a3a8fad2baca6750f9fd6d2417 --- /dev/null +++ b/.venv/share/fish/vendor_completions.d/yt-dlp.fish @@ -0,0 +1,315 @@ + +complete --command yt-dlp --long-option help --short-option h --description 'Print this help text and exit' +complete --command yt-dlp --long-option version --description 'Print program version and exit' +complete --command yt-dlp --long-option update --short-option U --description 'Check if updates are available. You installed yt-dlp from a manual build or with a package manager; Use that to update' +complete --command yt-dlp --long-option no-update --description 'Do not check for updates (default)' +complete --command yt-dlp --long-option update-to --description '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, master' +complete --command yt-dlp --long-option ignore-errors --short-option i --description 'Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails' +complete --command yt-dlp --long-option no-abort-on-error --description 'Continue with next video on download errors; e.g. to skip unavailable videos in a playlist (default)' +complete --command yt-dlp --long-option abort-on-error --description 'Abort downloading of further videos if an error occurs (Alias: --no-ignore-errors)' +complete --command yt-dlp --long-option dump-user-agent --description 'Display the current user-agent and exit' +complete --command yt-dlp --long-option list-extractors --description 'List all supported extractors and exit' +complete --command yt-dlp --long-option extractor-descriptions --description 'Output descriptions of all supported extractors and exit' +complete --command yt-dlp --long-option use-extractors --description '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)' +complete --command yt-dlp --long-option force-generic-extractor +complete --command yt-dlp --long-option default-search --description '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' +complete --command yt-dlp --long-option ignore-config --description 'Don'"'"'t load any more configuration files except those given to --config-locations. For backward compatibility, if this option is found inside the system configuration file, the user configuration is not loaded. (Alias: --no-config)' +complete --command yt-dlp --long-option no-config-locations --description 'Do not load any custom configuration files (default). When given inside a configuration file, ignore all previous --config-locations defined in the current file' +complete --command yt-dlp --long-option config-locations --description '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' +complete --command yt-dlp --long-option plugin-dirs --description 'Path to an additional directory to search for plugins. This option can be used multiple times to add multiple directories. Use "default" to search the default plugin directories (default)' +complete --command yt-dlp --long-option no-plugin-dirs --description 'Clear plugin directories to search, including defaults and those provided by previous --plugin-dirs' +complete --command yt-dlp --long-option flat-playlist --description 'Do not extract a playlist'"'"'s URL result entries; some entry metadata may be missing and downloading may be bypassed' +complete --command yt-dlp --long-option no-flat-playlist --description 'Fully extract the videos of a playlist (default)' +complete --command yt-dlp --long-option live-from-start --description 'Download livestreams from the start. Currently only supported for YouTube (Experimental)' +complete --command yt-dlp --long-option no-live-from-start --description 'Download livestreams from the current time (default)' +complete --command yt-dlp --long-option wait-for-video --description 'Wait for scheduled streams to become available. Pass the minimum number of seconds (or range) to wait between retries' +complete --command yt-dlp --long-option no-wait-for-video --description 'Do not wait for scheduled streams (default)' +complete --command yt-dlp --long-option mark-watched --description 'Mark videos watched (even with --simulate)' +complete --command yt-dlp --long-option no-mark-watched --description 'Do not mark videos watched (default)' +complete --command yt-dlp --long-option no-colors +complete --command yt-dlp --long-option color --description '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). Use "auto-tty" or "no_color-tty" to decide based on terminal support only. Can be used multiple times' +complete --command yt-dlp --long-option compat-options --description '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' +complete --command yt-dlp --long-option alias --description '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' +complete --command yt-dlp --long-option preset-alias --short-option t --description 'Applies a predefined set of options. e.g. --preset-alias mp3. The following presets are available: mp3, aac, mp4, mkv, sleep. See the "Preset Aliases" section at the end for more info. This option can be used multiple times' +complete --command yt-dlp --long-option proxy --description 'Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme, e.g. socks5://user:pass@127.0.0.1:1080/. Pass in an empty string (--proxy "") for direct connection' +complete --command yt-dlp --long-option socket-timeout --description 'Time to wait before giving up, in seconds' +complete --command yt-dlp --long-option source-address --description 'Client-side IP address to bind to' +complete --command yt-dlp --long-option impersonate --description 'Client to impersonate for requests. E.g. chrome, chrome-110, chrome:windows-10. Pass --impersonate="" to impersonate any client. Note that forcing impersonation for all requests may have a detrimental impact on download speed and stability' +complete --command yt-dlp --long-option list-impersonate-targets --description 'List available clients to impersonate.' +complete --command yt-dlp --long-option force-ipv4 --short-option 4 --description 'Make all connections via IPv4' +complete --command yt-dlp --long-option force-ipv6 --short-option 6 --description 'Make all connections via IPv6' +complete --command yt-dlp --long-option enable-file-urls --description 'Enable file:// URLs. This is disabled by default for security reasons.' +complete --command yt-dlp --long-option geo-verification-proxy --description '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 downloading' +complete --command yt-dlp --long-option cn-verification-proxy +complete --command yt-dlp --long-option xff --description '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' +complete --command yt-dlp --long-option geo-bypass +complete --command yt-dlp --long-option no-geo-bypass +complete --command yt-dlp --long-option geo-bypass-country +complete --command yt-dlp --long-option geo-bypass-ip-block +complete --command yt-dlp --long-option playlist-start +complete --command yt-dlp --long-option playlist-end +complete --command yt-dlp --long-option playlist-items --short-option I --description '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 playlist of size 15 will download the items at index 1,2,3,7,11,13,15' +complete --command yt-dlp --long-option match-title +complete --command yt-dlp --long-option reject-title +complete --command yt-dlp --long-option min-filesize --description 'Abort download if filesize is smaller than SIZE, e.g. 50k or 44.6M' +complete --command yt-dlp --long-option max-filesize --description 'Abort download if filesize is larger than SIZE, e.g. 50k or 44.6M' +complete --command yt-dlp --long-option date --description 'Download only videos uploaded on this date. 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' +complete --command yt-dlp --long-option datebefore --description 'Download only videos uploaded on or before this date. The date formats accepted are the same as --date' +complete --command yt-dlp --long-option dateafter --description 'Download only videos uploaded on or after this date. The date formats accepted are the same as --date' +complete --command yt-dlp --long-option min-views +complete --command yt-dlp --long-option max-views +complete --command yt-dlp --long-option match-filters --description '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 at least one of the conditions is met. E.g. --match-filters !is_live --match-filters "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-filters -" to interactively ask whether to download each video' +complete --command yt-dlp --long-option no-match-filters --description 'Do not use any --match-filters (default)' +complete --command yt-dlp --long-option break-match-filters --description 'Same as "--match-filters" but stops the download process when a video is rejected' +complete --command yt-dlp --long-option no-break-match-filters --description 'Do not use any --break-match-filters (default)' +complete --command yt-dlp --long-option no-playlist --description 'Download only the video, if the URL refers to a video and a playlist' +complete --command yt-dlp --long-option yes-playlist --description 'Download the playlist, if the URL refers to a video and a playlist' +complete --command yt-dlp --long-option age-limit --description 'Download only videos suitable for the given age' +complete --command yt-dlp --long-option download-archive --description 'Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it' --require-parameter +complete --command yt-dlp --long-option no-download-archive --description 'Do not use archive file (default)' +complete --command yt-dlp --long-option max-downloads --description 'Abort after downloading NUMBER files' +complete --command yt-dlp --long-option break-on-existing --description 'Stop the download process when encountering a file that is in the archive supplied with the --download-archive option' +complete --command yt-dlp --long-option no-break-on-existing --description 'Do not stop the download process when encountering a file that is in the archive (default)' +complete --command yt-dlp --long-option break-on-reject +complete --command yt-dlp --long-option break-per-input --description 'Alters --max-downloads, --break-on-existing, --break-match-filters, and autonumber to reset per input URL' +complete --command yt-dlp --long-option no-break-per-input --description '--break-on-existing and similar options terminates the entire download queue' +complete --command yt-dlp --long-option skip-playlist-after-errors --description 'Number of allowed failures until the rest of the playlist is skipped' +complete --command yt-dlp --long-option include-ads +complete --command yt-dlp --long-option no-include-ads +complete --command yt-dlp --long-option concurrent-fragments --short-option N --description 'Number of fragments of a dash/hlsnative video that should be downloaded concurrently (default is %default)' +complete --command yt-dlp --long-option limit-rate --short-option r --description 'Maximum download rate in bytes per second, e.g. 50K or 4.2M' +complete --command yt-dlp --long-option throttled-rate --description 'Minimum download rate in bytes per second below which throttling is assumed and the video data is re-extracted, e.g. 100K' +complete --command yt-dlp --long-option retries --short-option R --description 'Number of retries (default is %default), or "infinite"' +complete --command yt-dlp --long-option file-access-retries --description 'Number of times to retry on file access error (default is %default), or "infinite"' +complete --command yt-dlp --long-option fragment-retries --description 'Number of retries for a fragment (default is %default), or "infinite" (DASH, hlsnative and ISM)' +complete --command yt-dlp --long-option retry-sleep --description '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' +complete --command yt-dlp --long-option skip-unavailable-fragments --description 'Skip unavailable fragments for DASH, hlsnative and ISM downloads (default) (Alias: --no-abort-on-unavailable-fragments)' +complete --command yt-dlp --long-option abort-on-unavailable-fragments --description 'Abort download if a fragment is unavailable (Alias: --no-skip-unavailable-fragments)' +complete --command yt-dlp --long-option keep-fragments --description 'Keep downloaded fragments on disk after downloading is finished' +complete --command yt-dlp --long-option no-keep-fragments --description 'Delete downloaded fragments after downloading is finished (default)' +complete --command yt-dlp --long-option buffer-size --description 'Size of download buffer, e.g. 1024 or 16K (default is %default)' +complete --command yt-dlp --long-option resize-buffer --description 'The buffer size is automatically resized from an initial value of --buffer-size (default)' +complete --command yt-dlp --long-option no-resize-buffer --description 'Do not automatically adjust the buffer size' +complete --command yt-dlp --long-option http-chunk-size --description '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 (experimental)' +complete --command yt-dlp --long-option test +complete --command yt-dlp --long-option playlist-reverse +complete --command yt-dlp --long-option no-playlist-reverse +complete --command yt-dlp --long-option playlist-random --description 'Download playlist videos in random order' +complete --command yt-dlp --long-option lazy-playlist --description 'Process entries in the playlist as they are received. This disables n_entries, --playlist-random and --playlist-reverse' +complete --command yt-dlp --long-option no-lazy-playlist --description 'Process videos in the playlist only after the entire playlist is parsed (default)' +complete --command yt-dlp --long-option xattr-set-filesize --description 'Set file xattribute ytdl.filesize with expected file size' +complete --command yt-dlp --long-option hls-prefer-native +complete --command yt-dlp --long-option hls-prefer-ffmpeg +complete --command yt-dlp --long-option hls-use-mpegts --description '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' +complete --command yt-dlp --long-option no-hls-use-mpegts --description 'Do not use the mpegts container for HLS videos. This is default when not downloading live streams' +complete --command yt-dlp --long-option download-sections --description '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"' +complete --command yt-dlp --long-option downloader --description 'Name or path of the external downloader to use (optionally) prefixed by the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. Currently supports native, aria2c, avconv, axel, curl, ffmpeg, httpie, wget. You can use this option multiple times to set different downloaders for different protocols. E.g. --downloader aria2c --downloader "dash,m3u8:native" will use aria2c for http/ftp downloads, and the native downloader for dash/m3u8 downloads (Alias: --external-downloader)' +complete --command yt-dlp --long-option downloader-args --description 'Give these arguments to the external downloader. Specify the downloader name and the arguments separated by a colon ":". For ffmpeg, arguments can be passed to different positions using the same syntax as --postprocessor-args. You can use this option multiple times to give different arguments to different downloaders (Alias: --external-downloader-args)' +complete --command yt-dlp --long-option batch-file --short-option a --description 'File containing URLs to download ("-" for stdin), one URL per line. Lines starting with "#", ";" or "]" are considered as comments and ignored' --require-parameter +complete --command yt-dlp --long-option no-batch-file --description 'Do not read URLs from batch file (default)' +complete --command yt-dlp --long-option id +complete --command yt-dlp --long-option paths --short-option P --description 'The paths where the files should be downloaded. Specify the type of file and the path separated by a colon ":". All the same TYPES as --output are supported. Additionally, you can also provide "home" (default) and "temp" paths. All intermediary files are first downloaded to the temp path and then the final files are moved over to the home path after download is finished. This option is ignored if --output is an absolute path' +complete --command yt-dlp --long-option output --short-option o --description 'Output filename template; see "OUTPUT TEMPLATE" for details' +complete --command yt-dlp --long-option output-na-placeholder --description 'Placeholder for unavailable fields in --output (default: "%default")' +complete --command yt-dlp --long-option autonumber-size +complete --command yt-dlp --long-option autonumber-start +complete --command yt-dlp --long-option restrict-filenames --description 'Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames' +complete --command yt-dlp --long-option no-restrict-filenames --description 'Allow Unicode characters, "&" and spaces in filenames (default)' +complete --command yt-dlp --long-option windows-filenames --description 'Force filenames to be Windows-compatible' +complete --command yt-dlp --long-option no-windows-filenames --description 'Sanitize filenames only minimally' +complete --command yt-dlp --long-option trim-filenames --description 'Limit the filename length (excluding extension) to the specified number of characters' +complete --command yt-dlp --long-option no-overwrites --short-option w --description 'Do not overwrite any files' +complete --command yt-dlp --long-option force-overwrites --description 'Overwrite all video and metadata files. This option includes --no-continue' +complete --command yt-dlp --long-option no-force-overwrites --description 'Do not overwrite the video, but overwrite related files (default)' +complete --command yt-dlp --long-option continue --short-option c --description 'Resume partially downloaded files/fragments (default)' +complete --command yt-dlp --long-option no-continue --description 'Do not resume partially downloaded fragments. If the file is not fragmented, restart download of the entire file' +complete --command yt-dlp --long-option part --description 'Use .part files instead of writing directly into output file (default)' +complete --command yt-dlp --long-option no-part --description 'Do not use .part files - write directly into output file' +complete --command yt-dlp --long-option mtime --description 'Use the Last-modified header to set the file modification time (default)' +complete --command yt-dlp --long-option no-mtime --description 'Do not use the Last-modified header to set the file modification time' +complete --command yt-dlp --long-option write-description --description 'Write video description to a .description file' +complete --command yt-dlp --long-option no-write-description --description 'Do not write video description (default)' +complete --command yt-dlp --long-option write-info-json --description 'Write video metadata to a .info.json file (this may contain personal information)' +complete --command yt-dlp --long-option no-write-info-json --description 'Do not write video metadata (default)' +complete --command yt-dlp --long-option write-annotations +complete --command yt-dlp --long-option no-write-annotations +complete --command yt-dlp --long-option write-playlist-metafiles --description 'Write playlist metadata in addition to the video metadata when using --write-info-json, --write-description etc. (default)' +complete --command yt-dlp --long-option no-write-playlist-metafiles --description 'Do not write playlist metadata when using --write-info-json, --write-description etc.' +complete --command yt-dlp --long-option clean-info-json --description 'Remove some internal metadata such as filenames from the infojson (default)' +complete --command yt-dlp --long-option no-clean-info-json --description 'Write all fields to the infojson' +complete --command yt-dlp --long-option write-comments --description 'Retrieve video comments to be placed in the infojson. The comments are fetched even without this option if the extraction is known to be quick (Alias: --get-comments)' +complete --command yt-dlp --long-option no-write-comments --description 'Do not retrieve video comments unless the extraction is known to be quick (Alias: --no-get-comments)' +complete --command yt-dlp --long-option load-info-json --description 'JSON file containing the video information (created with the "--write-info-json" option)' +complete --command yt-dlp --long-option cookies --description 'Netscape formatted file to read cookies from and dump cookie jar in' --require-parameter +complete --command yt-dlp --long-option no-cookies --description 'Do not read/dump cookies from/to file (default)' +complete --command yt-dlp --long-option cookies-from-browser --description 'The name of the browser to load cookies from. Currently supported browsers are: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale. Optionally, the KEYRING used for decrypting Chromium cookies on Linux, the name/path of the PROFILE to load cookies from, and the CONTAINER name (if Firefox) ("none" for no container) can be given with their respective separators. By default, all containers of the most recently accessed profile are used. Currently supported keyrings are: basictext, gnomekeyring, kwallet, kwallet5, kwallet6' +complete --command yt-dlp --long-option no-cookies-from-browser --description 'Do not load cookies from browser (default)' +complete --command yt-dlp --long-option cache-dir --description 'Location in the filesystem where yt-dlp can store some downloaded information (such as client ids and signatures) permanently. By default ${XDG_CACHE_HOME}/yt-dlp' +complete --command yt-dlp --long-option no-cache-dir --description 'Disable filesystem caching' +complete --command yt-dlp --long-option rm-cache-dir --description 'Delete all filesystem cache files' +complete --command yt-dlp --long-option write-thumbnail --description 'Write thumbnail image to disk' +complete --command yt-dlp --long-option no-write-thumbnail --description 'Do not write thumbnail image to disk (default)' +complete --command yt-dlp --long-option write-all-thumbnails --description 'Write all thumbnail image formats to disk' +complete --command yt-dlp --long-option list-thumbnails --description 'List available thumbnails of each video. Simulate unless --no-simulate is used' +complete --command yt-dlp --long-option write-link --description 'Write an internet shortcut file, depending on the current platform (.url, .webloc or .desktop). The URL may be cached by the OS' +complete --command yt-dlp --long-option write-url-link --description 'Write a .url Windows internet shortcut. The OS caches the URL based on the file path' +complete --command yt-dlp --long-option write-webloc-link --description 'Write a .webloc macOS internet shortcut' +complete --command yt-dlp --long-option write-desktop-link --description 'Write a .desktop Linux internet shortcut' +complete --command yt-dlp --long-option quiet --short-option q --description 'Activate quiet mode. If used with --verbose, print the log to stderr' +complete --command yt-dlp --long-option no-quiet --description 'Deactivate quiet mode. (Default)' +complete --command yt-dlp --long-option no-warnings --description 'Ignore warnings' +complete --command yt-dlp --long-option simulate --short-option s --description 'Do not download the video and do not write anything to disk' +complete --command yt-dlp --long-option no-simulate --description 'Download the video even if printing/listing options are used' +complete --command yt-dlp --long-option ignore-no-formats-error --description 'Ignore "No video formats" error. Useful for extracting metadata even if the videos are not actually available for download (experimental)' +complete --command yt-dlp --long-option no-ignore-no-formats-error --description 'Throw error when no downloadable video formats are found (default)' +complete --command yt-dlp --long-option skip-download --description 'Do not download the video but write all related files (Alias: --no-download)' +complete --command yt-dlp --long-option print --short-option O --description 'Field name or output template to print to screen, optionally prefixed with when to print it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: video). Implies --quiet. Implies --simulate unless --no-simulate or later stages of WHEN are used. This option can be used multiple times' +complete --command yt-dlp --long-option print-to-file --description 'Append given template to the file. The values of WHEN and TEMPLATE are the same as that of --print. FILE uses the same syntax as the output template. This option can be used multiple times' +complete --command yt-dlp --long-option get-url --short-option g +complete --command yt-dlp --long-option get-title --short-option e +complete --command yt-dlp --long-option get-id +complete --command yt-dlp --long-option get-thumbnail +complete --command yt-dlp --long-option get-description +complete --command yt-dlp --long-option get-duration +complete --command yt-dlp --long-option get-filename +complete --command yt-dlp --long-option get-format +complete --command yt-dlp --long-option dump-json --short-option j --description 'Quiet, but print JSON information for each video. Simulate unless --no-simulate is used. See "OUTPUT TEMPLATE" for a description of available keys' +complete --command yt-dlp --long-option dump-single-json --short-option J --description 'Quiet, but print JSON information for each URL or infojson passed. Simulate unless --no-simulate is used. If the URL refers to a playlist, the whole playlist information is dumped in a single line' +complete --command yt-dlp --long-option print-json +complete --command yt-dlp --long-option force-write-archive --description 'Force download archive entries to be written as far as no errors occur, even if -s or another simulation option is used (Alias: --force-download-archive)' +complete --command yt-dlp --long-option newline --description 'Output progress bar as new lines' +complete --command yt-dlp --long-option no-progress --description 'Do not print progress bar' +complete --command yt-dlp --long-option progress --description 'Show progress bar, even if in quiet mode' +complete --command yt-dlp --long-option console-title --description 'Display progress in console titlebar' +complete --command yt-dlp --long-option progress-template --description 'Template for progress outputs, optionally prefixed with one of "download:" (default), "download-title:" (the console title), "postprocess:", or "postprocess-title:". The video'"'"'s fields are accessible under the "info" key and the progress attributes are accessible under "progress" key. E.g. --console-title --progress-template "download-title:%(info.id)s-%(progress.eta)s"' +complete --command yt-dlp --long-option progress-delta --description 'Time between progress output (default: 0)' +complete --command yt-dlp --long-option verbose --short-option v --description 'Print various debugging information' +complete --command yt-dlp --long-option dump-pages --description 'Print downloaded pages encoded using base64 to debug problems (very verbose)' +complete --command yt-dlp --long-option write-pages --description 'Write downloaded intermediary pages to files in the current directory to debug problems' +complete --command yt-dlp --long-option load-pages +complete --command yt-dlp --long-option youtube-print-sig-code +complete --command yt-dlp --long-option print-traffic --description 'Display sent and read HTTP traffic' +complete --command yt-dlp --long-option call-home --short-option C +complete --command yt-dlp --long-option no-call-home +complete --command yt-dlp --long-option encoding --description 'Force the specified encoding (experimental)' +complete --command yt-dlp --long-option legacy-server-connect --description 'Explicitly allow HTTPS connection to servers that do not support RFC 5746 secure renegotiation' +complete --command yt-dlp --long-option no-check-certificates --description 'Suppress HTTPS certificate validation' +complete --command yt-dlp --long-option prefer-insecure --description 'Use an unencrypted connection to retrieve information about the video (Currently supported only for YouTube)' +complete --command yt-dlp --long-option user-agent +complete --command yt-dlp --long-option referer +complete --command yt-dlp --long-option add-headers --description 'Specify a custom HTTP header and its value, separated by a colon ":". You can use this option multiple times' +complete --command yt-dlp --long-option bidi-workaround --description 'Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH' +complete --command yt-dlp --long-option sleep-requests --description 'Number of seconds to sleep between requests during data extraction' +complete --command yt-dlp --long-option sleep-interval --description 'Number of seconds to sleep before each download. This is the minimum time to sleep when used along with --max-sleep-interval (Alias: --min-sleep-interval)' +complete --command yt-dlp --long-option max-sleep-interval --description 'Maximum number of seconds to sleep. Can only be used along with --min-sleep-interval' +complete --command yt-dlp --long-option sleep-subtitles --description 'Number of seconds to sleep before each subtitle download' +complete --command yt-dlp --long-option format --short-option f --description 'Video format code, see "FORMAT SELECTION" for more details' +complete --command yt-dlp --long-option format-sort --short-option S --description 'Sort the formats by the fields given, see "Sorting Formats" for more details' +complete --command yt-dlp --long-option format-sort-force --description 'Force user specified sort order to have precedence over all fields, see "Sorting Formats" for more details (Alias: --S-force)' +complete --command yt-dlp --long-option no-format-sort-force --description 'Some fields have precedence over the user specified sort order (default)' +complete --command yt-dlp --long-option video-multistreams --description 'Allow multiple video streams to be merged into a single file' +complete --command yt-dlp --long-option no-video-multistreams --description 'Only one video stream is downloaded for each output file (default)' +complete --command yt-dlp --long-option audio-multistreams --description 'Allow multiple audio streams to be merged into a single file' +complete --command yt-dlp --long-option no-audio-multistreams --description 'Only one audio stream is downloaded for each output file (default)' +complete --command yt-dlp --long-option all-formats +complete --command yt-dlp --long-option prefer-free-formats --description 'Prefer video formats with free containers over non-free ones of the same quality. Use with "-S ext" to strictly prefer free containers irrespective of quality' +complete --command yt-dlp --long-option no-prefer-free-formats --description 'Don'"'"'t give any special preference to free containers (default)' +complete --command yt-dlp --long-option check-formats --description 'Make sure formats are selected only from those that are actually downloadable' +complete --command yt-dlp --long-option check-all-formats --description 'Check all formats for whether they are actually downloadable' +complete --command yt-dlp --long-option no-check-formats --description 'Do not check that the formats are actually downloadable' +complete --command yt-dlp --long-option list-formats --short-option F --description 'List available formats of each video. Simulate unless --no-simulate is used' +complete --command yt-dlp --long-option list-formats-as-table +complete --command yt-dlp --long-option list-formats-old +complete --command yt-dlp --long-option merge-output-format --description 'Containers that may be used when merging formats, separated by "/", e.g. "mp4/mkv". Ignored if no merge is required. (currently supported: avi, flv, mkv, mov, mp4, webm)' +complete --command yt-dlp --long-option allow-unplayable-formats +complete --command yt-dlp --long-option no-allow-unplayable-formats +complete --command yt-dlp --long-option write-subs --description 'Write subtitle file' +complete --command yt-dlp --long-option no-write-subs --description 'Do not write subtitle file (default)' +complete --command yt-dlp --long-option write-auto-subs --description 'Write automatically generated subtitle file (Alias: --write-automatic-subs)' +complete --command yt-dlp --long-option no-write-auto-subs --description 'Do not write auto-generated subtitles (default) (Alias: --no-write-automatic-subs)' +complete --command yt-dlp --long-option all-subs +complete --command yt-dlp --long-option list-subs --description 'List available subtitles of each video. Simulate unless --no-simulate is used' +complete --command yt-dlp --long-option sub-format --description 'Subtitle format; accepts formats preference separated by "/", e.g. "srt" or "ass/srt/best"' +complete --command yt-dlp --long-option sub-langs --description 'Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. --sub-langs "en.*,ja" (where "en.*" is a regex pattern that matches "en" followed by 0 or more of any character). You can prefix the language code with a "-" to exclude it from the requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of available language tags' +complete --command yt-dlp --long-option username --short-option u --description 'Login with this account ID' +complete --command yt-dlp --long-option password --short-option p --description 'Account password. If this option is left out, yt-dlp will ask interactively' +complete --command yt-dlp --long-option twofactor --short-option 2 --description 'Two-factor authentication code' +complete --command yt-dlp --long-option netrc --short-option n --description 'Use .netrc authentication data' +complete --command yt-dlp --long-option netrc-location --description 'Location of .netrc authentication data; either the path or its containing directory. Defaults to ~/.netrc' +complete --command yt-dlp --long-option netrc-cmd --description 'Command to execute to get the credentials for an extractor.' +complete --command yt-dlp --long-option video-password --description 'Video-specific password' +complete --command yt-dlp --long-option ap-mso --description 'Adobe Pass multiple-system operator (TV provider) identifier, use --ap-list-mso for a list of available MSOs' +complete --command yt-dlp --long-option ap-username --description 'Multiple-system operator account login' +complete --command yt-dlp --long-option ap-password --description 'Multiple-system operator account password. If this option is left out, yt-dlp will ask interactively' +complete --command yt-dlp --long-option ap-list-mso --description 'List all supported multiple-system operators' +complete --command yt-dlp --long-option client-certificate --description 'Path to client certificate file in PEM format. May include the private key' +complete --command yt-dlp --long-option client-certificate-key --description 'Path to private key file for client certificate' +complete --command yt-dlp --long-option client-certificate-password --description 'Password for client certificate private key, if encrypted. If not provided, and the key is encrypted, yt-dlp will ask interactively' +complete --command yt-dlp --long-option extract-audio --short-option x --description 'Convert video files to audio-only files (requires ffmpeg and ffprobe)' +complete --command yt-dlp --long-option audio-format --description 'Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar syntax as --remux-video' +complete --command yt-dlp --long-option audio-quality --description 'Specify ffmpeg audio quality to use when converting the audio with -x. Insert a value between 0 (best) and 10 (worst) for VBR or a specific bitrate like 128K (default %default)' +complete --command yt-dlp --long-option remux-video --description 'Remux the video into another container if necessary (currently supported: avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac, m4a, mka, mp3, ogg, opus, vorbis, wav). If the target container does not support the video/audio codec, remuxing will fail. You can specify multiple rules; e.g. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 and anything else to mkv' --arguments 'mp4 mkv' --exclusive +complete --command yt-dlp --long-option recode-video --description 'Re-encode the video into another format if necessary. The syntax and supported formats are the same as --remux-video' --arguments 'mp4 flv ogg webm mkv' --exclusive +complete --command yt-dlp --long-option postprocessor-args --description 'Give these arguments to the postprocessors. Specify the postprocessor/executable name and the arguments separated by a colon ":" to give the argument to the specified postprocessor/executable. Supported PP are: Merger, ModifyChapters, SplitChapters, ExtractAudio, VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail, SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a, FixupM3u8, FixupTimestamp and FixupDuration. The supported executables are: AtomicParsley, FFmpeg and FFprobe. You can also specify "PP+EXE:ARGS" to give the arguments to the specified executable only when being used by the specified postprocessor. Additionally, for ffmpeg/ffprobe, "_i"/"_o" can be appended to the prefix optionally followed by a number to pass the argument before the specified input/output file, e.g. --ppa "Merger+ffmpeg_i1:-v quiet". You can use this option multiple times to give different arguments to different postprocessors. (Alias: --ppa)' +complete --command yt-dlp --long-option keep-video --short-option k --description 'Keep the intermediate video file on disk after post-processing' +complete --command yt-dlp --long-option no-keep-video --description 'Delete the intermediate video file after post-processing (default)' +complete --command yt-dlp --long-option post-overwrites --description 'Overwrite post-processed files (default)' +complete --command yt-dlp --long-option no-post-overwrites --description 'Do not overwrite post-processed files' +complete --command yt-dlp --long-option embed-subs --description 'Embed subtitles in the video (only for mp4, webm and mkv videos)' +complete --command yt-dlp --long-option no-embed-subs --description 'Do not embed subtitles (default)' +complete --command yt-dlp --long-option embed-thumbnail --description 'Embed thumbnail in the video as cover art' +complete --command yt-dlp --long-option no-embed-thumbnail --description 'Do not embed thumbnail (default)' +complete --command yt-dlp --long-option embed-metadata --description 'Embed metadata to the video file. Also embeds chapters/infojson if present unless --no-embed-chapters/--no-embed-info-json are used (Alias: --add-metadata)' +complete --command yt-dlp --long-option no-embed-metadata --description 'Do not add metadata to file (default) (Alias: --no-add-metadata)' +complete --command yt-dlp --long-option embed-chapters --description 'Add chapter markers to the video file (Alias: --add-chapters)' +complete --command yt-dlp --long-option no-embed-chapters --description 'Do not add chapter markers (default) (Alias: --no-add-chapters)' +complete --command yt-dlp --long-option embed-info-json --description 'Embed the infojson as an attachment to mkv/mka video files' +complete --command yt-dlp --long-option no-embed-info-json --description 'Do not embed the infojson as an attachment to the video file' +complete --command yt-dlp --long-option metadata-from-title +complete --command yt-dlp --long-option parse-metadata --description 'Parse additional metadata like title/artist from other fields; see "MODIFYING METADATA" for details. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process)' +complete --command yt-dlp --long-option replace-in-metadata --description 'Replace text in a metadata field using the given regex. This option can be used multiple times. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process)' +complete --command yt-dlp --long-option xattrs --description 'Write metadata to the video file'"'"'s xattrs (using Dublin Core and XDG standards)' +complete --command yt-dlp --long-option concat-playlist --description 'Concatenate videos in a playlist. One of "never", "always", or "multi_video" (default; only when the videos form a single show). All the video files must have the same codecs and number of streams to be concatenable. The "pl_video:" prefix can be used with "--paths" and "--output" to set the output filename for the concatenated files. See "OUTPUT TEMPLATE" for details' +complete --command yt-dlp --long-option fixup --description 'Automatically correct known faults of the file. One of never (do nothing), warn (only emit a warning), detect_or_warn (the default; fix the file if we can, warn otherwise), force (try fixing even if the file already exists)' +complete --command yt-dlp --long-option prefer-avconv +complete --command yt-dlp --long-option prefer-ffmpeg +complete --command yt-dlp --long-option ffmpeg-location --description 'Location of the ffmpeg binary; either the path to the binary or its containing directory' +complete --command yt-dlp --long-option exec --description 'Execute a command, optionally prefixed with when to execute it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: after_move). The same syntax as the output template can be used to pass any field as arguments to the command. If no fields are passed, %(filepath,_filename|)q is appended to the end of the command. This option can be used multiple times' +complete --command yt-dlp --long-option no-exec --description 'Remove any previously defined --exec' +complete --command yt-dlp --long-option exec-before-download +complete --command yt-dlp --long-option no-exec-before-download +complete --command yt-dlp --long-option convert-subs --description 'Convert the subtitles to another format (currently supported: ass, lrc, srt, vtt). Use "--convert-subs none" to disable conversion (default) (Alias: --convert-subtitles)' +complete --command yt-dlp --long-option convert-thumbnails --description 'Convert the thumbnails to another format (currently supported: jpg, png, webp). You can specify multiple rules using similar syntax as "--remux-video". Use "--convert-thumbnails none" to disable conversion (default)' +complete --command yt-dlp --long-option split-chapters --description 'Split video into multiple files based on internal chapters. The "chapter:" prefix can be used with "--paths" and "--output" to set the output filename for the split files. See "OUTPUT TEMPLATE" for details' +complete --command yt-dlp --long-option no-split-chapters --description 'Do not split video based on chapters (default)' +complete --command yt-dlp --long-option remove-chapters --description 'Remove chapters whose title matches the given regular expression. The syntax is the same as --download-sections. This option can be used multiple times' +complete --command yt-dlp --long-option no-remove-chapters --description 'Do not remove any chapters from the file (default)' +complete --command yt-dlp --long-option force-keyframes-at-cuts --description 'Force keyframes at cuts when downloading/splitting/removing sections. This is slow due to needing a re-encode, but the resulting video may have fewer artifacts around the cuts' +complete --command yt-dlp --long-option no-force-keyframes-at-cuts --description 'Do not force keyframes around the chapters when cutting/splitting (default)' +complete --command yt-dlp --long-option use-postprocessor --description 'The (case-sensitive) name of plugin postprocessors to be enabled, and (optionally) arguments to be passed to it, separated by a colon ":". ARGS are a semicolon ";" delimited list of NAME=VALUE. The "when" argument determines when the postprocessor is invoked. It can be one of "pre_process" (after video extraction), "after_filter" (after video passes filter), "video" (after --format; before --print/--output), "before_dl" (before each video download), "post_process" (after each video download; default), "after_move" (after moving the video file to its final location), "after_video" (after downloading and processing all formats of a video), or "playlist" (at end of playlist). This option can be used multiple times to add different postprocessors' +complete --command yt-dlp --long-option sponsorblock-mark --description 'SponsorBlock categories to create chapters for, separated by commas. Available categories are sponsor, intro, outro, selfpromo, preview, filler, interaction, music_offtopic, poi_highlight, chapter, all and default (=all). You can prefix the category with a "-" to exclude it. See [1] for descriptions of the categories. E.g. --sponsorblock-mark all,-preview [1] https://wiki.sponsor.ajay.app/w/Segment_Categories' +complete --command yt-dlp --long-option sponsorblock-remove --description 'SponsorBlock categories to be removed from the video file, separated by commas. If a category is present in both mark and remove, remove takes precedence. The syntax and available categories are the same as for --sponsorblock-mark except that "default" refers to "all,-filler" and poi_highlight, chapter are not available' +complete --command yt-dlp --long-option sponsorblock-chapter-title --description 'An output template for the title of the SponsorBlock chapters created by --sponsorblock-mark. The only available fields are start_time, end_time, category, categories, name, category_names. Defaults to "%default"' +complete --command yt-dlp --long-option no-sponsorblock --description 'Disable both --sponsorblock-mark and --sponsorblock-remove' +complete --command yt-dlp --long-option sponsorblock-api --description 'SponsorBlock API location, defaults to %default' +complete --command yt-dlp --long-option sponskrub +complete --command yt-dlp --long-option no-sponskrub +complete --command yt-dlp --long-option sponskrub-cut +complete --command yt-dlp --long-option no-sponskrub-cut +complete --command yt-dlp --long-option sponskrub-force +complete --command yt-dlp --long-option no-sponskrub-force +complete --command yt-dlp --long-option sponskrub-location +complete --command yt-dlp --long-option sponskrub-args +complete --command yt-dlp --long-option extractor-retries --description 'Number of retries for known extractor errors (default is %default), or "infinite"' +complete --command yt-dlp --long-option allow-dynamic-mpd --description 'Process dynamic DASH manifests (default) (Alias: --no-ignore-dynamic-mpd)' +complete --command yt-dlp --long-option ignore-dynamic-mpd --description 'Do not process dynamic DASH manifests (Alias: --no-allow-dynamic-mpd)' +complete --command yt-dlp --long-option hls-split-discontinuity --description 'Split HLS playlists to different formats at discontinuities such as ad breaks' +complete --command yt-dlp --long-option no-hls-split-discontinuity --description 'Do not split HLS playlists into different formats at discontinuities such as ad breaks (default)' +complete --command yt-dlp --long-option extractor-args --description 'Pass ARGS arguments to the IE_KEY extractor. See "EXTRACTOR ARGUMENTS" for details. You can use this option multiple times to give arguments for different extractors' +complete --command yt-dlp --long-option youtube-include-dash-manifest +complete --command yt-dlp --long-option youtube-skip-dash-manifest +complete --command yt-dlp --long-option youtube-include-hls-manifest +complete --command yt-dlp --long-option youtube-skip-hls-manifest + + +complete --command yt-dlp --arguments ":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory" diff --git a/.venv/share/man/man1/isympy.1 b/.venv/share/man/man1/isympy.1 new file mode 100644 index 0000000000000000000000000000000000000000..0ff966158a28c5ad1a6cd954e454842b25fdd999 --- /dev/null +++ b/.venv/share/man/man1/isympy.1 @@ -0,0 +1,188 @@ +'\" -*- coding: us-ascii -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH isympy 1 2007-10-8 "" "" +.SH NAME +isympy \- interactive shell for SymPy +.SH SYNOPSIS +'nh +.fi +.ad l +\fBisympy\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[\fB-c\fR | \fB--console\fR] [\fB-p\fR ENCODING | \fB--pretty\fR ENCODING] [\fB-t\fR TYPE | \fB--types\fR TYPE] [\fB-o\fR ORDER | \fB--order\fR ORDER] [\fB-q\fR | \fB--quiet\fR] [\fB-d\fR | \fB--doctest\fR] [\fB-C\fR | \fB--no-cache\fR] [\fB-a\fR | \fB--auto\fR] [\fB-D\fR | \fB--debug\fR] [ +-- | PYTHONOPTIONS] +'in \n(.iu-\nxu +.ad b +'hy +'nh +.fi +.ad l +\fBisympy\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[ +{\fB-h\fR | \fB--help\fR} +| +{\fB-v\fR | \fB--version\fR} +] +'in \n(.iu-\nxu +.ad b +'hy +.SH DESCRIPTION +isympy is a Python shell for SymPy. It is just a normal python shell +(ipython shell if you have the ipython package installed) that executes +the following commands so that you don't have to: +.PP +.nf +\*(T< +>>> from __future__ import division +>>> from sympy import * +>>> x, y, z = symbols("x,y,z") +>>> k, m, n = symbols("k,m,n", integer=True) + \*(T> +.fi +.PP +So starting isympy is equivalent to starting python (or ipython) and +executing the above commands by hand. It is intended for easy and quick +experimentation with SymPy. For more complicated programs, it is recommended +to write a script and import things explicitly (using the "from sympy +import sin, log, Symbol, ..." idiom). +.SH OPTIONS +.TP +\*(T<\fB\-c \fR\*(T>\fISHELL\fR, \*(T<\fB\-\-console=\fR\*(T>\fISHELL\fR +Use the specified shell (python or ipython) as +console backend instead of the default one (ipython +if present or python otherwise). + +Example: isympy -c python + +\fISHELL\fR could be either +\&'ipython' or 'python' +.TP +\*(T<\fB\-p \fR\*(T>\fIENCODING\fR, \*(T<\fB\-\-pretty=\fR\*(T>\fIENCODING\fR +Setup pretty printing in SymPy. By default, the most pretty, unicode +printing is enabled (if the terminal supports it). You can use less +pretty ASCII printing instead or no pretty printing at all. + +Example: isympy -p no + +\fIENCODING\fR must be one of 'unicode', +\&'ascii' or 'no'. +.TP +\*(T<\fB\-t \fR\*(T>\fITYPE\fR, \*(T<\fB\-\-types=\fR\*(T>\fITYPE\fR +Setup the ground types for the polys. By default, gmpy ground types +are used if gmpy2 or gmpy is installed, otherwise it falls back to python +ground types, which are a little bit slower. You can manually +choose python ground types even if gmpy is installed (e.g., for testing purposes). + +Note that sympy ground types are not supported, and should be used +only for experimental purposes. + +Note that the gmpy1 ground type is primarily intended for testing; it the +use of gmpy even if gmpy2 is available. + +This is the same as setting the environment variable +SYMPY_GROUND_TYPES to the given ground type (e.g., +SYMPY_GROUND_TYPES='gmpy') + +The ground types can be determined interactively from the variable +sympy.polys.domains.GROUND_TYPES inside the isympy shell itself. + +Example: isympy -t python + +\fITYPE\fR must be one of 'gmpy', +\&'gmpy1' or 'python'. +.TP +\*(T<\fB\-o \fR\*(T>\fIORDER\fR, \*(T<\fB\-\-order=\fR\*(T>\fIORDER\fR +Setup the ordering of terms for printing. The default is lex, which +orders terms lexicographically (e.g., x**2 + x + 1). You can choose +other orderings, such as rev-lex, which will use reverse +lexicographic ordering (e.g., 1 + x + x**2). + +Note that for very large expressions, ORDER='none' may speed up +printing considerably, with the tradeoff that the order of the terms +in the printed expression will have no canonical order + +Example: isympy -o rev-lax + +\fIORDER\fR must be one of 'lex', 'rev-lex', 'grlex', +\&'rev-grlex', 'grevlex', 'rev-grevlex', 'old', or 'none'. +.TP +\*(T<\fB\-q\fR\*(T>, \*(T<\fB\-\-quiet\fR\*(T> +Print only Python's and SymPy's versions to stdout at startup, and nothing else. +.TP +\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-\-doctest\fR\*(T> +Use the same format that should be used for doctests. This is +equivalent to '\fIisympy -c python -p no\fR'. +.TP +\*(T<\fB\-C\fR\*(T>, \*(T<\fB\-\-no\-cache\fR\*(T> +Disable the caching mechanism. Disabling the cache may slow certain +operations down considerably. This is useful for testing the cache, +or for benchmarking, as the cache can result in deceptive benchmark timings. + +This is the same as setting the environment variable SYMPY_USE_CACHE +to 'no'. +.TP +\*(T<\fB\-a\fR\*(T>, \*(T<\fB\-\-auto\fR\*(T> +Automatically create missing symbols. Normally, typing a name of a +Symbol that has not been instantiated first would raise NameError, +but with this option enabled, any undefined name will be +automatically created as a Symbol. This only works in IPython 0.11. + +Note that this is intended only for interactive, calculator style +usage. In a script that uses SymPy, Symbols should be instantiated +at the top, so that it's clear what they are. + +This will not override any names that are already defined, which +includes the single character letters represented by the mnemonic +QCOSINE (see the "Gotchas and Pitfalls" document in the +documentation). You can delete existing names by executing "del +name" in the shell itself. You can see if a name is defined by typing +"'name' in globals()". + +The Symbols that are created using this have default assumptions. +If you want to place assumptions on symbols, you should create them +using symbols() or var(). + +Finally, this only works in the top level namespace. So, for +example, if you define a function in isympy with an undefined +Symbol, it will not work. +.TP +\*(T<\fB\-D\fR\*(T>, \*(T<\fB\-\-debug\fR\*(T> +Enable debugging output. This is the same as setting the +environment variable SYMPY_DEBUG to 'True'. The debug status is set +in the variable SYMPY_DEBUG within isympy. +.TP +-- \fIPYTHONOPTIONS\fR +These options will be passed on to \fIipython (1)\fR shell. +Only supported when ipython is being used (standard python shell not supported). + +Two dashes (--) are required to separate \fIPYTHONOPTIONS\fR +from the other isympy options. + +For example, to run iSymPy without startup banner and colors: + +isympy -q -c ipython -- --colors=NoColor +.TP +\*(T<\fB\-h\fR\*(T>, \*(T<\fB\-\-help\fR\*(T> +Print help output and exit. +.TP +\*(T<\fB\-v\fR\*(T>, \*(T<\fB\-\-version\fR\*(T> +Print isympy version information and exit. +.SH FILES +.TP +\*(T<\fI${HOME}/.sympy\-history\fR\*(T> +Saves the history of commands when using the python +shell as backend. +.SH BUGS +The upstreams BTS can be found at \(lahttps://github.com/sympy/sympy/issues\(ra +Please report all bugs that you find in there, this will help improve +the overall quality of SymPy. +.SH "SEE ALSO" +\fBipython\fR(1), \fBpython\fR(1) diff --git a/.venv/share/man/man1/ttx.1 b/.venv/share/man/man1/ttx.1 new file mode 100644 index 0000000000000000000000000000000000000000..bba23b5e51629509a499f4471fc8196e9863d211 --- /dev/null +++ b/.venv/share/man/man1/ttx.1 @@ -0,0 +1,225 @@ +.Dd May 18, 2004 +.\" ttx is not specific to any OS, but contrary to what groff_mdoc(7) +.\" seems to imply, entirely omitting the .Os macro causes 'BSD' to +.\" be used, so I give a zero-width space as its argument. +.Os \& +.\" The "FontTools Manual" argument apparently has no effect in +.\" groff 1.18.1. I think it is a bug in the -mdoc groff package. +.Dt TTX 1 "FontTools Manual" +.Sh NAME +.Nm ttx +.Nd tool for manipulating TrueType and OpenType fonts +.Sh SYNOPSIS +.Nm +.Bk +.Op Ar option ... +.Ek +.Bk +.Ar file ... +.Ek +.Sh DESCRIPTION +.Nm +is a tool for manipulating TrueType and OpenType fonts. It can convert +TrueType and OpenType fonts to and from an +.Tn XML Ns -based format called +.Tn TTX . +.Tn TTX +files have a +.Ql .ttx +extension. +.Pp +For each +.Ar file +argument it is given, +.Nm +detects whether it is a +.Ql .ttf , +.Ql .otf +or +.Ql .ttx +file and acts accordingly: if it is a +.Ql .ttf +or +.Ql .otf +file, it generates a +.Ql .ttx +file; if it is a +.Ql .ttx +file, it generates a +.Ql .ttf +or +.Ql .otf +file. +.Pp +By default, every output file is created in the same directory as the +corresponding input file and with the same name except for the +extension, which is substituted appropriately. +.Nm +never overwrites existing files; if necessary, it appends a suffix to +the output file name before the extension, as in +.Pa Arial#1.ttf . +.Ss "General options" +.Bl -tag -width ".Fl t Ar table" +.It Fl h +Display usage information. +.It Fl d Ar dir +Write the output files to directory +.Ar dir +instead of writing every output file to the same directory as the +corresponding input file. +.It Fl o Ar file +Write the output to +.Ar file +instead of writing it to the same directory as the +corresponding input file. +.It Fl v +Be verbose. Write more messages to the standard output describing what +is being done. +.It Fl a +Allow virtual glyphs ID's on compile or decompile. +.El +.Ss "Dump options" +The following options control the process of dumping font files +(TrueType or OpenType) to +.Tn TTX +files. +.Bl -tag -width ".Fl t Ar table" +.It Fl l +List table information. Instead of dumping the font to a +.Tn TTX +file, display minimal information about each table. +.It Fl t Ar table +Dump table +.Ar table . +This option may be given multiple times to dump several tables at +once. When not specified, all tables are dumped. +.It Fl x Ar table +Exclude table +.Ar table +from the list of tables to dump. This option may be given multiple +times to exclude several tables from the dump. The +.Fl t +and +.Fl x +options are mutually exclusive. +.It Fl s +Split tables. Dump each table to a separate +.Tn TTX +file and write (under the name that would have been used for the output +file if the +.Fl s +option had not been given) one small +.Tn TTX +file containing references to the individual table dump files. This +file can be used as input to +.Nm +as long as the referenced files can be found in the same directory. +.It Fl i +.\" XXX: I suppose OpenType programs (exist and) are also affected. +Don't disassemble TrueType instructions. When this option is specified, +all TrueType programs (glyph programs, the font program and the +pre-program) are written to the +.Tn TTX +file as hexadecimal data instead of +assembly. This saves some time and results in smaller +.Tn TTX +files. +.It Fl y Ar n +When decompiling a TrueType Collection (TTC) file, +decompile font number +.Ar n , +starting from 0. +.El +.Ss "Compilation options" +The following options control the process of compiling +.Tn TTX +files into font files (TrueType or OpenType): +.Bl -tag -width ".Fl t Ar table" +.It Fl m Ar fontfile +Merge the input +.Tn TTX +file +.Ar file +with +.Ar fontfile . +No more than one +.Ar file +argument can be specified when this option is used. +.It Fl b +Don't recalculate glyph bounding boxes. Use the values in the +.Tn TTX +file as is. +.El +.Sh "THE TTX FILE FORMAT" +You can find some information about the +.Tn TTX +file format in +.Pa documentation.html . +In particular, you will find in that file the list of tables understood by +.Nm +and the relations between TrueType GlyphIDs and the glyph names used in +.Tn TTX +files. +.Sh EXAMPLES +In the following examples, all files are read from and written to the +current directory. Additionally, the name given for the output file +assumes in every case that it did not exist before +.Nm +was invoked. +.Pp +Dump the TrueType font contained in +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx FreeSans.ttf +.Pp +Compile +.Pa MyFont.ttx +into a TrueType or OpenType font file: +.Pp +.Dl ttx MyFont.ttx +.Pp +List the tables in +.Pa FreeSans.ttf +along with some information: +.Pp +.Dl ttx -l FreeSans.ttf +.Pp +Dump the +.Sq cmap +table from +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx -t cmap FreeSans.ttf +.Sh NOTES +On MS\-Windows and MacOS, +.Nm +is available as a graphical application to which files can be dropped. +.Sh SEE ALSO +.Pa documentation.html +.Pp +.Xr fontforge 1 , +.Xr ftinfo 1 , +.Xr gfontview 1 , +.Xr xmbdfed 1 , +.Xr Font::TTF 3pm +.Sh AUTHORS +.Nm +was written by +.An -nosplit +.An "Just van Rossum" Aq just@letterror.com . +.Pp +This manual page was written by +.An "Florent Rougon" Aq f.rougon@free.fr +for the Debian GNU/Linux system based on the existing FontTools +documentation. It may be freely used, modified and distributed without +restrictions. +.\" For Emacs: +.\" Local Variables: +.\" fill-column: 72 +.\" sentence-end: "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ \n]*" +.\" sentence-end-double-space: t +.\" End: \ No newline at end of file diff --git a/.venv/share/man/man1/yt-dlp.1 b/.venv/share/man/man1/yt-dlp.1 new file mode 100644 index 0000000000000000000000000000000000000000..5ababf0f770142e90b7438f2e4a6803aa0e5dad4 --- /dev/null +++ b/.venv/share/man/man1/yt-dlp.1 @@ -0,0 +1,4150 @@ +'\" t +.\" Automatically generated by Pandoc 3.1.3 +.\" +.\" Define V font for inline verbatim, using C font in formats +.\" that render this, and otherwise B font. +.ie "\f[CB]x\f[]"x" \{\ +. ftr V B +. ftr VI BI +. ftr VB B +. ftr VBI BI +.\} +.el \{\ +. ftr V CR +. ftr VI CI +. ftr VB CB +. ftr VBI CBI +.\} +.TH "yt-dlp" "1" "" "" "" +.hy +.SH NAME +.PP +yt-dlp - A feature-rich command-line audio/video downloader +.SH SYNOPSIS +.PP +\f[B]yt-dlp\f[R] [OPTIONS] URL [URL...] +.SH DESCRIPTION +.PP +yt-dlp is a feature-rich command-line audio/video downloader with +support for thousands of sites. +The project is a fork of +youtube-dl (https://github.com/ytdl-org/youtube-dl) based on the now +inactive youtube-dlc (https://github.com/blackjack4494/yt-dlc). +.SH OPTIONS +.SS General Options: +.TP +-h, --help +Print this help text and exit +.TP +--version +Print program version and exit +.TP +-U, --update +Update this program to the latest version +.TP +--no-update +Do not check for updates (default) +.TP +--update-to \f[I][CHANNEL]\[at][TAG]\f[R] +Upgrade/downgrade to a specific version. +CHANNEL can be a repository as well. +CHANNEL and TAG default to \[dq]stable\[dq] and \[dq]latest\[dq] +respectively if omitted; See \[dq]UPDATE\[dq] for details. +Supported channels: stable, nightly, master +.TP +-i, --ignore-errors +Ignore download and postprocessing errors. +The download will be considered successful even if the postprocessing +fails +.TP +--no-abort-on-error +Continue with next video on download errors; e.g. +to skip unavailable videos in a playlist (default) +.TP +--abort-on-error +Abort downloading of further videos if an error occurs (Alias: +--no-ignore-errors) +.TP +--dump-user-agent +Display the current user-agent and exit +.TP +--list-extractors +List all supported extractors and exit +.TP +--extractor-descriptions +Output descriptions of all supported extractors and exit +.TP +--use-extractors \f[I]NAMES\f[R] +Extractor names to use separated by commas. +You can also use regexes, \[dq]all\[dq], \[dq]default\[dq] and +\[dq]end\[dq] (end URL matching); e.g. +--ies \[dq]holodex.*,end,youtube\[dq]. +Prefix the name with a \[dq]-\[dq] to exclude it, e.g. +--ies default,-generic. +Use --list-extractors for a list of extractor names. +(Alias: --ies) +.TP +--default-search \f[I]PREFIX\f[R] +Use this prefix for unqualified URLs. +E.g. +\[dq]gvsearch2:python\[dq] downloads two videos from google videos for +the search term \[dq]python\[dq]. +Use the value \[dq]auto\[dq] to let yt-dlp guess (\[dq]auto_warning\[dq] +to emit a warning when guessing). +\[dq]error\[dq] just throws an error. +The default value \[dq]fixup_error\[dq] repairs broken URLs, but emits +an error if this is not possible instead of searching +.TP +--ignore-config +Don\[aq]t load any more configuration files except those given to +--config-locations. +For backward compatibility, if this option is found inside the system +configuration file, the user configuration is not loaded. +(Alias: --no-config) +.TP +--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 +.TP +--config-locations \f[I]PATH\f[R] +Location of the main configuration file; either the path to the config +or its containing directory (\[dq]-\[dq] for stdin). +Can be used multiple times and inside other configuration files +.TP +--plugin-dirs \f[I]PATH\f[R] +Path to an additional directory to search for plugins. +This option can be used multiple times to add multiple directories. +Use \[dq]default\[dq] to search the default plugin directories (default) +.TP +--no-plugin-dirs +Clear plugin directories to search, including defaults and those +provided by previous --plugin-dirs +.TP +--flat-playlist +Do not extract a playlist\[aq]s URL result entries; some entry metadata +may be missing and downloading may be bypassed +.TP +--no-flat-playlist +Fully extract the videos of a playlist (default) +.TP +--live-from-start +Download livestreams from the start. +Currently only supported for YouTube (Experimental) +.TP +--no-live-from-start +Download livestreams from the current time (default) +.TP +--wait-for-video \f[I]MIN[-MAX]\f[R] +Wait for scheduled streams to become available. +Pass the minimum number of seconds (or range) to wait between retries +.TP +--no-wait-for-video +Do not wait for scheduled streams (default) +.TP +--mark-watched +Mark videos watched (even with --simulate) +.TP +--no-mark-watched +Do not mark videos watched (default) +.TP +--color \f[I][STREAM:]POLICY\f[R] +Whether to emit color codes in output, optionally prefixed by the STREAM +(stdout or stderr) to apply the setting to. +Can be one of \[dq]always\[dq], \[dq]auto\[dq] (default), +\[dq]never\[dq], or \[dq]no_color\[dq] (use non color terminal +sequences). +Use \[dq]auto-tty\[dq] or \[dq]no_color-tty\[dq] to decide based on +terminal support only. +Can be used multiple times +.TP +--compat-options \f[I]OPTS\f[R] +Options that can help keep compatibility with youtube-dl or youtube-dlc +configurations by reverting some of the changes made in yt-dlp. +See \[dq]Differences in default behavior\[dq] for details +.TP +--alias \f[I]ALIASES OPTIONS\f[R] +Create aliases for an option string. +Unless an alias starts with a dash \[dq]-\[dq], it is prefixed with +\[dq]--\[dq]. +Arguments are parsed according to the Python string formatting +mini-language. +E.g. +--alias get-audio,-X \[dq]-S=aext:{0},abr -x --audio-format {0}\[dq] +creates options \[dq]--get-audio\[dq] and \[dq]-X\[dq] that takes an +argument (ARG0) and expands to \[dq]-S=aext:ARG0,abr -x --audio-format +ARG0\[dq]. +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 +.TP +-t, --preset-alias \f[I]PRESET\f[R] +Applies a predefined set of options. +e.g. +--preset-alias mp3. +The following presets are available: mp3, aac, mp4, mkv, sleep. +See the \[dq]Preset Aliases\[dq] section at the end for more info. +This option can be used multiple times +.SS Network Options: +.TP +--proxy \f[I]URL\f[R] +Use the specified HTTP/HTTPS/SOCKS proxy. +To enable SOCKS proxy, specify a proper scheme, e.g. +socks5://user:pass\[at]127.0.0.1:1080/. +Pass in an empty string (--proxy \[dq]\[dq]) for direct connection +.TP +--socket-timeout \f[I]SECONDS\f[R] +Time to wait before giving up, in seconds +.TP +--source-address \f[I]IP\f[R] +Client-side IP address to bind to +.TP +--impersonate \f[I]CLIENT[:OS]\f[R] +Client to impersonate for requests. +E.g. +chrome, chrome-110, chrome:windows-10. +Pass --impersonate=\[dq]\[dq] to impersonate any client. +Note that forcing impersonation for all requests may have a detrimental +impact on download speed and stability +.TP +--list-impersonate-targets +List available clients to impersonate. +.TP +-4, --force-ipv4 +Make all connections via IPv4 +.TP +-6, --force-ipv6 +Make all connections via IPv6 +.TP +--enable-file-urls +Enable file:// URLs. +This is disabled by default for security reasons. +.SS Geo-restriction: +.TP +--geo-verification-proxy \f[I]URL\f[R] +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 downloading +.TP +--xff \f[I]VALUE\f[R] +How to fake X-Forwarded-For HTTP header to try bypassing geographic +restriction. +One of \[dq]default\[dq] (only when known to be useful), +\[dq]never\[dq], an IP block in CIDR notation, or a two-letter ISO +3166-2 country code +.SS Video Selection: +.TP +-I, --playlist-items \f[I]ITEM_SPEC\f[R] +Comma separated playlist_index of the items to download. +You can specify a range using \[dq][START]:[STOP][:STEP]\[dq]. +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. +\[dq]-I 1:3,7,-5::2\[dq] used on a playlist of size 15 will download the +items at index 1,2,3,7,11,13,15 +.TP +--min-filesize \f[I]SIZE\f[R] +Abort download if filesize is smaller than SIZE, e.g. +50k or 44.6M +.TP +--max-filesize \f[I]SIZE\f[R] +Abort download if filesize is larger than SIZE, e.g. +50k or 44.6M +.TP +--date \f[I]DATE\f[R] +Download only videos uploaded on this date. +The date can be \[dq]YYYYMMDD\[dq] or in the format +[now|today|yesterday][-N[day|week|month|year]]. +E.g. +\[dq]--date today-2weeks\[dq] downloads only videos uploaded on the same +day two weeks ago +.TP +--datebefore \f[I]DATE\f[R] +Download only videos uploaded on or before this date. +The date formats accepted are the same as --date +.TP +--dateafter \f[I]DATE\f[R] +Download only videos uploaded on or after this date. +The date formats accepted are the same as --date +.TP +--match-filters \f[I]FILTER\f[R] +Generic video filter. +Any \[dq]OUTPUT TEMPLATE\[dq] field can be compared with a number or a +string using the operators defined in \[dq]Filtering Formats\[dq]. +You can also simply specify a field to match if the field is present, +use \[dq]!field\[dq] to check if the field is not present, and +\[dq]&\[dq] to check multiple conditions. +Use a \[dq]\[dq] to escape \[dq]&\[dq] or quotes if needed. +If used multiple times, the filter matches if at least one of the +conditions is met. +E.g. +--match-filters !is_live --match-filters \[dq]like_count>?100 & +description\[ti]=\[aq](?i)& dogs\[dq] 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 +\[dq]cats & dogs\[dq] (caseless). +Use \[dq]--match-filters -\[dq] to interactively ask whether to download +each video +.TP +--no-match-filters +Do not use any --match-filters (default) +.TP +--break-match-filters \f[I]FILTER\f[R] +Same as \[dq]--match-filters\[dq] but stops the download process when a +video is rejected +.TP +--no-break-match-filters +Do not use any --break-match-filters (default) +.TP +--no-playlist +Download only the video, if the URL refers to a video and a playlist +.TP +--yes-playlist +Download the playlist, if the URL refers to a video and a playlist +.TP +--age-limit \f[I]YEARS\f[R] +Download only videos suitable for the given age +.TP +--download-archive \f[I]FILE\f[R] +Download only videos not listed in the archive file. +Record the IDs of all downloaded videos in it +.TP +--no-download-archive +Do not use archive file (default) +.TP +--max-downloads \f[I]NUMBER\f[R] +Abort after downloading NUMBER files +.TP +--break-on-existing +Stop the download process when encountering a file that is in the +archive supplied with the --download-archive option +.TP +--no-break-on-existing +Do not stop the download process when encountering a file that is in the +archive (default) +.TP +--break-per-input +Alters --max-downloads, --break-on-existing, --break-match-filters, and +autonumber to reset per input URL +.TP +--no-break-per-input +--break-on-existing and similar options terminates the entire download +queue +.TP +--skip-playlist-after-errors \f[I]N\f[R] +Number of allowed failures until the rest of the playlist is skipped +.SS Download Options: +.TP +-N, --concurrent-fragments \f[I]N\f[R] +Number of fragments of a dash/hlsnative video that should be downloaded +concurrently (default is 1) +.TP +-r, --limit-rate \f[I]RATE\f[R] +Maximum download rate in bytes per second, e.g. +50K or 4.2M +.TP +--throttled-rate \f[I]RATE\f[R] +Minimum download rate in bytes per second below which throttling is +assumed and the video data is re-extracted, e.g. +100K +.TP +-R, --retries \f[I]RETRIES\f[R] +Number of retries (default is 10), or \[dq]infinite\[dq] +.TP +--file-access-retries \f[I]RETRIES\f[R] +Number of times to retry on file access error (default is 3), or +\[dq]infinite\[dq] +.TP +--fragment-retries \f[I]RETRIES\f[R] +Number of retries for a fragment (default is 10), or \[dq]infinite\[dq] +(DASH, hlsnative and ISM) +.TP +--retry-sleep \f[I][TYPE:]EXPR\f[R] +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 +.TP +--skip-unavailable-fragments +Skip unavailable fragments for DASH, hlsnative and ISM downloads +(default) (Alias: --no-abort-on-unavailable-fragments) +.TP +--abort-on-unavailable-fragments +Abort download if a fragment is unavailable (Alias: +--no-skip-unavailable-fragments) +.TP +--keep-fragments +Keep downloaded fragments on disk after downloading is finished +.TP +--no-keep-fragments +Delete downloaded fragments after downloading is finished (default) +.TP +--buffer-size \f[I]SIZE\f[R] +Size of download buffer, e.g. +1024 or 16K (default is 1024) +.TP +--resize-buffer +The buffer size is automatically resized from an initial value of +--buffer-size (default) +.TP +--no-resize-buffer +Do not automatically adjust the buffer size +.TP +--http-chunk-size \f[I]SIZE\f[R] +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 +(experimental) +.TP +--playlist-random +Download playlist videos in random order +.TP +--lazy-playlist +Process entries in the playlist as they are received. +This disables n_entries, --playlist-random and --playlist-reverse +.TP +--no-lazy-playlist +Process videos in the playlist only after the entire playlist is parsed +(default) +.TP +--xattr-set-filesize +Set file xattribute ytdl.filesize with expected file size +.TP +--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 +.TP +--no-hls-use-mpegts +Do not use the mpegts container for HLS videos. +This is default when not downloading live streams +.TP +--download-sections \f[I]REGEX\f[R] +Download only chapters that match the regular expression. +A \[dq]*\[dq] prefix denotes time-range instead of chapter. +Negative timestamps are calculated from the end. +\[dq]*from-url\[dq] can be used to download between the +\[dq]start_time\[dq] and \[dq]end_time\[dq] extracted from the URL. +Needs ffmpeg. +This option can be used multiple times to download multiple sections, +e.g. +--download-sections \[dq]*10:15-inf\[dq] --download-sections +\[dq]intro\[dq] +.TP +--downloader \f[I][PROTO:]NAME\f[R] +Name or path of the external downloader to use (optionally) prefixed by +the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. +Currently supports native, aria2c, avconv, axel, curl, ffmpeg, httpie, +wget. +You can use this option multiple times to set different downloaders for +different protocols. +E.g. +--downloader aria2c --downloader \[dq]dash,m3u8:native\[dq] will use +aria2c for http/ftp downloads, and the native downloader for dash/m3u8 +downloads (Alias: --external-downloader) +.TP +--downloader-args \f[I]NAME:ARGS\f[R] +Give these arguments to the external downloader. +Specify the downloader name and the arguments separated by a colon +\[dq]:\[dq]. +For ffmpeg, arguments can be passed to different positions using the +same syntax as --postprocessor-args. +You can use this option multiple times to give different arguments to +different downloaders (Alias: --external-downloader-args) +.SS Filesystem Options: +.TP +-a, --batch-file \f[I]FILE\f[R] +File containing URLs to download (\[dq]-\[dq] for stdin), one URL per +line. +Lines starting with \[dq]#\[dq], \[dq];\[dq] or \[dq]]\[dq] are +considered as comments and ignored +.TP +--no-batch-file +Do not read URLs from batch file (default) +.TP +-P, --paths \f[I][TYPES:]PATH\f[R] +The paths where the files should be downloaded. +Specify the type of file and the path separated by a colon \[dq]:\[dq]. +All the same TYPES as --output are supported. +Additionally, you can also provide \[dq]home\[dq] (default) and +\[dq]temp\[dq] paths. +All intermediary files are first downloaded to the temp path and then +the final files are moved over to the home path after download is +finished. +This option is ignored if --output is an absolute path +.TP +-o, --output \f[I][TYPES:]TEMPLATE\f[R] +Output filename template; see \[dq]OUTPUT TEMPLATE\[dq] for details +.TP +--output-na-placeholder \f[I]TEXT\f[R] +Placeholder for unavailable fields in --output (default: \[dq]NA\[dq]) +.TP +--restrict-filenames +Restrict filenames to only ASCII characters, and avoid \[dq]&\[dq] and +spaces in filenames +.TP +--no-restrict-filenames +Allow Unicode characters, \[dq]&\[dq] and spaces in filenames (default) +.TP +--windows-filenames +Force filenames to be Windows-compatible +.TP +--no-windows-filenames +Sanitize filenames only minimally +.TP +--trim-filenames \f[I]LENGTH\f[R] +Limit the filename length (excluding extension) to the specified number +of characters +.TP +-w, --no-overwrites +Do not overwrite any files +.TP +--force-overwrites +Overwrite all video and metadata files. +This option includes --no-continue +.TP +--no-force-overwrites +Do not overwrite the video, but overwrite related files (default) +.TP +-c, --continue +Resume partially downloaded files/fragments (default) +.TP +--no-continue +Do not resume partially downloaded fragments. +If the file is not fragmented, restart download of the entire file +.TP +--part +Use .part files instead of writing directly into output file (default) +.TP +--no-part +Do not use .part files - write directly into output file +.TP +--mtime +Use the Last-modified header to set the file modification time (default) +.TP +--no-mtime +Do not use the Last-modified header to set the file modification time +.TP +--write-description +Write video description to a .description file +.TP +--no-write-description +Do not write video description (default) +.TP +--write-info-json +Write video metadata to a .info.json file (this may contain personal +information) +.TP +--no-write-info-json +Do not write video metadata (default) +.TP +--write-playlist-metafiles +Write playlist metadata in addition to the video metadata when using +--write-info-json, --write-description etc. +(default) +.TP +--no-write-playlist-metafiles +Do not write playlist metadata when using --write-info-json, +--write-description etc. +.TP +--clean-info-json +Remove some internal metadata such as filenames from the infojson +(default) +.TP +--no-clean-info-json +Write all fields to the infojson +.TP +--write-comments +Retrieve video comments to be placed in the infojson. +The comments are fetched even without this option if the extraction is +known to be quick (Alias: --get-comments) +.TP +--no-write-comments +Do not retrieve video comments unless the extraction is known to be +quick (Alias: --no-get-comments) +.TP +--load-info-json \f[I]FILE\f[R] +JSON file containing the video information (created with the +\[dq]--write-info-json\[dq] option) +.TP +--cookies \f[I]FILE\f[R] +Netscape formatted file to read cookies from and dump cookie jar in +.TP +--no-cookies +Do not read/dump cookies from/to file (default) +.TP +--cookies-from-browser \f[I]BROWSER[+KEYRING][:PROFILE][::CONTAINER]\f[R] +The name of the browser to load cookies from. +Currently supported browsers are: brave, chrome, chromium, edge, +firefox, opera, safari, vivaldi, whale. +Optionally, the KEYRING used for decrypting Chromium cookies on Linux, +the name/path of the PROFILE to load cookies from, and the CONTAINER +name (if Firefox) (\[dq]none\[dq] for no container) can be given with +their respective separators. +By default, all containers of the most recently accessed profile are +used. +Currently supported keyrings are: basictext, gnomekeyring, kwallet, +kwallet5, kwallet6 +.TP +--no-cookies-from-browser +Do not load cookies from browser (default) +.TP +--cache-dir \f[I]DIR\f[R] +Location in the filesystem where yt-dlp can store some downloaded +information (such as client ids and signatures) permanently. +By default ${XDG_CACHE_HOME}/yt-dlp +.TP +--no-cache-dir +Disable filesystem caching +.TP +--rm-cache-dir +Delete all filesystem cache files +.SS Thumbnail Options: +.TP +--write-thumbnail +Write thumbnail image to disk +.TP +--no-write-thumbnail +Do not write thumbnail image to disk (default) +.TP +--write-all-thumbnails +Write all thumbnail image formats to disk +.TP +--list-thumbnails +List available thumbnails of each video. +Simulate unless --no-simulate is used +.SS Internet Shortcut Options: +.TP +--write-link +Write an internet shortcut file, depending on the current platform +(.url, .webloc or .desktop). +The URL may be cached by the OS +.TP +--write-url-link +Write a .url Windows internet shortcut. +The OS caches the URL based on the file path +.TP +--write-webloc-link +Write a .webloc macOS internet shortcut +.TP +--write-desktop-link +Write a .desktop Linux internet shortcut +.SS Verbosity and Simulation Options: +.TP +-q, --quiet +Activate quiet mode. +If used with --verbose, print the log to stderr +.TP +--no-quiet +Deactivate quiet mode. +(Default) +.TP +--no-warnings +Ignore warnings +.TP +-s, --simulate +Do not download the video and do not write anything to disk +.TP +--no-simulate +Download the video even if printing/listing options are used +.TP +--ignore-no-formats-error +Ignore \[dq]No video formats\[dq] error. +Useful for extracting metadata even if the videos are not actually +available for download (experimental) +.TP +--no-ignore-no-formats-error +Throw error when no downloadable video formats are found (default) +.TP +--skip-download +Do not download the video but write all related files (Alias: +--no-download) +.TP +-O, --print \f[I][WHEN:]TEMPLATE\f[R] +Field name or output template to print to screen, optionally prefixed +with when to print it, separated by a \[dq]:\[dq]. +Supported values of \[dq]WHEN\[dq] are the same as that of +--use-postprocessor (default: video). +Implies --quiet. +Implies --simulate unless --no-simulate or later stages of WHEN are +used. +This option can be used multiple times +.TP +--print-to-file \f[I][WHEN:]TEMPLATE FILE\f[R] +Append given template to the file. +The values of WHEN and TEMPLATE are the same as that of --print. +FILE uses the same syntax as the output template. +This option can be used multiple times +.TP +-j, --dump-json +Quiet, but print JSON information for each video. +Simulate unless --no-simulate is used. +See \[dq]OUTPUT TEMPLATE\[dq] for a description of available keys +.TP +-J, --dump-single-json +Quiet, but print JSON information for each URL or infojson passed. +Simulate unless --no-simulate is used. +If the URL refers to a playlist, the whole playlist information is +dumped in a single line +.TP +--force-write-archive +Force download archive entries to be written as far as no errors occur, +even if -s or another simulation option is used (Alias: +--force-download-archive) +.TP +--newline +Output progress bar as new lines +.TP +--no-progress +Do not print progress bar +.TP +--progress +Show progress bar, even if in quiet mode +.TP +--console-title +Display progress in console titlebar +.TP +--progress-template \f[I][TYPES:]TEMPLATE\f[R] +Template for progress outputs, optionally prefixed with one of +\[dq]download:\[dq] (default), \[dq]download-title:\[dq] (the console +title), \[dq]postprocess:\[dq], or \[dq]postprocess-title:\[dq]. +The video\[aq]s fields are accessible under the \[dq]info\[dq] key and +the progress attributes are accessible under \[dq]progress\[dq] key. +E.g. +--console-title --progress-template +\[dq]download-title:%(info.id)s-%(progress.eta)s\[dq] +.TP +--progress-delta \f[I]SECONDS\f[R] +Time between progress output (default: 0) +.TP +-v, --verbose +Print various debugging information +.TP +--dump-pages +Print downloaded pages encoded using base64 to debug problems (very +verbose) +.TP +--write-pages +Write downloaded intermediary pages to files in the current directory to +debug problems +.TP +--print-traffic +Display sent and read HTTP traffic +.SS Workarounds: +.TP +--encoding \f[I]ENCODING\f[R] +Force the specified encoding (experimental) +.TP +--legacy-server-connect +Explicitly allow HTTPS connection to servers that do not support RFC +5746 secure renegotiation +.TP +--no-check-certificates +Suppress HTTPS certificate validation +.TP +--prefer-insecure +Use an unencrypted connection to retrieve information about the video +(Currently supported only for YouTube) +.TP +--add-headers \f[I]FIELD:VALUE\f[R] +Specify a custom HTTP header and its value, separated by a colon +\[dq]:\[dq]. +You can use this option multiple times +.TP +--bidi-workaround +Work around terminals that lack bidirectional text support. +Requires bidiv or fribidi executable in PATH +.TP +--sleep-requests \f[I]SECONDS\f[R] +Number of seconds to sleep between requests during data extraction +.TP +--sleep-interval \f[I]SECONDS\f[R] +Number of seconds to sleep before each download. +This is the minimum time to sleep when used along with +--max-sleep-interval (Alias: --min-sleep-interval) +.TP +--max-sleep-interval \f[I]SECONDS\f[R] +Maximum number of seconds to sleep. +Can only be used along with --min-sleep-interval +.TP +--sleep-subtitles \f[I]SECONDS\f[R] +Number of seconds to sleep before each subtitle download +.SS Video Format Options: +.TP +-f, --format \f[I]FORMAT\f[R] +Video format code, see \[dq]FORMAT SELECTION\[dq] for more details +.TP +-S, --format-sort \f[I]SORTORDER\f[R] +Sort the formats by the fields given, see \[dq]Sorting Formats\[dq] for +more details +.TP +--format-sort-force +Force user specified sort order to have precedence over all fields, see +\[dq]Sorting Formats\[dq] for more details (Alias: --S-force) +.TP +--no-format-sort-force +Some fields have precedence over the user specified sort order (default) +.TP +--video-multistreams +Allow multiple video streams to be merged into a single file +.TP +--no-video-multistreams +Only one video stream is downloaded for each output file (default) +.TP +--audio-multistreams +Allow multiple audio streams to be merged into a single file +.TP +--no-audio-multistreams +Only one audio stream is downloaded for each output file (default) +.TP +--prefer-free-formats +Prefer video formats with free containers over non-free ones of the same +quality. +Use with \[dq]-S ext\[dq] to strictly prefer free containers +irrespective of quality +.TP +--no-prefer-free-formats +Don\[aq]t give any special preference to free containers (default) +.TP +--check-formats +Make sure formats are selected only from those that are actually +downloadable +.TP +--check-all-formats +Check all formats for whether they are actually downloadable +.TP +--no-check-formats +Do not check that the formats are actually downloadable +.TP +-F, --list-formats +List available formats of each video. +Simulate unless --no-simulate is used +.TP +--merge-output-format \f[I]FORMAT\f[R] +Containers that may be used when merging formats, separated by +\[dq]/\[dq], e.g. +\[dq]mp4/mkv\[dq]. +Ignored if no merge is required. +(currently supported: avi, flv, mkv, mov, mp4, webm) +.SS Subtitle Options: +.TP +--write-subs +Write subtitle file +.TP +--no-write-subs +Do not write subtitle file (default) +.TP +--write-auto-subs +Write automatically generated subtitle file (Alias: +--write-automatic-subs) +.TP +--no-write-auto-subs +Do not write auto-generated subtitles (default) (Alias: +--no-write-automatic-subs) +.TP +--list-subs +List available subtitles of each video. +Simulate unless --no-simulate is used +.TP +--sub-format \f[I]FORMAT\f[R] +Subtitle format; accepts formats preference separated by \[dq]/\[dq], +e.g. +\[dq]srt\[dq] or \[dq]ass/srt/best\[dq] +.TP +--sub-langs \f[I]LANGS\f[R] +Languages of the subtitles to download (can be regex) or \[dq]all\[dq] +separated by commas, e.g. +--sub-langs \[dq]en.*,ja\[dq] (where \[dq]en.*\[dq] is a regex pattern +that matches \[dq]en\[dq] followed by 0 or more of any character). +You can prefix the language code with a \[dq]-\[dq] to exclude it from +the requested languages, e.g. +--sub- langs all,-live_chat. +Use --list-subs for a list of available language tags +.SS Authentication Options: +.TP +-u, --username \f[I]USERNAME\f[R] +Login with this account ID +.TP +-p, --password \f[I]PASSWORD\f[R] +Account password. +If this option is left out, yt-dlp will ask interactively +.TP +-2, --twofactor \f[I]TWOFACTOR\f[R] +Two-factor authentication code +.TP +-n, --netrc +Use .netrc authentication data +.TP +--netrc-location \f[I]PATH\f[R] +Location of .netrc authentication data; either the path or its +containing directory. +Defaults to \[ti]/.netrc +.TP +--netrc-cmd \f[I]NETRC_CMD\f[R] +Command to execute to get the credentials for an extractor. +.TP +--video-password \f[I]PASSWORD\f[R] +Video-specific password +.TP +--ap-mso \f[I]MSO\f[R] +Adobe Pass multiple-system operator (TV provider) identifier, use +--ap-list-mso for a list of available MSOs +.TP +--ap-username \f[I]USERNAME\f[R] +Multiple-system operator account login +.TP +--ap-password \f[I]PASSWORD\f[R] +Multiple-system operator account password. +If this option is left out, yt-dlp will ask interactively +.TP +--ap-list-mso +List all supported multiple-system operators +.TP +--client-certificate \f[I]CERTFILE\f[R] +Path to client certificate file in PEM format. +May include the private key +.TP +--client-certificate-key \f[I]KEYFILE\f[R] +Path to private key file for client certificate +.TP +--client-certificate-password \f[I]PASSWORD\f[R] +Password for client certificate private key, if encrypted. +If not provided, and the key is encrypted, yt-dlp will ask interactively +.SS Post-Processing Options: +.TP +-x, --extract-audio +Convert video files to audio-only files (requires ffmpeg and ffprobe) +.TP +--audio-format \f[I]FORMAT\f[R] +Format to convert the audio to when -x is used. +(currently supported: best (default), aac, alac, flac, m4a, mp3, opus, +vorbis, wav). +You can specify multiple rules using similar syntax as --remux-video +.TP +--audio-quality \f[I]QUALITY\f[R] +Specify ffmpeg audio quality to use when converting the audio with -x. +Insert a value between 0 (best) and 10 (worst) for VBR or a specific +bitrate like 128K (default 5) +.TP +--remux-video \f[I]FORMAT\f[R] +Remux the video into another container if necessary (currently +supported: avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac, +m4a, mka, mp3, ogg, opus, vorbis, wav). +If the target container does not support the video/audio codec, remuxing +will fail. +You can specify multiple rules; e.g. +\[dq]aac>m4a/mov>mp4/mkv\[dq] will remux aac to m4a, mov to mp4 and +anything else to mkv +.TP +--recode-video \f[I]FORMAT\f[R] +Re-encode the video into another format if necessary. +The syntax and supported formats are the same as --remux-video +.TP +--postprocessor-args \f[I]NAME:ARGS\f[R] +Give these arguments to the postprocessors. +Specify the postprocessor/executable name and the arguments separated by +a colon \[dq]:\[dq] to give the argument to the specified +postprocessor/executable. +Supported PP are: Merger, ModifyChapters, SplitChapters, ExtractAudio, +VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail, +SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a, +FixupM3u8, FixupTimestamp and FixupDuration. +The supported executables are: AtomicParsley, FFmpeg and FFprobe. +You can also specify \[dq]PP+EXE:ARGS\[dq] to give the arguments to the +specified executable only when being used by the specified +postprocessor. +Additionally, for ffmpeg/ffprobe, \[dq]_i\[dq]/\[dq]_o\[dq] can be +appended to the prefix optionally followed by a number to pass the +argument before the specified input/output file, e.g. +--ppa \[dq]Merger+ffmpeg_i1:-v quiet\[dq]. +You can use this option multiple times to give different arguments to +different postprocessors. +(Alias: --ppa) +.TP +-k, --keep-video +Keep the intermediate video file on disk after post-processing +.TP +--no-keep-video +Delete the intermediate video file after post-processing (default) +.TP +--post-overwrites +Overwrite post-processed files (default) +.TP +--no-post-overwrites +Do not overwrite post-processed files +.TP +--embed-subs +Embed subtitles in the video (only for mp4, webm and mkv videos) +.TP +--no-embed-subs +Do not embed subtitles (default) +.TP +--embed-thumbnail +Embed thumbnail in the video as cover art +.TP +--no-embed-thumbnail +Do not embed thumbnail (default) +.TP +--embed-metadata +Embed metadata to the video file. +Also embeds chapters/infojson if present unless +--no-embed-chapters/--no-embed-info-json are used (Alias: +--add-metadata) +.TP +--no-embed-metadata +Do not add metadata to file (default) (Alias: --no-add-metadata) +.TP +--embed-chapters +Add chapter markers to the video file (Alias: --add-chapters) +.TP +--no-embed-chapters +Do not add chapter markers (default) (Alias: --no-add-chapters) +.TP +--embed-info-json +Embed the infojson as an attachment to mkv/mka video files +.TP +--no-embed-info-json +Do not embed the infojson as an attachment to the video file +.TP +--parse-metadata \f[I][WHEN:]FROM:TO\f[R] +Parse additional metadata like title/artist from other fields; see +\[dq]MODIFYING METADATA\[dq] for details. +Supported values of \[dq]WHEN\[dq] are the same as that of +--use-postprocessor (default: pre_process) +.TP +--replace-in-metadata \f[I][WHEN:]FIELDS REGEX REPLACE\f[R] +Replace text in a metadata field using the given regex. +This option can be used multiple times. +Supported values of \[dq]WHEN\[dq] are the same as that of +--use-postprocessor (default: pre_process) +.TP +--xattrs +Write metadata to the video file\[aq]s xattrs (using Dublin Core and XDG +standards) +.TP +--concat-playlist \f[I]POLICY\f[R] +Concatenate videos in a playlist. +One of \[dq]never\[dq], \[dq]always\[dq], or \[dq]multi_video\[dq] +(default; only when the videos form a single show). +All the video files must have the same codecs and number of streams to +be concatenable. +The \[dq]pl_video:\[dq] prefix can be used with \[dq]--paths\[dq] and +\[dq]--output\[dq] to set the output filename for the concatenated +files. +See \[dq]OUTPUT TEMPLATE\[dq] for details +.TP +--fixup \f[I]POLICY\f[R] +Automatically correct known faults of the file. +One of never (do nothing), warn (only emit a warning), detect_or_warn +(the default; fix the file if we can, warn otherwise), force (try fixing +even if the file already exists) +.TP +--ffmpeg-location \f[I]PATH\f[R] +Location of the ffmpeg binary; either the path to the binary or its +containing directory +.TP +--exec \f[I][WHEN:]CMD\f[R] +Execute a command, optionally prefixed with when to execute it, +separated by a \[dq]:\[dq]. +Supported values of \[dq]WHEN\[dq] are the same as that of +--use-postprocessor (default: after_move). +The same syntax as the output template can be used to pass any field as +arguments to the command. +If no fields are passed, %(filepath,_filename|)q is appended to the end +of the command. +This option can be used multiple times +.TP +--no-exec +Remove any previously defined --exec +.TP +--convert-subs \f[I]FORMAT\f[R] +Convert the subtitles to another format (currently supported: ass, lrc, +srt, vtt). +Use \[dq]--convert-subs none\[dq] to disable conversion (default) +(Alias: --convert- subtitles) +.TP +--convert-thumbnails \f[I]FORMAT\f[R] +Convert the thumbnails to another format (currently supported: jpg, png, +webp). +You can specify multiple rules using similar syntax as +\[dq]--remux-video\[dq]. +Use \[dq]--convert- thumbnails none\[dq] to disable conversion (default) +.TP +--split-chapters +Split video into multiple files based on internal chapters. +The \[dq]chapter:\[dq] prefix can be used with \[dq]--paths\[dq] and +\[dq]--output\[dq] to set the output filename for the split files. +See \[dq]OUTPUT TEMPLATE\[dq] for details +.TP +--no-split-chapters +Do not split video based on chapters (default) +.TP +--remove-chapters \f[I]REGEX\f[R] +Remove chapters whose title matches the given regular expression. +The syntax is the same as --download-sections. +This option can be used multiple times +.TP +--no-remove-chapters +Do not remove any chapters from the file (default) +.TP +--force-keyframes-at-cuts +Force keyframes at cuts when downloading/splitting/removing sections. +This is slow due to needing a re-encode, but the resulting video may +have fewer artifacts around the cuts +.TP +--no-force-keyframes-at-cuts +Do not force keyframes around the chapters when cutting/splitting +(default) +.TP +--use-postprocessor \f[I]NAME[:ARGS]\f[R] +The (case-sensitive) name of plugin postprocessors to be enabled, and +(optionally) arguments to be passed to it, separated by a colon +\[dq]:\[dq]. +ARGS are a semicolon \[dq];\[dq] delimited list of NAME=VALUE. +The \[dq]when\[dq] argument determines when the postprocessor is +invoked. +It can be one of \[dq]pre_process\[dq] (after video extraction), +\[dq]after_filter\[dq] (after video passes filter), \[dq]video\[dq] +(after --format; before --print/--output), \[dq]before_dl\[dq] (before +each video download), \[dq]post_process\[dq] (after each video download; +default), \[dq]after_move\[dq] (after moving the video file to its final +location), \[dq]after_video\[dq] (after downloading and processing all +formats of a video), or \[dq]playlist\[dq] (at end of playlist). +This option can be used multiple times to add different postprocessors +.SS SponsorBlock Options: +.PP +Make chapter entries for, or remove various segments (sponsor, +introductions, etc.) +from downloaded YouTube videos using the SponsorBlock +API (https://sponsor.ajay.app) +.TP +--sponsorblock-mark \f[I]CATS\f[R] +SponsorBlock categories to create chapters for, separated by commas. +Available categories are sponsor, intro, outro, selfpromo, preview, +filler, interaction, music_offtopic, poi_highlight, chapter, all and +default (=all). +You can prefix the category with a \[dq]-\[dq] to exclude it. +See [1] for descriptions of the categories. +E.g. +--sponsorblock-mark all,-preview [1] +https://wiki.sponsor.ajay.app/w/Segment_Categories +.TP +--sponsorblock-remove \f[I]CATS\f[R] +SponsorBlock categories to be removed from the video file, separated by +commas. +If a category is present in both mark and remove, remove takes +precedence. +The syntax and available categories are the same as for +--sponsorblock-mark except that \[dq]default\[dq] refers to +\[dq]all,-filler\[dq] and poi_highlight, chapter are not available +.TP +--sponsorblock-chapter-title \f[I]TEMPLATE\f[R] +An output template for the title of the SponsorBlock chapters created by +--sponsorblock-mark. +The only available fields are start_time, end_time, category, +categories, name, category_names. +Defaults to \[dq][SponsorBlock]: %(category_names)l\[dq] +.TP +--no-sponsorblock +Disable both --sponsorblock-mark and --sponsorblock-remove +.TP +--sponsorblock-api \f[I]URL\f[R] +SponsorBlock API location, defaults to https://sponsor.ajay.app +.SS Extractor Options: +.TP +--extractor-retries \f[I]RETRIES\f[R] +Number of retries for known extractor errors (default is 3), or +\[dq]infinite\[dq] +.TP +--allow-dynamic-mpd +Process dynamic DASH manifests (default) (Alias: +--no-ignore-dynamic-mpd) +.TP +--ignore-dynamic-mpd +Do not process dynamic DASH manifests (Alias: --no-allow-dynamic-mpd) +.TP +--hls-split-discontinuity +Split HLS playlists to different formats at discontinuities such as ad +breaks +.TP +--no-hls-split-discontinuity +Do not split HLS playlists into different formats at discontinuities +such as ad breaks (default) +.TP +--extractor-args \f[I]IE_KEY:ARGS\f[R] +Pass ARGS arguments to the IE_KEY extractor. +See \[dq]EXTRACTOR ARGUMENTS\[dq] for details. +You can use this option multiple times to give arguments for different +extractors +.SS Preset Aliases: +.TP +-t \f[I]mp3\f[R] +-f \[aq]ba[acodec\[ha]=mp3]/ba/b\[aq] -x --audio-format mp3 +.TP +-t \f[I]aac\f[R] +-f \[aq]ba[acodec\[ha]=aac]/ba[acodec\[ha]=mp4a.40.]/ba/b\[aq] -x +--audio-format aac +.TP +-t \f[I]mp4\f[R] +--merge-output-format mp4 --remux-video mp4 -S +vcodec:h264,lang,quality,res,fps,hdr:12,a codec:aac +.TP +-t \f[I]mkv\f[R] +--merge-output-format mkv --remux-video mkv +.TP +-t \f[I]sleep\f[R] +--sleep-subtitles 5 --sleep-requests 0.75 --sleep-interval 10 +--max-sleep-interval 20 +.SH CONFIGURATION +.PP +You can configure yt-dlp by placing any supported command line option in +a configuration file. +The configuration is loaded from the following locations: +.IP "1." 3 +\f[B]Main Configuration\f[R]: +.RS 4 +.IP \[bu] 2 +The file given to \f[V]--config-location\f[R] +.RE +.IP "2." 3 +\f[B]Portable Configuration\f[R]: (Recommended for portable +installations) +.RS 4 +.IP \[bu] 2 +If using a binary, \f[V]yt-dlp.conf\f[R] in the same directory as the +binary +.IP \[bu] 2 +If running from source-code, \f[V]yt-dlp.conf\f[R] in the parent +directory of \f[V]yt_dlp\f[R] +.RE +.IP "3." 3 +\f[B]Home Configuration\f[R]: +.RS 4 +.IP \[bu] 2 +\f[V]yt-dlp.conf\f[R] in the home path given to \f[V]-P\f[R] +.IP \[bu] 2 +If \f[V]-P\f[R] is not given, the current directory is searched +.RE +.IP "4." 3 +\f[B]User Configuration\f[R]: +.RS 4 +.IP \[bu] 2 +\f[V]${XDG_CONFIG_HOME}/yt-dlp.conf\f[R] +.IP \[bu] 2 +\f[V]${XDG_CONFIG_HOME}/yt-dlp/config\f[R] (recommended on Linux/macOS) +.IP \[bu] 2 +\f[V]${XDG_CONFIG_HOME}/yt-dlp/config.txt\f[R] +.IP \[bu] 2 +\f[V]${APPDATA}/yt-dlp.conf\f[R] +.IP \[bu] 2 +\f[V]${APPDATA}/yt-dlp/config\f[R] (recommended on Windows) +.IP \[bu] 2 +\f[V]${APPDATA}/yt-dlp/config.txt\f[R] +.IP \[bu] 2 +\f[V]\[ti]/yt-dlp.conf\f[R] +.IP \[bu] 2 +\f[V]\[ti]/yt-dlp.conf.txt\f[R] +.IP \[bu] 2 +\f[V]\[ti]/.yt-dlp/config\f[R] +.IP \[bu] 2 +\f[V]\[ti]/.yt-dlp/config.txt\f[R] +See also: Notes about environment variables +.RE +.IP "5." 3 +\f[B]System Configuration\f[R]: +.RS 4 +.IP \[bu] 2 +\f[V]/etc/yt-dlp.conf\f[R] +.IP \[bu] 2 +\f[V]/etc/yt-dlp/config\f[R] +.IP \[bu] 2 +\f[V]/etc/yt-dlp/config.txt\f[R] +.RE +.PP +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 +\f[V]YouTube\f[R] directory in your home directory: +.IP +.nf +\f[C] +# Lines starting with # are comments + +# Always extract audio +-x + +# Do not copy the mtime +--no-mtime + +# Use this proxy +--proxy 127.0.0.1:3128 + +# Save all videos under YouTube directory in your home directory +-o \[ti]/YouTube/%(title)s.%(ext)s +\f[R] +.fi +.PP +\f[B]Note\f[R]: Options in a configuration file are just the same +options aka switches used in regular command line calls; thus there +\f[B]must be no whitespace\f[R] after \f[V]-\f[R] or \f[V]--\f[R], e.g. +\f[V]-o\f[R] or \f[V]--proxy\f[R] but not \f[V]- o\f[R] or +\f[V]-- proxy\f[R]. +They must also be quoted when necessary, as if it were a UNIX shell. +.PP +You can use \f[V]--ignore-config\f[R] if you want to disable all +configuration files for a particular yt-dlp run. +If \f[V]--ignore-config\f[R] 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 \f[V]--ignore-config\f[R] +is found inside the system configuration file, the user configuration is +not loaded. +.SS Configuration file encoding +.PP +The configuration files are decoded according to the UTF BOM if present, +and in the encoding from system locale otherwise. +.PP +If you want your file to be decoded differently, add +\f[V]# coding: ENCODING\f[R] to the beginning of the file (e.g. +\f[V]# coding: shift-jis\f[R]). +There must be no characters before that, even spaces or BOM. +.SS Authentication with netrc +.PP +You may also want to configure automatic credentials storage for +extractors that support authentication (by providing login and password +with \f[V]--username\f[R] and \f[V]--password\f[R]) 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 \f[V].netrc\f[R] +file (https://stackoverflow.com/tags/.netrc/info) on a per-extractor +basis. +For that, you will need to create a \f[V].netrc\f[R] file in +\f[V]--netrc-location\f[R] and restrict permissions to read/write by +only you: +.IP +.nf +\f[C] +touch ${HOME}/.netrc +chmod a-rwx,u+rw ${HOME}/.netrc +\f[R] +.fi +.PP +After that, you can add credentials for an extractor in the following +format, where \f[I]extractor\f[R] is the name of the extractor in +lowercase: +.IP +.nf +\f[C] +machine login password +\f[R] +.fi +.PP +E.g. +.IP +.nf +\f[C] +machine youtube login myaccount\[at]gmail.com password my_youtube_password +machine twitch login my_twitch_account_name password my_twitch_password +\f[R] +.fi +.PP +To activate authentication with the \f[V].netrc\f[R] file you should +pass \f[V]--netrc\f[R] to yt-dlp or place it in the configuration file. +.PP +The default location of the .netrc file is \f[V]\[ti]\f[R] (see below). +.PP +As an alternative to using the \f[V].netrc\f[R] file, which has the +disadvantage of keeping your passwords in a plain text file, you can +configure a custom shell command to provide the credentials for an +extractor. +This is done by providing the \f[V]--netrc-cmd\f[R] parameter, it shall +output the credentials in the netrc format and return \f[V]0\f[R] on +success, other values will be treated as an error. +\f[V]{}\f[R] in the command will be replaced by the name of the +extractor to make it possible to select the credentials for the right +extractor. +.PP +E.g. +To use an encrypted \f[V].netrc\f[R] file stored as +\f[V].authinfo.gpg\f[R] +.IP +.nf +\f[C] +yt-dlp --netrc-cmd \[aq]gpg --decrypt \[ti]/.authinfo.gpg\[aq] \[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq] +\f[R] +.fi +.SS Notes about environment variables +.IP \[bu] 2 +Environment variables are normally specified as +\f[V]${VARIABLE}\f[R]/\f[V]$VARIABLE\f[R] on UNIX and +\f[V]%VARIABLE%\f[R] on Windows; but is always shown as +\f[V]${VARIABLE}\f[R] in this documentation +.IP \[bu] 2 +yt-dlp also allows using UNIX-style variables on Windows for path-like +options; e.g. +\f[V]--output\f[R], \f[V]--config-location\f[R] +.IP \[bu] 2 +If unset, \f[V]${XDG_CONFIG_HOME}\f[R] defaults to +\f[V]\[ti]/.config\f[R] and \f[V]${XDG_CACHE_HOME}\f[R] to +\f[V]\[ti]/.cache\f[R] +.IP \[bu] 2 +On Windows, \f[V]\[ti]\f[R] points to \f[V]${HOME}\f[R] if present; or, +\f[V]${USERPROFILE}\f[R] or \f[V]${HOMEDRIVE}${HOMEPATH}\f[R] otherwise +.IP \[bu] 2 +On Windows, \f[V]${USERPROFILE}\f[R] generally points to +\f[V]C:\[rs]Users\[rs]\f[R] and \f[V]${APPDATA}\f[R] to +\f[V]${USERPROFILE}\[rs]AppData\[rs]Roaming\f[R] +.SH OUTPUT TEMPLATE +.PP +The \f[V]-o\f[R] option is used to indicate a template for the output +file names while \f[V]-P\f[R] option is used to specify the path each +type of file should be saved to. +.PP +The simplest usage of \f[V]-o\f[R] is not to set any template arguments +when downloading a single file, like in +\f[V]yt-dlp -o funny_video.flv \[dq]https://some/video\[dq]\f[R] +(hard-coding file extension like this is \f[I]not\f[R] recommended and +could break some post-processing). +.PP +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. +\f[V]%(NAME)s\f[R] or \f[V]%(NAME)05d\f[R]. +To clarify, that is a percent symbol followed by a name in parentheses, +followed by formatting operations. +.PP +The field names themselves (the part inside the parenthesis) can also +have some special formatting: +.IP "1." 3 +\f[B]Object traversal\f[R]: The dictionaries and lists available in +metadata can be traversed by using a dot \f[V].\f[R] separator; e.g. +\f[V]%(tags.0)s\f[R], \f[V]%(subtitles.en.-1.ext)s\f[R]. +You can do Python slicing with colon \f[V]:\f[R]; E.g. +\f[V]%(id.3:7)s\f[R], \f[V]%(id.6:2:-1)s\f[R], +\f[V]%(formats.:.format_id)s\f[R]. +Curly braces \f[V]{}\f[R] can be used to build dictionaries with only +specific keys; e.g. +\f[V]%(formats.:.{format_id,height})#j\f[R]. +An empty field name \f[V]%()s\f[R] refers to the entire infodict; e.g. +\f[V]%(.{id,title})s\f[R]. +Note that all the fields that become available using this method are not +listed below. +Use \f[V]-j\f[R] to see such fields +.IP "2." 3 +\f[B]Arithmetic\f[R]: Simple arithmetic can be done on numeric fields +using \f[V]+\f[R], \f[V]-\f[R] and \f[V]*\f[R]. +E.g. +\f[V]%(playlist_index+10)03d\f[R], +\f[V]%(n_entries+1-playlist_index)d\f[R] +.IP "3." 3 +\f[B]Date/time Formatting\f[R]: Date/time fields can be formatted +according to strftime +formatting (https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) +by specifying it separated from the field name using a \f[V]>\f[R]. +E.g. +\f[V]%(duration>%H-%M-%S)s\f[R], \f[V]%(upload_date>%Y-%m-%d)s\f[R], +\f[V]%(epoch-3600>%H-%M-%S)s\f[R] +.IP "4." 3 +\f[B]Alternatives\f[R]: Alternate fields can be specified separated with +a \f[V],\f[R]. +E.g. +\f[V]%(release_date>%Y,upload_date>%Y|Unknown)s\f[R] +.IP "5." 3 +\f[B]Replacement\f[R]: A replacement value can be specified using a +\f[V]&\f[R] separator according to the \f[V]str.format\f[R] +mini-language (https://docs.python.org/3/library/string.html#format-specification-mini-language). +If the field is \f[I]not\f[R] empty, this replacement value will be used +instead of the actual field content. +This is done after alternate fields are considered; thus the replacement +is used if \f[I]any\f[R] of the alternative fields is \f[I]not\f[R] +empty. +E.g. +\f[V]%(chapters&has chapters|no chapters)s\f[R], +\f[V]%(title&TITLE={:>20}|NO TITLE)s\f[R] +.IP "6." 3 +\f[B]Default\f[R]: A literal default value can be specified for when the +field is empty using a \f[V]|\f[R] separator. +This overrides \f[V]--output-na-placeholder\f[R]. +E.g. +\f[V]%(uploader|Unknown)s\f[R] +.IP "7." 3 +\f[B]More Conversions\f[R]: In addition to the normal format types +\f[V]diouxXeEfFgGcrs\f[R], yt-dlp additionally supports converting to +\f[V]B\f[R] = \f[B]B\f[R]ytes, \f[V]j\f[R] = \f[B]j\f[R]son (flag +\f[V]#\f[R] for pretty-printing, \f[V]+\f[R] for Unicode), \f[V]h\f[R] = +HTML escaping, \f[V]l\f[R] = a comma separated \f[B]l\f[R]ist (flag +\f[V]#\f[R] for \f[V]\[rs]n\f[R] newline-separated), \f[V]q\f[R] = a +string \f[B]q\f[R]uoted for the terminal (flag \f[V]#\f[R] to split a +list into different arguments), \f[V]D\f[R] = add \f[B]D\f[R]ecimal +suffixes (e.g. +10M) (flag \f[V]#\f[R] to use 1024 as factor), and \f[V]S\f[R] = +\f[B]S\f[R]anitize as filename (flag \f[V]#\f[R] for restricted) +.IP "8." 3 +\f[B]Unicode normalization\f[R]: The format type \f[V]U\f[R] can be used +for NFC Unicode +normalization (https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize). +The alternate form flag (\f[V]#\f[R]) changes the normalization to NFD +and the conversion flag \f[V]+\f[R] can be used for NFKC/NFKD +compatibility equivalence normalization. +E.g. +\f[V]%(title)+.100U\f[R] is NFKC +.PP +To summarize, the general syntax for a field is: +.IP +.nf +\f[C] +%(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type +\f[R] +.fi +.PP +Additionally, you can set different output templates for the various +metadata files separately from the general output template by specifying +the type of file followed by the template separated by a colon +\f[V]:\f[R]. +The different file types supported are \f[V]subtitle\f[R], +\f[V]thumbnail\f[R], \f[V]description\f[R], \f[V]annotation\f[R] +(deprecated), \f[V]infojson\f[R], \f[V]link\f[R], +\f[V]pl_thumbnail\f[R], \f[V]pl_description\f[R], \f[V]pl_infojson\f[R], +\f[V]chapter\f[R], \f[V]pl_video\f[R]. +E.g. +\f[V]-o \[dq]%(title)s.%(ext)s\[dq] -o \[dq]thumbnail:%(title)s\[rs]%(title)s.%(ext)s\[dq]\f[R] +will put the thumbnails in a folder with the same name as the video. +If any of the templates is empty, that type of file will not be written. +E.g. +\f[V]--write-thumbnail -o \[dq]thumbnail:\[dq]\f[R] will write +thumbnails only for playlists and not for video. +.PP +.PP +\f[B]Note\f[R]: Due to post-processing (i.e. +merging etc.), the actual output filename might differ. +Use \f[V]--print after_move:filepath\f[R] to get the name after all +post-processing is complete. +.PP +The available fields are: +.IP \[bu] 2 +\f[V]id\f[R] (string): Video identifier +.IP \[bu] 2 +\f[V]title\f[R] (string): Video title +.IP \[bu] 2 +\f[V]fulltitle\f[R] (string): Video title ignoring live timestamp and +generic title +.IP \[bu] 2 +\f[V]ext\f[R] (string): Video filename extension +.IP \[bu] 2 +\f[V]alt_title\f[R] (string): A secondary title of the video +.IP \[bu] 2 +\f[V]description\f[R] (string): The description of the video +.IP \[bu] 2 +\f[V]display_id\f[R] (string): An alternative identifier for the video +.IP \[bu] 2 +\f[V]uploader\f[R] (string): Full name of the video uploader +.IP \[bu] 2 +\f[V]uploader_id\f[R] (string): Nickname or id of the video uploader +.IP \[bu] 2 +\f[V]uploader_url\f[R] (string): URL to the video uploader\[aq]s profile +.IP \[bu] 2 +\f[V]license\f[R] (string): License name the video is licensed under +.IP \[bu] 2 +\f[V]creators\f[R] (list): The creators of the video +.IP \[bu] 2 +\f[V]creator\f[R] (string): The creators of the video; comma-separated +.IP \[bu] 2 +\f[V]timestamp\f[R] (numeric): UNIX timestamp of the moment the video +became available +.IP \[bu] 2 +\f[V]upload_date\f[R] (string): Video upload date in UTC (YYYYMMDD) +.IP \[bu] 2 +\f[V]release_timestamp\f[R] (numeric): UNIX timestamp of the moment the +video was released +.IP \[bu] 2 +\f[V]release_date\f[R] (string): The date (YYYYMMDD) when the video was +released in UTC +.IP \[bu] 2 +\f[V]release_year\f[R] (numeric): Year (YYYY) when the video or album +was released +.IP \[bu] 2 +\f[V]modified_timestamp\f[R] (numeric): UNIX timestamp of the moment the +video was last modified +.IP \[bu] 2 +\f[V]modified_date\f[R] (string): The date (YYYYMMDD) when the video was +last modified in UTC +.IP \[bu] 2 +\f[V]channel\f[R] (string): Full name of the channel the video is +uploaded on +.IP \[bu] 2 +\f[V]channel_id\f[R] (string): Id of the channel +.IP \[bu] 2 +\f[V]channel_url\f[R] (string): URL of the channel +.IP \[bu] 2 +\f[V]channel_follower_count\f[R] (numeric): Number of followers of the +channel +.IP \[bu] 2 +\f[V]channel_is_verified\f[R] (boolean): Whether the channel is verified +on the platform +.IP \[bu] 2 +\f[V]location\f[R] (string): Physical location where the video was +filmed +.IP \[bu] 2 +\f[V]duration\f[R] (numeric): Length of the video in seconds +.IP \[bu] 2 +\f[V]duration_string\f[R] (string): Length of the video (HH:mm:ss) +.IP \[bu] 2 +\f[V]view_count\f[R] (numeric): How many users have watched the video on +the platform +.IP \[bu] 2 +\f[V]concurrent_view_count\f[R] (numeric): How many users are currently +watching the video on the platform. +.IP \[bu] 2 +\f[V]like_count\f[R] (numeric): Number of positive ratings of the video +.IP \[bu] 2 +\f[V]dislike_count\f[R] (numeric): Number of negative ratings of the +video +.IP \[bu] 2 +\f[V]repost_count\f[R] (numeric): Number of reposts of the video +.IP \[bu] 2 +\f[V]average_rating\f[R] (numeric): Average rating given by users, the +scale used depends on the webpage +.IP \[bu] 2 +\f[V]comment_count\f[R] (numeric): Number of comments on the video (For +some extractors, comments are only downloaded at the end, and so this +field cannot be used) +.IP \[bu] 2 +\f[V]age_limit\f[R] (numeric): Age restriction for the video (years) +.IP \[bu] 2 +\f[V]live_status\f[R] (string): One of \[dq]not_live\[dq], +\[dq]is_live\[dq], \[dq]is_upcoming\[dq], \[dq]was_live\[dq], +\[dq]post_live\[dq] (was live, but VOD is not yet processed) +.IP \[bu] 2 +\f[V]is_live\f[R] (boolean): Whether this video is a live stream or a +fixed-length video +.IP \[bu] 2 +\f[V]was_live\f[R] (boolean): Whether this video was originally a live +stream +.IP \[bu] 2 +\f[V]playable_in_embed\f[R] (string): Whether this video is allowed to +play in embedded players on other sites +.IP \[bu] 2 +\f[V]availability\f[R] (string): Whether the video is \[dq]private\[dq], +\[dq]premium_only\[dq], \[dq]subscriber_only\[dq], \[dq]needs_auth\[dq], +\[dq]unlisted\[dq] or \[dq]public\[dq] +.IP \[bu] 2 +\f[V]media_type\f[R] (string): The type of media as classified by the +site, e.g. +\[dq]episode\[dq], \[dq]clip\[dq], \[dq]trailer\[dq] +.IP \[bu] 2 +\f[V]start_time\f[R] (numeric): Time in seconds where the reproduction +should start, as specified in the URL +.IP \[bu] 2 +\f[V]end_time\f[R] (numeric): Time in seconds where the reproduction +should end, as specified in the URL +.IP \[bu] 2 +\f[V]extractor\f[R] (string): Name of the extractor +.IP \[bu] 2 +\f[V]extractor_key\f[R] (string): Key name of the extractor +.IP \[bu] 2 +\f[V]epoch\f[R] (numeric): Unix epoch of when the information extraction +was completed +.IP \[bu] 2 +\f[V]autonumber\f[R] (numeric): Number that will be increased with each +download, starting at \f[V]--autonumber-start\f[R], padded with leading +zeros to 5 digits +.IP \[bu] 2 +\f[V]video_autonumber\f[R] (numeric): Number that will be increased with +each video +.IP \[bu] 2 +\f[V]n_entries\f[R] (numeric): Total number of extracted items in the +playlist +.IP \[bu] 2 +\f[V]playlist_id\f[R] (string): Identifier of the playlist that contains +the video +.IP \[bu] 2 +\f[V]playlist_title\f[R] (string): Name of the playlist that contains +the video +.IP \[bu] 2 +\f[V]playlist\f[R] (string): \f[V]playlist_title\f[R] if available or +else \f[V]playlist_id\f[R] +.IP \[bu] 2 +\f[V]playlist_count\f[R] (numeric): Total number of items in the +playlist. +May not be known if entire playlist is not extracted +.IP \[bu] 2 +\f[V]playlist_index\f[R] (numeric): Index of the video in the playlist +padded with leading zeros according the final index +.IP \[bu] 2 +\f[V]playlist_autonumber\f[R] (numeric): Position of the video in the +playlist download queue padded with leading zeros according to the total +length of the playlist +.IP \[bu] 2 +\f[V]playlist_uploader\f[R] (string): Full name of the playlist uploader +.IP \[bu] 2 +\f[V]playlist_uploader_id\f[R] (string): Nickname or id of the playlist +uploader +.IP \[bu] 2 +\f[V]playlist_channel\f[R] (string): Display name of the channel that +uploaded the playlist +.IP \[bu] 2 +\f[V]playlist_channel_id\f[R] (string): Identifier of the channel that +uploaded the playlist +.IP \[bu] 2 +\f[V]playlist_webpage_url\f[R] (string): URL of the playlist webpage +.IP \[bu] 2 +\f[V]webpage_url\f[R] (string): A URL to the video webpage which, if +given to yt-dlp, should yield the same result again +.IP \[bu] 2 +\f[V]webpage_url_basename\f[R] (string): The basename of the webpage URL +.IP \[bu] 2 +\f[V]webpage_url_domain\f[R] (string): The domain of the webpage URL +.IP \[bu] 2 +\f[V]original_url\f[R] (string): The URL given by the user (or the same +as \f[V]webpage_url\f[R] for playlist entries) +.IP \[bu] 2 +\f[V]categories\f[R] (list): List of categories the video belongs to +.IP \[bu] 2 +\f[V]tags\f[R] (list): List of tags assigned to the video +.IP \[bu] 2 +\f[V]cast\f[R] (list): List of cast members +.PP +All the fields in Filtering Formats can also be used +.PP +Available for the video that belongs to some logical chapter or section: +.IP \[bu] 2 +\f[V]chapter\f[R] (string): Name or title of the chapter the video +belongs to +.IP \[bu] 2 +\f[V]chapter_number\f[R] (numeric): Number of the chapter the video +belongs to +.IP \[bu] 2 +\f[V]chapter_id\f[R] (string): Id of the chapter the video belongs to +.PP +Available for the video that is an episode of some series or program: +.IP \[bu] 2 +\f[V]series\f[R] (string): Title of the series or program the video +episode belongs to +.IP \[bu] 2 +\f[V]series_id\f[R] (string): Id of the series or program the video +episode belongs to +.IP \[bu] 2 +\f[V]season\f[R] (string): Title of the season the video episode belongs +to +.IP \[bu] 2 +\f[V]season_number\f[R] (numeric): Number of the season the video +episode belongs to +.IP \[bu] 2 +\f[V]season_id\f[R] (string): Id of the season the video episode belongs +to +.IP \[bu] 2 +\f[V]episode\f[R] (string): Title of the video episode +.IP \[bu] 2 +\f[V]episode_number\f[R] (numeric): Number of the video episode within a +season +.IP \[bu] 2 +\f[V]episode_id\f[R] (string): Id of the video episode +.PP +Available for the media that is a track or a part of a music album: +.IP \[bu] 2 +\f[V]track\f[R] (string): Title of the track +.IP \[bu] 2 +\f[V]track_number\f[R] (numeric): Number of the track within an album or +a disc +.IP \[bu] 2 +\f[V]track_id\f[R] (string): Id of the track +.IP \[bu] 2 +\f[V]artists\f[R] (list): Artist(s) of the track +.IP \[bu] 2 +\f[V]artist\f[R] (string): Artist(s) of the track; comma-separated +.IP \[bu] 2 +\f[V]genres\f[R] (list): Genre(s) of the track +.IP \[bu] 2 +\f[V]genre\f[R] (string): Genre(s) of the track; comma-separated +.IP \[bu] 2 +\f[V]composers\f[R] (list): Composer(s) of the piece +.IP \[bu] 2 +\f[V]composer\f[R] (string): Composer(s) of the piece; comma-separated +.IP \[bu] 2 +\f[V]album\f[R] (string): Title of the album the track belongs to +.IP \[bu] 2 +\f[V]album_type\f[R] (string): Type of the album +.IP \[bu] 2 +\f[V]album_artists\f[R] (list): All artists appeared on the album +.IP \[bu] 2 +\f[V]album_artist\f[R] (string): All artists appeared on the album; +comma-separated +.IP \[bu] 2 +\f[V]disc_number\f[R] (numeric): Number of the disc or other physical +medium the track belongs to +.PP +Available only when using \f[V]--download-sections\f[R] and for +\f[V]chapter:\f[R] prefix when using \f[V]--split-chapters\f[R] for +videos with internal chapters: +.IP \[bu] 2 +\f[V]section_title\f[R] (string): Title of the chapter +.IP \[bu] 2 +\f[V]section_number\f[R] (numeric): Number of the chapter within the +file +.IP \[bu] 2 +\f[V]section_start\f[R] (numeric): Start time of the chapter in seconds +.IP \[bu] 2 +\f[V]section_end\f[R] (numeric): End time of the chapter in seconds +.PP +Available only when used in \f[V]--print\f[R]: +.IP \[bu] 2 +\f[V]urls\f[R] (string): The URLs of all requested formats, one in each +line +.IP \[bu] 2 +\f[V]filename\f[R] (string): Name of the video file. +Note that the actual filename may differ +.IP \[bu] 2 +\f[V]formats_table\f[R] (table): The video format table as printed by +\f[V]--list-formats\f[R] +.IP \[bu] 2 +\f[V]thumbnails_table\f[R] (table): The thumbnail format table as +printed by \f[V]--list-thumbnails\f[R] +.IP \[bu] 2 +\f[V]subtitles_table\f[R] (table): The subtitle format table as printed +by \f[V]--list-subs\f[R] +.IP \[bu] 2 +\f[V]automatic_captions_table\f[R] (table): The automatic subtitle +format table as printed by \f[V]--list-subs\f[R] +.PP +Available only after the video is downloaded +(\f[V]post_process\f[R]/\f[V]after_move\f[R]): +.IP \[bu] 2 +\f[V]filepath\f[R]: Actual path of downloaded video file +.PP +Available only in \f[V]--sponsorblock-chapter-title\f[R]: +.IP \[bu] 2 +\f[V]start_time\f[R] (numeric): Start time of the chapter in seconds +.IP \[bu] 2 +\f[V]end_time\f[R] (numeric): End time of the chapter in seconds +.IP \[bu] 2 +\f[V]categories\f[R] (list): The SponsorBlock +categories (https://wiki.sponsor.ajay.app/w/Types#Category) the chapter +belongs to +.IP \[bu] 2 +\f[V]category\f[R] (string): The smallest SponsorBlock category the +chapter belongs to +.IP \[bu] 2 +\f[V]category_names\f[R] (list): Friendly names of the categories +.IP \[bu] 2 +\f[V]name\f[R] (string): Friendly name of the smallest category +.IP \[bu] 2 +\f[V]type\f[R] (string): The SponsorBlock action +type (https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter +.PP +Each aforementioned sequence when referenced in an output template will +be replaced by the actual value corresponding to the sequence name. +E.g. +for \f[V]-o %(title)s-%(id)s.%(ext)s\f[R] and an mp4 video with title +\f[V]yt-dlp test video\f[R] and id \f[V]BaW_jenozKc\f[R], this will +result in a \f[V]yt-dlp test video-BaW_jenozKc.mp4\f[R] file created in +the current directory. +.PP +\f[B]Note\f[R]: 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 +\f[V]--output-na-placeholder\f[R] (\f[V]NA\f[R] by default). +.PP +\f[B]Tip\f[R]: Look at the \f[V]-j\f[R] output to identify which fields +are available for the particular URL +.PP +For numeric sequences, you can use numeric related +formatting (https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting); +e.g. +\f[V]%(view_count)05d\f[R] will result in a string with view count +padded with zeros up to 5 characters, like in \f[V]00042\f[R]. +.PP +Output templates can also contain arbitrary hierarchical path, e.g. +\f[V]-o \[dq]%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq]\f[R] +which will result in downloading each video in a directory corresponding +to this path template. +Any missing directory will be automatically created for you. +.PP +To use percent literals in an output template use \f[V]%%\f[R]. +To output to stdout use \f[V]-o -\f[R]. +.PP +The current default template is \f[V]%(title)s [%(id)s].%(ext)s\f[R]. +.PP +In some cases, you don\[aq]t want special characters such as 中, spaces, +or &, such as when transferring the downloaded filename to a Windows +system or the filename through an 8bit-unsafe channel. +In these cases, add the \f[V]--restrict-filenames\f[R] flag to get a +shorter title. +.SS Output template examples +.IP +.nf +\f[C] +$ yt-dlp --print filename -o \[dq]test video.%(ext)s\[dq] BaW_jenozKc +test video.webm # Literal name with correct extension + +$ yt-dlp --print filename -o \[dq]%(title)s.%(ext)s\[dq] BaW_jenozKc +youtube-dl test video \[aq]\[aq]_ä↭𝕐.webm # All kinds of weird characters + +$ yt-dlp --print filename -o \[dq]%(title)s.%(ext)s\[dq] 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 \[dq]%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\[dq] + +# Download YouTube playlist videos in separate directories according to their uploaded year +$ yt-dlp -o \[dq]%(upload_date>%Y)s/%(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\[dq] + +# Prefix playlist index with \[dq] - \[dq] separator, but only if it is available +$ yt-dlp -o \[dq]%(playlist_index&{} - |)s%(title)s.%(ext)s\[dq] BaW_jenozKc \[dq]https://www.youtube.com/user/TheLinuxFoundation/playlists\[dq] + +# Download all playlists of YouTube channel/user keeping each playlist in separate directory: +$ yt-dlp -o \[dq]%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/user/TheLinuxFoundation/playlists\[dq] + +# Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home +$ yt-dlp -u user -p password -P \[dq]\[ti]/MyVideos\[dq] -o \[dq]%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s\[dq] \[dq]https://www.udemy.com/java-tutorial\[dq] + +# Download entire series season keeping each series and each season in separate directory under C:/MyVideos +$ yt-dlp -P \[dq]C:/MyVideos\[dq] -o \[dq]%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s\[dq] \[dq]https://videomore.ru/kino_v_detalayah/5_sezon/367617\[dq] + +# Download video as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]title.ext\[dq], subtitles as \[dq]C:\[rs]MyVideos\[rs]subs\[rs]uploader\[rs]title.ext\[dq] +# and put all temporary files in \[dq]C:\[rs]MyVideos\[rs]tmp\[dq] +$ yt-dlp -P \[dq]C:/MyVideos\[dq] -P \[dq]temp:tmp\[dq] -P \[dq]subtitle:subs\[dq] -o \[dq]%(uploader)s/%(title)s.%(ext)s\[dq] BaW_jenozKc --write-subs + +# Download video as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]title.ext\[dq] and subtitles as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]subs\[rs]title.ext\[dq] +$ yt-dlp -P \[dq]C:/MyVideos\[dq] -o \[dq]%(uploader)s/%(title)s.%(ext)s\[dq] -o \[dq]subtitle:%(uploader)s/subs/%(title)s.%(ext)s\[dq] BaW_jenozKc --write-subs + +# Stream the video being downloaded to stdout +$ yt-dlp -o - BaW_jenozKc +\f[R] +.fi +.SH FORMAT SELECTION +.PP +By default, yt-dlp tries to download the best available quality if you +\f[B]don\[aq]t\f[R] pass any options. +This is generally equivalent to using +\f[V]-f bestvideo*+bestaudio/best\f[R]. +However, if multiple audiostreams is enabled +(\f[V]--audio-multistreams\f[R]), the default format changes to +\f[V]-f bestvideo+bestaudio/best\f[R]. +Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to +\f[V]stdout\f[R] (\f[V]-o -\f[R]), the default becomes +\f[V]-f best/bestvideo+bestaudio\f[R]. +.PP +\f[B]Deprecation warning\f[R]: 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[V]-f bv*+ba/b\f[R] similar to normal downloads. +If you want to preserve the \f[V]-f b/bv+ba\f[R] setting, it is +recommended to explicitly specify it in the configuration options. +.PP +The general syntax for format selection is \f[V]-f FORMAT\f[R] (or +\f[V]--format FORMAT\f[R]) where \f[V]FORMAT\f[R] is a \f[I]selector +expression\f[R], i.e. +an expression that describes format or formats you would like to +download. +.PP +The simplest case is requesting a specific format; e.g. +with \f[V]-f 22\f[R] you can download the format with format code equal +to 22. +You can get the list of available format codes for particular video +using \f[V]--list-formats\f[R] or \f[V]-F\f[R]. +Note that these format codes are extractor specific. +.PP +You can also use a file extension (currently \f[V]3gp\f[R], +\f[V]aac\f[R], \f[V]flv\f[R], \f[V]m4a\f[R], \f[V]mp3\f[R], +\f[V]mp4\f[R], \f[V]ogg\f[R], \f[V]wav\f[R], \f[V]webm\f[R] are +supported) to download the best quality format of a particular file +extension served as a single file, e.g. +\f[V]-f webm\f[R] will download the best quality format with the +\f[V]webm\f[R] extension served as a single file. +.PP +You can use \f[V]-f -\f[R] to interactively provide the format selector +\f[I]for each video\f[R] +.PP +You can also use special names to select particular edge case formats: +.IP \[bu] 2 +\f[V]all\f[R]: Select \f[B]all formats\f[R] separately +.IP \[bu] 2 +\f[V]mergeall\f[R]: Select and \f[B]merge all formats\f[R] (Must be used +with \f[V]--audio-multistreams\f[R], \f[V]--video-multistreams\f[R] or +both) +.IP \[bu] 2 +\f[V]b*\f[R], \f[V]best*\f[R]: Select the best quality format that +\f[B]contains either\f[R] a video or an audio or both (i.e.; +\f[V]vcodec!=none or acodec!=none\f[R]) +.IP \[bu] 2 +\f[V]b\f[R], \f[V]best\f[R]: Select the best quality format that +\f[B]contains both\f[R] video and audio. +Equivalent to \f[V]best*[vcodec!=none][acodec!=none]\f[R] +.IP \[bu] 2 +\f[V]bv\f[R], \f[V]bestvideo\f[R]: Select the best quality +\f[B]video-only\f[R] format. +Equivalent to \f[V]best*[acodec=none]\f[R] +.IP \[bu] 2 +\f[V]bv*\f[R], \f[V]bestvideo*\f[R]: Select the best quality format that +\f[B]contains video\f[R]. +It may also contain audio. +Equivalent to \f[V]best*[vcodec!=none]\f[R] +.IP \[bu] 2 +\f[V]ba\f[R], \f[V]bestaudio\f[R]: Select the best quality +\f[B]audio-only\f[R] format. +Equivalent to \f[V]best*[vcodec=none]\f[R] +.IP \[bu] 2 +\f[V]ba*\f[R], \f[V]bestaudio*\f[R]: Select the best quality format that +\f[B]contains audio\f[R]. +It may also contain video. +Equivalent to \f[V]best*[acodec!=none]\f[R] (Do not +use! (https://github.com/yt-dlp/yt-dlp/issues/979#issuecomment-919629354)) +.IP \[bu] 2 +\f[V]w*\f[R], \f[V]worst*\f[R]: Select the worst quality format that +contains either a video or an audio +.IP \[bu] 2 +\f[V]w\f[R], \f[V]worst\f[R]: Select the worst quality format that +contains both video and audio. +Equivalent to \f[V]worst*[vcodec!=none][acodec!=none]\f[R] +.IP \[bu] 2 +\f[V]wv\f[R], \f[V]worstvideo\f[R]: Select the worst quality video-only +format. +Equivalent to \f[V]worst*[acodec=none]\f[R] +.IP \[bu] 2 +\f[V]wv*\f[R], \f[V]worstvideo*\f[R]: Select the worst quality format +that contains video. +It may also contain audio. +Equivalent to \f[V]worst*[vcodec!=none]\f[R] +.IP \[bu] 2 +\f[V]wa\f[R], \f[V]worstaudio\f[R]: Select the worst quality audio-only +format. +Equivalent to \f[V]worst*[vcodec=none]\f[R] +.IP \[bu] 2 +\f[V]wa*\f[R], \f[V]worstaudio*\f[R]: Select the worst quality format +that contains audio. +It may also contain video. +Equivalent to \f[V]worst*[acodec!=none]\f[R] +.PP +For example, to download the worst quality video-only format you can use +\f[V]-f worstvideo\f[R]. +It is, however, recommended not to use \f[V]worst\f[R] and related +options. +When your format selector is \f[V]worst\f[R], the format which is worst +in all respects is selected. +Most of the time, what you actually want is the video with the smallest +filesize instead. +So it is generally better to use \f[V]-S +size\f[R] or more rigorously, +\f[V]-S +size,+br,+res,+fps\f[R] instead of \f[V]-f worst\f[R]. +See Sorting Formats for more details. +.PP +You can select the n\[aq]th best format of a type by using +\f[V]best.\f[R]. +For example, \f[V]best.2\f[R] will select the 2nd best combined format. +Similarly, \f[V]bv*.3\f[R] will select the 3rd best format that contains +a video stream. +.PP +If you want to download multiple videos, and they don\[aq]t have the +same formats available, you can specify the order of preference using +slashes. +Note that formats on the left hand side are preferred; e.g. +\f[V]-f 22/17/18\f[R] will download format 22 if it\[aq]s available, +otherwise it will download format 17 if it\[aq]s available, otherwise it +will download format 18 if it\[aq]s available, otherwise it will +complain that no suitable formats are available for download. +.PP +If you want to download several formats of the same video use a comma as +a separator, e.g. +\f[V]-f 22,17,18\f[R] will download all these three formats, of course +if they are available. +Or a more sophisticated example combined with the precedence feature: +\f[V]-f 136/137/mp4/bestvideo,140/m4a/bestaudio\f[R]. +.PP +You can merge the video and audio of multiple formats into a single file +using \f[V]-f ++...\f[R] (requires ffmpeg installed); +e.g. +\f[V]-f bestvideo+bestaudio\f[R] will download the best video-only +format, the best audio-only format and mux them together with ffmpeg. +.PP +\f[B]Deprecation warning\f[R]: Since the \f[I]below\f[R] described +behavior is complex and counter-intuitive, this will be removed and +multistreams will be enabled by default in the future. +A new operator will be instead added to limit formats to single +audio/video +.PP +Unless \f[V]--video-multistreams\f[R] is used, all formats with a video +stream except the first one are ignored. +Similarly, unless \f[V]--audio-multistreams\f[R] is used, all formats +with an audio stream except the first one are ignored. +E.g. +\f[V]-f bestvideo+best+bestaudio --video-multistreams --audio-multistreams\f[R] +will download and merge all 3 given formats. +The resulting file will have 2 video streams and 2 audio streams. +But \f[V]-f bestvideo+best+bestaudio --no-video-multistreams\f[R] will +download and merge only \f[V]bestvideo\f[R] and \f[V]bestaudio\f[R]. +\f[V]best\f[R] is ignored since another format containing a video stream +(\f[V]bestvideo\f[R]) has already been selected. +The order of the formats is therefore important. +\f[V]-f best+bestaudio --no-audio-multistreams\f[R] will download only +\f[V]best\f[R] while \f[V]-f bestaudio+best --no-audio-multistreams\f[R] +will ignore \f[V]best\f[R] and download only \f[V]bestaudio\f[R]. +.SS Filtering Formats +.PP +You can also filter the video formats by putting a condition in +brackets, as in \f[V]-f \[dq]best[height=720]\[dq]\f[R] (or +\f[V]-f \[dq][filesize>10M]\[dq]\f[R] since filters without a selector +are interpreted as \f[V]best\f[R]). +.PP +The following numeric meta fields can be used with comparisons +\f[V]<\f[R], \f[V]<=\f[R], \f[V]>\f[R], \f[V]>=\f[R], \f[V]=\f[R] +(equals), \f[V]!=\f[R] (not equals): +.IP \[bu] 2 +\f[V]filesize\f[R]: The number of bytes, if known in advance +.IP \[bu] 2 +\f[V]filesize_approx\f[R]: An estimate for the number of bytes +.IP \[bu] 2 +\f[V]width\f[R]: Width of the video, if known +.IP \[bu] 2 +\f[V]height\f[R]: Height of the video, if known +.IP \[bu] 2 +\f[V]aspect_ratio\f[R]: Aspect ratio of the video, if known +.IP \[bu] 2 +\f[V]tbr\f[R]: Average bitrate of audio and video in kbps +.IP \[bu] 2 +\f[V]abr\f[R]: Average audio bitrate in kbps +.IP \[bu] 2 +\f[V]vbr\f[R]: Average video bitrate in kbps +.IP \[bu] 2 +\f[V]asr\f[R]: Audio sampling rate in Hertz +.IP \[bu] 2 +\f[V]fps\f[R]: Frame rate +.IP \[bu] 2 +\f[V]audio_channels\f[R]: The number of audio channels +.IP \[bu] 2 +\f[V]stretched_ratio\f[R]: \f[V]width:height\f[R] of the video\[aq]s +pixels, if not square +.PP +Also filtering work for comparisons \f[V]=\f[R] (equals), +\f[V]\[ha]=\f[R] (starts with), \f[V]$=\f[R] (ends with), \f[V]*=\f[R] +(contains), \f[V]\[ti]=\f[R] (matches regex) and following string meta +fields: +.IP \[bu] 2 +\f[V]url\f[R]: Video URL +.IP \[bu] 2 +\f[V]ext\f[R]: File extension +.IP \[bu] 2 +\f[V]acodec\f[R]: Name of the audio codec in use +.IP \[bu] 2 +\f[V]vcodec\f[R]: Name of the video codec in use +.IP \[bu] 2 +\f[V]container\f[R]: Name of the container format +.IP \[bu] 2 +\f[V]protocol\f[R]: The protocol that will be used for the actual +download, lower-case (\f[V]http\f[R], \f[V]https\f[R], \f[V]rtsp\f[R], +\f[V]rtmp\f[R], \f[V]rtmpe\f[R], \f[V]mms\f[R], \f[V]f4m\f[R], +\f[V]ism\f[R], \f[V]http_dash_segments\f[R], \f[V]m3u8\f[R], or +\f[V]m3u8_native\f[R]) +.IP \[bu] 2 +\f[V]language\f[R]: Language code +.IP \[bu] 2 +\f[V]dynamic_range\f[R]: The dynamic range of the video +.IP \[bu] 2 +\f[V]format_id\f[R]: A short description of the format +.IP \[bu] 2 +\f[V]format\f[R]: A human-readable description of the format +.IP \[bu] 2 +\f[V]format_note\f[R]: Additional info about the format +.IP \[bu] 2 +\f[V]resolution\f[R]: Textual description of width and height +.PP +Any string comparison may be prefixed with negation \f[V]!\f[R] in order +to produce an opposite comparison, e.g. +\f[V]!*=\f[R] (does not contain). +The comparand of a string comparison needs to be quoted with either +double or single quotes if it contains spaces or special characters +other than \f[V]._-\f[R]. +.PP +\f[B]Note\f[R]: None of the aforementioned meta fields are guaranteed to +be present since this solely depends on the metadata obtained by the +particular extractor, i.e. +the metadata offered by the website. +Any other field made available by the extractor can also be used for +filtering. +.PP +Formats for which the value is not known are excluded unless you put a +question mark (\f[V]?\f[R]) after the operator. +You can combine format filters, so +\f[V]-f \[dq]bv[height<=?720][tbr>500]\[dq]\f[R] selects up to 720p +videos (or videos where the height is not known) with a bitrate of at +least 500 kbps. +You can also use the filters with \f[V]all\f[R] to download all formats +that satisfy the filter, e.g. +\f[V]-f \[dq]all[vcodec=none]\[dq]\f[R] selects all audio-only formats. +.PP +Format selectors can also be grouped using parentheses; e.g. +\f[V]-f \[dq](mp4,webm)[height<480]\[dq]\f[R] will download the best +pre-merged mp4 and webm formats with a height lower than 480. +.SS Sorting Formats +.PP +You can change the criteria for being considered the \f[V]best\f[R] by +using \f[V]-S\f[R] (\f[V]--format-sort\f[R]). +The general format for this is \f[V]--format-sort field1,field2...\f[R]. +.PP +The available fields are: +.IP \[bu] 2 +\f[V]hasvid\f[R]: Gives priority to formats that have a video stream +.IP \[bu] 2 +\f[V]hasaud\f[R]: Gives priority to formats that have an audio stream +.IP \[bu] 2 +\f[V]ie_pref\f[R]: The format preference +.IP \[bu] 2 +\f[V]lang\f[R]: The language preference as determined by the extractor +(e.g. +original language preferred over audio description) +.IP \[bu] 2 +\f[V]quality\f[R]: The quality of the format +.IP \[bu] 2 +\f[V]source\f[R]: The preference of the source +.IP \[bu] 2 +\f[V]proto\f[R]: Protocol used for download +(\f[V]https\f[R]/\f[V]ftps\f[R] > \f[V]http\f[R]/\f[V]ftp\f[R] > +\f[V]m3u8_native\f[R]/\f[V]m3u8\f[R] > \f[V]http_dash_segments\f[R]> +\f[V]websocket_frag\f[R] > \f[V]mms\f[R]/\f[V]rtsp\f[R] > +\f[V]f4f\f[R]/\f[V]f4m\f[R]) +.IP \[bu] 2 +\f[V]vcodec\f[R]: Video Codec (\f[V]av01\f[R] > \f[V]vp9.2\f[R] > +\f[V]vp9\f[R] > \f[V]h265\f[R] > \f[V]h264\f[R] > \f[V]vp8\f[R] > +\f[V]h263\f[R] > \f[V]theora\f[R] > other) +.IP \[bu] 2 +\f[V]acodec\f[R]: Audio Codec (\f[V]flac\f[R]/\f[V]alac\f[R] > +\f[V]wav\f[R]/\f[V]aiff\f[R] > \f[V]opus\f[R] > \f[V]vorbis\f[R] > +\f[V]aac\f[R] > \f[V]mp4a\f[R] > \f[V]mp3\f[R] > \f[V]ac4\f[R] > +\f[V]eac3\f[R] > \f[V]ac3\f[R] > \f[V]dts\f[R] > other) +.IP \[bu] 2 +\f[V]codec\f[R]: Equivalent to \f[V]vcodec,acodec\f[R] +.IP \[bu] 2 +\f[V]vext\f[R]: Video Extension (\f[V]mp4\f[R] > \f[V]mov\f[R] > +\f[V]webm\f[R] > \f[V]flv\f[R] > other). +If \f[V]--prefer-free-formats\f[R] is used, \f[V]webm\f[R] is preferred. +.IP \[bu] 2 +\f[V]aext\f[R]: Audio Extension (\f[V]m4a\f[R] > \f[V]aac\f[R] > +\f[V]mp3\f[R] > \f[V]ogg\f[R] > \f[V]opus\f[R] > \f[V]webm\f[R] > +other). +If \f[V]--prefer-free-formats\f[R] is used, the order changes to +\f[V]ogg\f[R] > \f[V]opus\f[R] > \f[V]webm\f[R] > \f[V]mp3\f[R] > +\f[V]m4a\f[R] > \f[V]aac\f[R] +.IP \[bu] 2 +\f[V]ext\f[R]: Equivalent to \f[V]vext,aext\f[R] +.IP \[bu] 2 +\f[V]filesize\f[R]: Exact filesize, if known in advance +.IP \[bu] 2 +\f[V]fs_approx\f[R]: Approximate filesize +.IP \[bu] 2 +\f[V]size\f[R]: Exact filesize if available, otherwise approximate +filesize +.IP \[bu] 2 +\f[V]height\f[R]: Height of video +.IP \[bu] 2 +\f[V]width\f[R]: Width of video +.IP \[bu] 2 +\f[V]res\f[R]: Video resolution, calculated as the smallest dimension. +.IP \[bu] 2 +\f[V]fps\f[R]: Framerate of video +.IP \[bu] 2 +\f[V]hdr\f[R]: The dynamic range of the video (\f[V]DV\f[R] > +\f[V]HDR12\f[R] > \f[V]HDR10+\f[R] > \f[V]HDR10\f[R] > \f[V]HLG\f[R] > +\f[V]SDR\f[R]) +.IP \[bu] 2 +\f[V]channels\f[R]: The number of audio channels +.IP \[bu] 2 +\f[V]tbr\f[R]: Total average bitrate in kbps +.IP \[bu] 2 +\f[V]vbr\f[R]: Average video bitrate in kbps +.IP \[bu] 2 +\f[V]abr\f[R]: Average audio bitrate in kbps +.IP \[bu] 2 +\f[V]br\f[R]: Average bitrate in kbps, +\f[V]tbr\f[R]/\f[V]vbr\f[R]/\f[V]abr\f[R] +.IP \[bu] 2 +\f[V]asr\f[R]: Audio sample rate in Hz +.PP +\f[B]Deprecation warning\f[R]: 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. +.PP +All fields, unless specified otherwise, are sorted in descending order. +To reverse this, prefix the field with a \f[V]+\f[R]. +E.g. +\f[V]+res\f[R] prefers format with the smallest resolution. +Additionally, you can suffix a preferred value for the fields, separated +by a \f[V]:\f[R]. +E.g. +\f[V]res:720\f[R] prefers larger videos, but no larger than 720p and the +smallest video if there are no videos less than 720p. +For \f[V]codec\f[R] and \f[V]ext\f[R], you can provide two preferred +values, the first for video and the second for audio. +E.g. +\f[V]+codec:avc:m4a\f[R] (equivalent to +\f[V]+vcodec:avc,+acodec:m4a\f[R]) sets the video codec preference to +\f[V]h264\f[R] > \f[V]h265\f[R] > \f[V]vp9\f[R] > \f[V]vp9.2\f[R] > +\f[V]av01\f[R] > \f[V]vp8\f[R] > \f[V]h263\f[R] > \f[V]theora\f[R] and +audio codec preference to \f[V]mp4a\f[R] > \f[V]aac\f[R] > +\f[V]vorbis\f[R] > \f[V]opus\f[R] > \f[V]mp3\f[R] > \f[V]ac3\f[R] > +\f[V]dts\f[R]. +You can also make the sorting prefer the nearest values to the provided +by using \f[V]\[ti]\f[R] as the delimiter. +E.g. +\f[V]filesize\[ti]1G\f[R] prefers the format with filesize closest to 1 +GiB. +.PP +The fields \f[V]hasvid\f[R] and \f[V]ie_pref\f[R] are always given +highest priority in sorting, irrespective of the user-defined order. +This behavior can be changed by using \f[V]--format-sort-force\f[R]. +Apart from these, the default order used is: +\f[V]lang,quality,res,fps,hdr:12,vcodec,channels,acodec,size,br,asr,proto,ext,hasaud,source,id\f[R]. +The extractors may override this default order, but they cannot override +the user-provided order. +.PP +Note that the default for hdr is \f[V]hdr:12\f[R]; i.e. +Dolby Vision is not preferred. +This choice was made since DV formats are not yet fully compatible with +most devices. +This may be changed in the future. +.PP +If your format selector is \f[V]worst\f[R], the last item is selected +after sorting. +This means it will select the format that is worst in all respects. +Most of the time, what you actually want is the video with the smallest +filesize instead. +So it is generally better to use +\f[V]-f best -S +size,+br,+res,+fps\f[R]. +.PP +\f[B]Tip\f[R]: You can use the \f[V]-v -F\f[R] to see how the formats +have been sorted (worst to best). +.SS Format Selection examples +.IP +.nf +\f[C] +# 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 \[dq]bv+ba/b\[dq] + +# Download best format that contains video, +# and if it doesn\[aq]t already have an audio stream, merge it with best audio-only format +$ yt-dlp -f \[dq]bv*+ba/b\[dq] + +# Same as above +$ yt-dlp + +# 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 \[dq]bv,ba\[dq] -o \[dq]%(title)s.f%(format_id)s.%(ext)s\[dq] + +# Download and merge the best format that has a video stream, +# and all audio-only formats into one file +$ yt-dlp -f \[dq]bv*+mergeall[vcodec=none]\[dq] --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 \[dq]bv*+ba+ba.2\[dq] --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 \[dq]wv*+wa/w\[dq] + +# Download the best video available but with the smallest resolution +$ yt-dlp -S \[dq]+res\[dq] + +# Download the smallest video available +$ yt-dlp -S \[dq]+size,+br\[dq] + + + +# Download the best mp4 video available, or the best video if no mp4 available +$ yt-dlp -f \[dq]bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b\[dq] + +# Download the best video with the best extension +# (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...) +$ yt-dlp -S \[dq]ext\[dq] + + + +# Download the best video available but no better than 480p, +# or the worst video if there is no video under 480p +$ yt-dlp -f \[dq]bv*[height<=480]+ba/b[height<=480] / wv*+ba/w\[dq] + +# 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 \[dq]height:480\[dq] + +# 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 \[dq]res:480\[dq] + + + +# 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 \[dq]b[filesize<50M] / w\[dq] + +# Download the 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 \[dq]b\[dq] -S \[dq]filesize:50M\[dq] + +# Download the best video (that also has audio) that is closest in size to 50 MB +$ yt-dlp -f \[dq]b\[dq] -S \[dq]filesize\[ti]50M\[dq] + + + +# 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 \[dq](bv*+ba/b)[protocol\[ha]=http][protocol!*=dash] / (bv*+ba/b)\[dq] + +# Download best video available via the best protocol +# (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...) +$ yt-dlp -S \[dq]proto\[dq] + + + +# Download the best video with either h264 or h265 codec, +# or the best video if there is no such video +$ yt-dlp -f \[dq](bv*[vcodec\[ti]=\[aq]\[ha]((he|a)vc|h26[45])\[aq]]+ba) / (bv*+ba/b)\[dq] + +# 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 \[dq]codec:h264\[dq] + +# 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 \[dq]+codec:h264\[dq] + + + +# More complex examples + +# 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 \[dq]((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)\[dq] + +# 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 \[dq]res:720,fps\[dq] + + + +# 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 \[dq]+res:480,codec,br\[dq] +\f[R] +.fi +.SH MODIFYING METADATA +.PP +The metadata obtained by the extractors can be modified by using +\f[V]--parse-metadata\f[R] and \f[V]--replace-in-metadata\f[R] +.PP +\f[V]--replace-in-metadata FIELDS REGEX REPLACE\f[R] is used to replace +text in any metadata field using Python regular +expression (https://docs.python.org/3/library/re.html#regular-expression-syntax). +Backreferences (https://docs.python.org/3/library/re.html?highlight=backreferences#re.sub) +can be used in the replace string for advanced use. +.PP +The general syntax of \f[V]--parse-metadata FROM:TO\f[R] is to give the +name of a field or an output template to extract data from, and the +format to interpret it as, separated by a colon \f[V]:\f[R]. +Either a Python regular +expression (https://docs.python.org/3/library/re.html#regular-expression-syntax) +with named capture groups, a single field name, or a similar syntax to +the output template (only \f[V]%(field)s\f[R] formatting is supported) +can be used for \f[V]TO\f[R]. +The option can be used multiple times to parse and modify various +fields. +.PP +Note that these options preserve their relative order, allowing +replacements to be made in parsed fields and vice versa. +Also, any field thus created can be used in the output template and will +also affect the media file\[aq]s metadata added when using +\f[V]--embed-metadata\f[R]. +.PP +This option also has a few special uses: +.IP \[bu] 2 +You can download an additional URL based on the metadata of the +currently downloaded video. +To do this, set the field \f[V]additional_urls\f[R] to the URL that you +want to download. +E.g. +\f[V]--parse-metadata \[dq]description:(?Phttps?://www\[rs].vimeo\[rs].com/\[rs]d+)\[dq]\f[R] +will download the first vimeo video found in the description +.IP \[bu] 2 +You can use this to change the metadata that is embedded in the media +file. +To do this, set the value of the corresponding field with a +\f[V]meta_\f[R] prefix. +For example, any value you set to \f[V]meta_description\f[R] field will +be added to the \f[V]description\f[R] field in the file - you can use +this to set a different \[dq]description\[dq] and \[dq]synopsis\[dq]. +To modify the metadata of individual streams, use the \f[V]meta_\f[R] +prefix (e.g. +\f[V]meta1_language\f[R]). +Any value set to the \f[V]meta_\f[R] field will overwrite all default +values. +.PP +\f[B]Note\f[R]: 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. +.PP +For reference, these are the fields yt-dlp adds by default to the file +metadata: +.PP +.TS +tab(@); +lw(24.9n) lw(45.1n). +T{ +Metadata fields +T}@T{ +From +T} +_ +T{ +\f[V]title\f[R] +T}@T{ +\f[V]track\f[R] or \f[V]title\f[R] +T} +T{ +\f[V]date\f[R] +T}@T{ +\f[V]upload_date\f[R] +T} +T{ +\f[V]description\f[R], \f[V]synopsis\f[R] +T}@T{ +\f[V]description\f[R] +T} +T{ +\f[V]purl\f[R], \f[V]comment\f[R] +T}@T{ +\f[V]webpage_url\f[R] +T} +T{ +\f[V]track\f[R] +T}@T{ +\f[V]track_number\f[R] +T} +T{ +\f[V]artist\f[R] +T}@T{ +\f[V]artist\f[R], \f[V]artists\f[R], \f[V]creator\f[R], +\f[V]creators\f[R], \f[V]uploader\f[R] or \f[V]uploader_id\f[R] +T} +T{ +\f[V]composer\f[R] +T}@T{ +\f[V]composer\f[R] or \f[V]composers\f[R] +T} +T{ +\f[V]genre\f[R] +T}@T{ +\f[V]genre\f[R] or \f[V]genres\f[R] +T} +T{ +\f[V]album\f[R] +T}@T{ +\f[V]album\f[R] +T} +T{ +\f[V]album_artist\f[R] +T}@T{ +\f[V]album_artist\f[R] or \f[V]album_artists\f[R] +T} +T{ +\f[V]disc\f[R] +T}@T{ +\f[V]disc_number\f[R] +T} +T{ +\f[V]show\f[R] +T}@T{ +\f[V]series\f[R] +T} +T{ +\f[V]season_number\f[R] +T}@T{ +\f[V]season_number\f[R] +T} +T{ +\f[V]episode_id\f[R] +T}@T{ +\f[V]episode\f[R] or \f[V]episode_id\f[R] +T} +T{ +\f[V]episode_sort\f[R] +T}@T{ +\f[V]episode_number\f[R] +T} +T{ +\f[V]language\f[R] of each stream +T}@T{ +the format\[aq]s \f[V]language\f[R] +T} +.TE +.PP +\f[B]Note\f[R]: The file format may not support some of these fields +.SS Modifying metadata examples +.IP +.nf +\f[C] +# Interpret the title as \[dq]Artist - Title\[dq] +$ yt-dlp --parse-metadata \[dq]title:%(artist)s - %(title)s\[dq] + +# Regex example +$ yt-dlp --parse-metadata \[dq]description:Artist - (?P.+)\[dq] + +# Set title as \[dq]Series name S01E05\[dq] +$ yt-dlp --parse-metadata \[dq]%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s\[dq] + +# Prioritize uploader as the \[dq]artist\[dq] field in video metadata +$ yt-dlp --parse-metadata \[dq]%(uploader|)s:%(meta_artist)s\[dq] --embed-metadata + +# Set \[dq]comment\[dq] field in video metadata using description instead of webpage_url, +# handling multiple lines correctly +$ yt-dlp --parse-metadata \[dq]description:(?s)(?P.+)\[dq] --embed-metadata + +# Do not set any \[dq]synopsis\[dq] in the video metadata +$ yt-dlp --parse-metadata \[dq]:(?P)\[dq] + +# Remove \[dq]formats\[dq] field from the infojson by setting it to an empty string +$ yt-dlp --parse-metadata \[dq]video::(?P)\[dq] --write-info-json + +# Replace all spaces and \[dq]_\[dq] in title and uploader with a \[ga]-\[ga] +$ yt-dlp --replace-in-metadata \[dq]title,uploader\[dq] \[dq][ _]\[dq] \[dq]-\[dq] +\f[R] +.fi +.SH EXTRACTOR ARGUMENTS +.PP +Some extractors accept additional arguments which can be passed using +\f[V]--extractor-args KEY:ARGS\f[R]. +\f[V]ARGS\f[R] is a \f[V];\f[R] (semicolon) separated string of +\f[V]ARG=VAL1,VAL2\f[R]. +E.g. +\f[V]--extractor-args \[dq]youtube:player-client=tv,mweb;formats=incomplete\[dq] --extractor-args \[dq]twitter:api=syndication\[dq]\f[R] +.PP +Note: In CLI, \f[V]ARG\f[R] can use \f[V]-\f[R] instead of \f[V]_\f[R]; +e.g. +\f[V]youtube:player-client\[dq]\f[R] becomes +\f[V]youtube:player_client\[dq]\f[R] +.PP +The following extractors use this feature: +.SS youtube +.IP \[bu] 2 +\f[V]lang\f[R]: Prefer translated metadata (\f[V]title\f[R], +\f[V]description\f[R] etc) of this language code (case-sensitive). +By default, the video primary language metadata is preferred, with a +fallback to \f[V]en\f[R] translated. +See +youtube.py (https://github.com/yt-dlp/yt-dlp/blob/c26f9b991a0681fd3ea548d535919cec1fbbd430/yt_dlp/extractor/youtube.py#L381-L390) +for list of supported content language codes +.IP \[bu] 2 +\f[V]skip\f[R]: One or more of \f[V]hls\f[R], \f[V]dash\f[R] or +\f[V]translated_subs\f[R] to skip extraction of the m3u8 manifests, dash +manifests and auto-translated +subtitles (https://github.com/yt-dlp/yt-dlp/issues/4090#issuecomment-1158102032) +respectively +.IP \[bu] 2 +\f[V]player_client\f[R]: Clients to extract video data from. +The currently available clients are \f[V]web\f[R], \f[V]web_safari\f[R], +\f[V]web_embedded\f[R], \f[V]web_music\f[R], \f[V]web_creator\f[R], +\f[V]mweb\f[R], \f[V]ios\f[R], \f[V]android\f[R], \f[V]android_vr\f[R], +\f[V]tv\f[R] and \f[V]tv_embedded\f[R]. +By default, \f[V]tv,ios,web\f[R] is used, or \f[V]tv,web\f[R] is used +when authenticating with cookies. +The \f[V]web_music\f[R] client is added for \f[V]music.youtube.com\f[R] +URLs when logged-in cookies are used. +The \f[V]tv_embedded\f[R] and \f[V]web_creator\f[R] clients are added +for age-restricted videos if account age-verification is required. +Some clients, such as \f[V]web\f[R] and \f[V]web_music\f[R], require a +\f[V]po_token\f[R] for their formats to be downloadable. +Some clients, such as \f[V]web_creator\f[R], will only work with +authentication. +Not all clients support authentication via cookies. +You can use \f[V]default\f[R] for the default clients, or you can use +\f[V]all\f[R] for all clients (not recommended). +You can prefix a client with \f[V]-\f[R] to exclude it, e.g. +\f[V]youtube:player_client=default,-ios\f[R] +.IP \[bu] 2 +\f[V]player_skip\f[R]: Skip some network requests that are generally +needed for robust extraction. +One or more of \f[V]configs\f[R] (skip client configs), +\f[V]webpage\f[R] (skip initial webpage), \f[V]js\f[R] (skip js player), +\f[V]initial_data\f[R] (skip initial data/next ep request). +While these options can help reduce the number of requests needed or +avoid some rate-limiting, they could cause issues such as missing +formats or metadata. +See #860 (https://github.com/yt-dlp/yt-dlp/pull/860) and +#12826 (https://github.com/yt-dlp/yt-dlp/issues/12826) for more details +.IP \[bu] 2 +\f[V]player_params\f[R]: YouTube player parameters to use for player +requests. +Will overwrite any default ones set by yt-dlp. +.IP \[bu] 2 +\f[V]comment_sort\f[R]: \f[V]top\f[R] or \f[V]new\f[R] (default) - +choose comment sorting mode (on YouTube\[aq]s side) +.IP \[bu] 2 +\f[V]max_comments\f[R]: Limit the amount of comments to gather. +Comma-separated list of integers representing +\f[V]max-comments,max-parents,max-replies,max-replies-per-thread\f[R]. +Default is \f[V]all,all,all,all\f[R] +.RS 2 +.IP \[bu] 2 +E.g. +\f[V]all,all,1000,10\f[R] will get a maximum of 1000 replies total, with +up to 10 replies per thread. +\f[V]1000,all,100\f[R] will get a maximum of 1000 comments, with a +maximum of 100 replies total +.RE +.IP \[bu] 2 +\f[V]formats\f[R]: Change the types of formats to return. +\f[V]dashy\f[R] (convert HTTP to DASH), \f[V]duplicate\f[R] (identical +content but different URLs or protocol; includes \f[V]dashy\f[R]), +\f[V]incomplete\f[R] (cannot be downloaded completely - live dash and +post-live m3u8), \f[V]missing_pot\f[R] (include formats that require a +PO Token but are missing one) +.IP \[bu] 2 +\f[V]innertube_host\f[R]: Innertube API host to use for all API +requests; e.g. +\f[V]studio.youtube.com\f[R], \f[V]youtubei.googleapis.com\f[R]. +Note that cookies exported from one subdomain will not work on others +.IP \[bu] 2 +\f[V]innertube_key\f[R]: Innertube API key to use for all API requests. +By default, no API key is used +.IP \[bu] 2 +\f[V]raise_incomplete_data\f[R]: \f[V]Incomplete Data Received\f[R] +raises an error instead of reporting a warning +.IP \[bu] 2 +\f[V]data_sync_id\f[R]: Overrides the account Data Sync ID used in +Innertube API requests. +This may be needed if you are using an account with +\f[V]youtube:player_skip=webpage,configs\f[R] or +\f[V]youtubetab:skip=webpage\f[R] +.IP \[bu] 2 +\f[V]visitor_data\f[R]: Overrides the Visitor Data used in Innertube API +requests. +This should be used with \f[V]player_skip=webpage,configs\f[R] and +without cookies. +Note: this may have adverse effects if used improperly. +If a session from a browser is wanted, you should pass cookies instead +(which contain the Visitor ID) +.IP \[bu] 2 +\f[V]po_token\f[R]: Proof of Origin (PO) Token(s) to use. +Comma seperated list of PO Tokens in the format +\f[V]CLIENT.CONTEXT+PO_TOKEN\f[R], e.g. +\f[V]youtube:po_token=web.gvs+XXX,web.player=XXX,web_safari.gvs+YYY\f[R]. +Context can be either \f[V]gvs\f[R] (Google Video Server URLs) or +\f[V]player\f[R] (Innertube player request) +.IP \[bu] 2 +\f[V]player_js_variant\f[R]: The player javascript variant to use for +signature and nsig deciphering. +The known variants are: \f[V]main\f[R], \f[V]tce\f[R], \f[V]tv\f[R], +\f[V]tv_es6\f[R], \f[V]phone\f[R], \f[V]tablet\f[R]. +Only \f[V]main\f[R] is recommended as a possible workaround; the others +are for debugging purposes. +The default is to use what is prescribed by the site, and can be +selected with \f[V]actual\f[R] +.SS youtubetab (YouTube playlists, channels, feeds, etc.) +.IP \[bu] 2 +\f[V]skip\f[R]: One or more of \f[V]webpage\f[R] (skip initial webpage +download), \f[V]authcheck\f[R] (allow the download of playlists +requiring authentication when no initial webpage is downloaded. +This may cause unwanted behavior, see +#1122 (https://github.com/yt-dlp/yt-dlp/pull/1122) for more details) +.IP \[bu] 2 +\f[V]approximate_date\f[R]: Extract approximate \f[V]upload_date\f[R] +and \f[V]timestamp\f[R] in flat-playlist. +This may cause date-based filters to be slightly off +.SS generic +.IP \[bu] 2 +\f[V]fragment_query\f[R]: Passthrough any query in mpd/m3u8 manifest +URLs to their fragments if no value is provided, or else apply the query +string given as \f[V]fragment_query=VALUE\f[R]. +Note that if the stream has an HLS AES-128 key, then the query +parameters will be passed to the key URI as well, unless the +\f[V]key_query\f[R] extractor-arg is passed, or unless an external key +URI is provided via the \f[V]hls_key\f[R] extractor-arg. +Does not apply to ffmpeg +.IP \[bu] 2 +\f[V]variant_query\f[R]: Passthrough the master m3u8 URL query to its +variant playlist URLs if no value is provided, or else apply the query +string given as \f[V]variant_query=VALUE\f[R] +.IP \[bu] 2 +\f[V]key_query\f[R]: Passthrough the master m3u8 URL query to its HLS +AES-128 decryption key URI if no value is provided, or else apply the +query string given as \f[V]key_query=VALUE\f[R]. +Note that this will have no effect if the key URI is provided via the +\f[V]hls_key\f[R] extractor-arg. +Does not apply to ffmpeg +.IP \[bu] 2 +\f[V]hls_key\f[R]: An HLS AES-128 key URI \f[I]or\f[R] key (as hex), and +optionally the IV (as hex), in the form of \f[V](URI|KEY)[,IV]\f[R]; +e.g. +\f[V]generic:hls_key=ABCDEF1234567980,0xFEDCBA0987654321\f[R]. +Passing any of these values will force usage of the native HLS +downloader and override the corresponding values found in the m3u8 +playlist +.IP \[bu] 2 +\f[V]is_live\f[R]: Bypass live HLS detection and manually set +\f[V]live_status\f[R] - a value of \f[V]false\f[R] will set +\f[V]not_live\f[R], any other value (or no value) will set +\f[V]is_live\f[R] +.IP \[bu] 2 +\f[V]impersonate\f[R]: Target(s) to try and impersonate with the initial +webpage request; e.g. +\f[V]generic:impersonate=safari,chrome-110\f[R]. +Use \f[V]generic:impersonate\f[R] to impersonate any available target, +and use \f[V]generic:impersonate=false\f[R] to disable impersonation +(default) +.SS vikichannel +.IP \[bu] 2 +\f[V]video_types\f[R]: Types of videos to download - one or more of +\f[V]episodes\f[R], \f[V]movies\f[R], \f[V]clips\f[R], +\f[V]trailers\f[R] +.SS youtubewebarchive +.IP \[bu] 2 +\f[V]check_all\f[R]: Try to check more at the cost of more requests. +One or more of \f[V]thumbnails\f[R], \f[V]captures\f[R] +.SS gamejolt +.IP \[bu] 2 +\f[V]comment_sort\f[R]: \f[V]hot\f[R] (default), \f[V]you\f[R] (cookies +needed), \f[V]top\f[R], \f[V]new\f[R] - choose comment sorting mode (on +GameJolt\[aq]s side) +.SS hotstar +.IP \[bu] 2 +\f[V]res\f[R]: resolution to ignore - one or more of \f[V]sd\f[R], +\f[V]hd\f[R], \f[V]fhd\f[R] +.IP \[bu] 2 +\f[V]vcodec\f[R]: vcodec to ignore - one or more of \f[V]h264\f[R], +\f[V]h265\f[R], \f[V]dvh265\f[R] +.IP \[bu] 2 +\f[V]dr\f[R]: dynamic range to ignore - one or more of \f[V]sdr\f[R], +\f[V]hdr10\f[R], \f[V]dv\f[R] +.SS instagram +.IP \[bu] 2 +\f[V]app_id\f[R]: The value of the \f[V]X-IG-App-ID\f[R] header used for +API requests. +Default is the web app ID, \f[V]936619743392459\f[R] +.SS niconicochannelplus +.IP \[bu] 2 +\f[V]max_comments\f[R]: Maximum number of comments to extract - default +is \f[V]120\f[R] +.SS tiktok +.IP \[bu] 2 +\f[V]api_hostname\f[R]: Hostname to use for mobile API calls, e.g. +\f[V]api22-normal-c-alisg.tiktokv.com\f[R] +.IP \[bu] 2 +\f[V]app_name\f[R]: Default app name to use with mobile API calls, e.g. +\f[V]trill\f[R] +.IP \[bu] 2 +\f[V]app_version\f[R]: Default app version to use with mobile API calls +- should be set along with \f[V]manifest_app_version\f[R], e.g. +\f[V]34.1.2\f[R] +.IP \[bu] 2 +\f[V]manifest_app_version\f[R]: Default numeric app version to use with +mobile API calls, e.g. +\f[V]2023401020\f[R] +.IP \[bu] 2 +\f[V]aid\f[R]: Default app ID to use with mobile API calls, e.g. +\f[V]1180\f[R] +.IP \[bu] 2 +\f[V]app_info\f[R]: Enable mobile API extraction with one or more app +info strings in the format of +\f[V]/[app_name]/[app_version]/[manifest_app_version]/[aid]\f[R], +where \f[V]iid\f[R] is the unique app install ID. +\f[V]iid\f[R] is the only required value; all other values and their +\f[V]/\f[R] separators can be omitted, e.g. +\f[V]tiktok:app_info=1234567890123456789\f[R] or +\f[V]tiktok:app_info=123,456/trill///1180,789//34.0.1/340001\f[R] +.IP \[bu] 2 +\f[V]device_id\f[R]: Enable mobile API extraction with a genuine device +ID to be used with mobile API calls. +Default is a random 19-digit string +.SS rokfinchannel +.IP \[bu] 2 +\f[V]tab\f[R]: Which tab to download - one of \f[V]new\f[R], +\f[V]top\f[R], \f[V]videos\f[R], \f[V]podcasts\f[R], \f[V]streams\f[R], +\f[V]stacks\f[R] +.SS twitter +.IP \[bu] 2 +\f[V]api\f[R]: Select one of \f[V]graphql\f[R] (default), +\f[V]legacy\f[R] or \f[V]syndication\f[R] as the API for tweet +extraction. +Has no effect if logged in +.SS stacommu, wrestleuniverse +.IP \[bu] 2 +\f[V]device_id\f[R]: UUID value assigned by the website and used to +enforce device limits for paid livestream content. +Can be found in browser local storage +.SS twitch +.IP \[bu] 2 +\f[V]client_id\f[R]: Client ID value to be sent with GraphQL requests, +e.g. +\f[V]twitch:client_id=kimne78kx3ncx6brgo4mv6wki5h1ko\f[R] +.SS nhkradirulive (NHK らじる★らじる LIVE) +.IP \[bu] 2 +\f[V]area\f[R]: Which regional variation to extract. +Valid areas are: \f[V]sapporo\f[R], \f[V]sendai\f[R], \f[V]tokyo\f[R], +\f[V]nagoya\f[R], \f[V]osaka\f[R], \f[V]hiroshima\f[R], +\f[V]matsuyama\f[R], \f[V]fukuoka\f[R]. +Defaults to \f[V]tokyo\f[R] +.SS nflplusreplay +.IP \[bu] 2 +\f[V]type\f[R]: Type(s) of game replays to extract. +Valid types are: \f[V]full_game\f[R], \f[V]full_game_spanish\f[R], +\f[V]condensed_game\f[R] and \f[V]all_22\f[R]. +You can use \f[V]all\f[R] to extract all available replay types, which +is the default +.SS jiocinema +.IP \[bu] 2 +\f[V]refresh_token\f[R]: The \f[V]refreshToken\f[R] UUID from browser +local storage can be passed to extend the life of your login session +when logging in with \f[V]token\f[R] as username and the +\f[V]accessToken\f[R] from browser local storage as password +.SS jiosaavn +.IP \[bu] 2 +\f[V]bitrate\f[R]: Audio bitrates to request. +One or more of \f[V]16\f[R], \f[V]32\f[R], \f[V]64\f[R], \f[V]128\f[R], +\f[V]320\f[R]. +Default is \f[V]128,320\f[R] +.SS afreecatvlive +.IP \[bu] 2 +\f[V]cdn\f[R]: One or more CDN IDs to use with the API call for stream +URLs, e.g. +\f[V]gcp_cdn\f[R], \f[V]gs_cdn_pc_app\f[R], \f[V]gs_cdn_mobile_web\f[R], +\f[V]gs_cdn_pc_web\f[R] +.SS soundcloud +.IP \[bu] 2 +\f[V]formats\f[R]: Formats to request from the API. +Requested values should be in the format of +\f[V]{protocol}_{codec}\f[R], e.g. +\f[V]hls_opus,http_aac\f[R]. +The \f[V]*\f[R] character functions as a wildcard, e.g. +\f[V]*_mp3\f[R], and can be passed by itself to request all formats. +Known protocols include \f[V]http\f[R], \f[V]hls\f[R] and +\f[V]hls-aes\f[R]; known codecs include \f[V]aac\f[R], \f[V]opus\f[R] +and \f[V]mp3\f[R]. +Original \f[V]download\f[R] formats are always extracted. +Default is +\f[V]http_aac,hls_aac,http_opus,hls_opus,http_mp3,hls_mp3\f[R] +.SS orfon (orf:on) +.IP \[bu] 2 +\f[V]prefer_segments_playlist\f[R]: Prefer a playlist of program +segments instead of a single complete video when available. +If individual segments are desired, use +\f[V]--concat-playlist never --extractor-args \[dq]orfon:prefer_segments_playlist\[dq]\f[R] +.SS bilibili +.IP \[bu] 2 +\f[V]prefer_multi_flv\f[R]: Prefer extracting flv formats over mp4 for +older videos that still provide legacy formats +.SS sonylivseries +.IP \[bu] 2 +\f[V]sort_order\f[R]: Episode sort order for series extraction - one of +\f[V]asc\f[R] (ascending, oldest first) or \f[V]desc\f[R] (descending, +newest first). +Default is \f[V]asc\f[R] +.SS tver +.IP \[bu] 2 +\f[V]backend\f[R]: Backend API to use for extraction - one of +\f[V]streaks\f[R] (default) or \f[V]brightcove\f[R] (deprecated) +.PP +\f[B]Note\f[R]: These options may be changed/removed in the future +without concern for backward compatibility +.SH INSTALLATION +.PP +You can install yt-dlp using the binaries, +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 +.PP +\f[B]Note\f[R]: 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) +.SS UPDATE +.PP +You can use \f[V]yt-dlp -U\f[R] to update if you are using the release +binaries +.PP +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 +.PP +For other third-party package managers, see the +wiki (https://github.com/yt-dlp/yt-dlp/wiki/Installation#third-party-package-managers) +or refer to their documentation +.PP +.PP +There are currently three release channels for binaries: +\f[V]stable\f[R], \f[V]nightly\f[R] and \f[V]master\f[R]. +.IP \[bu] 2 +\f[V]stable\f[R] is the default channel, and many of its changes have +been tested by users of the \f[V]nightly\f[R] and \f[V]master\f[R] +channels. +.IP \[bu] 2 +The \f[V]nightly\f[R] channel has releases scheduled to build every day +around midnight UTC, for a snapshot of the project\[aq]s new patches and +changes. +This is the \f[B]recommended channel for regular users\f[R] of yt-dlp. +The \f[V]nightly\f[R] releases are available from +yt-dlp/yt-dlp-nightly-builds (https://github.com/yt-dlp/yt-dlp-nightly-builds/releases) +or as development releases of the \f[V]yt-dlp\f[R] PyPI package (which +can be installed with pip\[aq]s \f[V]--pre\f[R] flag). +.IP \[bu] 2 +The \f[V]master\f[R] channel features releases that are built after each +push to the master branch, and these will have the very latest fixes and +additions, but may also be more prone to regressions. +They are available from +yt-dlp/yt-dlp-master-builds (https://github.com/yt-dlp/yt-dlp-master-builds/releases). +.PP +When using \f[V]--update\f[R]/\f[V]-U\f[R], a release binary will only +update to its current channel. +\f[V]--update-to CHANNEL\f[R] can be used to switch to a different +channel when a newer version is available. +\f[V]--update-to [CHANNEL\[at]]TAG\f[R] can also be used to upgrade or +downgrade to specific tags from a channel. +.PP +You may also use \f[V]--update-to \f[R] +(\f[V]/\f[R]) 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. +.PP +Example usage: +.IP \[bu] 2 +\f[V]yt-dlp --update-to master\f[R] switch to the \f[V]master\f[R] +channel and update to its latest release +.IP \[bu] 2 +\f[V]yt-dlp --update-to stable\[at]2023.07.06\f[R] upgrade/downgrade to +release to \f[V]stable\f[R] channel tag \f[V]2023.07.06\f[R] +.IP \[bu] 2 +\f[V]yt-dlp --update-to 2023.10.07\f[R] upgrade/downgrade to tag +\f[V]2023.10.07\f[R] if it exists on the current channel +.IP \[bu] 2 +\f[V]yt-dlp --update-to example/yt-dlp\[at]2023.09.24\f[R] +upgrade/downgrade to the release from the \f[V]example/yt-dlp\f[R] +repository, tag \f[V]2023.09.24\f[R] +.PP +\f[B]Important\f[R]: Any user experiencing an issue with the +\f[V]stable\f[R] release should install or update to the +\f[V]nightly\f[R] release before submitting a bug report: +.IP +.nf +\f[C] +# To update to nightly from stable executable/binary: +yt-dlp --update-to nightly + +# To install nightly with pip: +python3 -m pip install -U --pre \[dq]yt-dlp[default]\[dq] +\f[R] +.fi +.SS DEPENDENCIES +.PP +Python versions 3.9+ (CPython) and 3.10+ (PyPy) are supported. +Other versions and implementations may or may not work correctly. +.PP +While all the other dependencies are optional, \f[V]ffmpeg\f[R] and +\f[V]ffprobe\f[R] are highly recommended +.SS Strongly recommended +.IP \[bu] 2 +\f[B]ffmpeg\f[R] and \f[B]ffprobe\f[R] (https://www.ffmpeg.org) - +Required for merging separate video and audio files, as well as for +various post-processing tasks. +License depends on the build (https://www.ffmpeg.org/legal.html) +.RS 2 +.PP +There are bugs in ffmpeg that cause 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 +.PP +\f[B]Important\f[R]: What you need is ffmpeg \f[I]binary\f[R], +\f[B]NOT\f[R] the Python package of the same +name (https://pypi.org/project/ffmpeg) +.RE +.SS Networking +.IP \[bu] 2 +\f[B]certifi\f[R] (https://github.com/certifi/python-certifi)* - +Provides Mozilla\[aq]s root certificate bundle. +Licensed under +MPLv2 (https://github.com/certifi/python-certifi/blob/master/LICENSE) +.IP \[bu] 2 +\f[B]brotli\f[R] (https://github.com/google/brotli)* or +\f[B]brotlicffi\f[R] (https://github.com/python-hyper/brotlicffi) - +Brotli (https://en.wikipedia.org/wiki/Brotli) content encoding support. +Both licensed under MIT +1 (https://github.com/google/brotli/blob/master/LICENSE) +2 (https://github.com/python-hyper/brotlicffi/blob/master/LICENSE) +.IP \[bu] 2 +\f[B]websockets\f[R] (https://github.com/aaugustin/websockets)* - For +downloading over websocket. +Licensed under +BSD-3-Clause (https://github.com/aaugustin/websockets/blob/main/LICENSE) +.IP \[bu] 2 +\f[B]requests\f[R] (https://github.com/psf/requests)* - HTTP library. +For HTTPS proxy and persistent connections support. +Licensed under +Apache-2.0 (https://github.com/psf/requests/blob/main/LICENSE) +.SS Impersonation +.PP +The following provide support for impersonating browser requests. +This may be required for some sites that employ TLS fingerprinting. +.IP \[bu] 2 +\f[B]curl_cffi\f[R] (https://github.com/lexiforest/curl_cffi) +(recommended) - Python binding for +curl-impersonate (https://github.com/lexiforest/curl-impersonate). +Provides impersonation targets for Chrome, Edge and Safari. +Licensed under +MIT (https://github.com/lexiforest/curl_cffi/blob/main/LICENSE) +.RS 2 +.IP \[bu] 2 +Can be installed with the \f[V]curl-cffi\f[R] group, e.g. +\f[V]pip install \[dq]yt-dlp[default,curl-cffi]\[dq]\f[R] +.IP \[bu] 2 +Currently included in \f[V]yt-dlp.exe\f[R], \f[V]yt-dlp_linux\f[R] and +\f[V]yt-dlp_macos\f[R] builds +.RE +.SS Metadata +.IP \[bu] 2 +\f[B]mutagen\f[R] (https://github.com/quodlibet/mutagen)* - For +\f[V]--embed-thumbnail\f[R] in certain formats. +Licensed under +GPLv2+ (https://github.com/quodlibet/mutagen/blob/master/COPYING) +.IP \[bu] 2 +\f[B]AtomicParsley\f[R] (https://github.com/wez/atomicparsley) - For +\f[V]--embed-thumbnail\f[R] in \f[V]mp4\f[R]/\f[V]m4a\f[R] files when +\f[V]mutagen\f[R]/\f[V]ffmpeg\f[R] cannot. +Licensed under +GPLv2+ (https://github.com/wez/atomicparsley/blob/master/COPYING) +.IP \[bu] 2 +\f[B]xattr\f[R] (https://github.com/xattr/xattr), +\f[B]pyxattr\f[R] (https://github.com/iustin/pyxattr) or +\f[B]setfattr\f[R] (http://savannah.nongnu.org/projects/attr) - For +writing xattr metadata (\f[V]--xattr\f[R]) on \f[B]Mac\f[R] and +\f[B]BSD\f[R]. +Licensed under +MIT (https://github.com/xattr/xattr/blob/master/LICENSE.txt), +LGPL2.1 (https://github.com/iustin/pyxattr/blob/master/COPYING) and +GPLv2+ (http://git.savannah.nongnu.org/cgit/attr.git/tree/doc/COPYING) +respectively +.SS Misc +.IP \[bu] 2 +\f[B]pycryptodomex\f[R] (https://github.com/Legrandin/pycryptodome)* - +For decrypting AES-128 HLS streams and various other data. +Licensed under +BSD-2-Clause (https://github.com/Legrandin/pycryptodome/blob/master/LICENSE.rst) +.IP \[bu] 2 +\f[B]phantomjs\f[R] (https://github.com/ariya/phantomjs) - Used in +extractors where javascript needs to be run. +Licensed under +BSD-3-Clause (https://github.com/ariya/phantomjs/blob/master/LICENSE.BSD) +.IP \[bu] 2 +\f[B]secretstorage\f[R] (https://github.com/mitya57/secretstorage)* - +For \f[V]--cookies-from-browser\f[R] to access the \f[B]Gnome\f[R] +keyring while decrypting cookies of \f[B]Chromium\f[R]-based browsers on +\f[B]Linux\f[R]. +Licensed under +BSD-3-Clause (https://github.com/mitya57/secretstorage/blob/master/LICENSE) +.IP \[bu] 2 +Any external downloader that you want to use with \f[V]--downloader\f[R] +.SS Deprecated +.IP \[bu] 2 +\f[B]avconv\f[R] and \f[B]avprobe\f[R] (https://www.libav.org) - Now +\f[B]deprecated\f[R] alternative to ffmpeg. +License depends on the build (https://libav.org/legal) +.IP \[bu] 2 +\f[B]sponskrub\f[R] (https://github.com/faissaloo/SponSkrub) - For using +the now \f[B]deprecated\f[R] sponskrub options. +Licensed under +GPLv3+ (https://github.com/faissaloo/SponSkrub/blob/master/LICENCE.md) +.IP \[bu] 2 +\f[B]rtmpdump\f[R] (http://rtmpdump.mplayerhq.hu) - For downloading +\f[V]rtmp\f[R] streams. +ffmpeg can be used instead with \f[V]--downloader ffmpeg\f[R]. +Licensed under GPLv2+ (http://rtmpdump.mplayerhq.hu) +.IP \[bu] 2 +\f[B]mplayer\f[R] (http://mplayerhq.hu/design7/info.html) or +\f[B]mpv\f[R] (https://mpv.io) - For downloading +\f[V]rstp\f[R]/\f[V]mms\f[R] streams. +ffmpeg can be used instead with \f[V]--downloader ffmpeg\f[R]. +Licensed under +GPLv2+ (https://github.com/mpv-player/mpv/blob/master/Copyright) +.PP +To use or redistribute the dependencies, you must agree to their +respective licensing terms. +.PP +The standalone release binaries are built with the Python interpreter +and the packages marked with \f[B]*\f[R] included. +.PP +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 +\f[V]--verbose\f[R] output +.SS COMPILE +.SS Standalone PyInstaller Builds +.PP +To build the standalone executable, you must have Python and +\f[V]pyinstaller\f[R] (plus any of yt-dlp\[aq]s optional dependencies if +needed). +The executable will be built for the same CPU architecture as the Python +used. +.PP +You can run the following commands: +.IP +.nf +\f[C] +python3 devscripts/install_deps.py --include pyinstaller +python3 devscripts/make_lazy_extractors.py +python3 -m bundle.pyinstaller +\f[R] +.fi +.PP +On some systems, you may need to use \f[V]py\f[R] or \f[V]python\f[R] +instead of \f[V]python3\f[R]. +.PP +\f[V]python -m bundle.pyinstaller\f[R] accepts any arguments that can be +passed to \f[V]pyinstaller\f[R], such as \f[V]--onefile/-F\f[R] or +\f[V]--onedir/-D\f[R], which is further documented +here (https://pyinstaller.org/en/stable/usage.html#what-to-generate). +.PP +\f[B]Note\f[R]: Pyinstaller versions below 4.4 do not +support (https://github.com/pyinstaller/pyinstaller#requirements-and-tested-platforms) +Python installed from the Windows store without using a virtual +environment. +.PP +\f[B]Important\f[R]: Running \f[V]pyinstaller\f[R] directly \f[B]instead +of\f[R] using \f[V]python -m bundle.pyinstaller\f[R] is \f[B]not\f[R] +officially supported. +This may or may not work correctly. +.SS Platform-independent Binary (UNIX) +.PP +You will need the build tools \f[V]python\f[R] (3.9+), \f[V]zip\f[R], +\f[V]make\f[R] (GNU), \f[V]pandoc\f[R]* and \f[V]pytest\f[R]*. +.PP +After installing these, simply run \f[V]make\f[R]. +.PP +You can also run \f[V]make yt-dlp\f[R] instead to compile only the +binary without updating any of the additional files. +(The build tools marked with \f[B]*\f[R] are not needed for this) +.SS Related scripts +.IP \[bu] 2 +\f[B]\f[VB]devscripts/install_deps.py\f[B]\f[R] - Install dependencies +for yt-dlp. +.IP \[bu] 2 +\f[B]\f[VB]devscripts/update-version.py\f[B]\f[R] - Update the version +number based on the current date. +.IP \[bu] 2 +\f[B]\f[VB]devscripts/set-variant.py\f[B]\f[R] - Set the build variant +of the executable. +.IP \[bu] 2 +\f[B]\f[VB]devscripts/make_changelog.py\f[B]\f[R] - Create a markdown +changelog using short commit messages and update \f[V]CONTRIBUTORS\f[R] +file. +.IP \[bu] 2 +\f[B]\f[VB]devscripts/make_lazy_extractors.py\f[B]\f[R] - Create lazy +extractors. +Running this before building the binaries (any variant) will improve +their startup performance. +Set the environment variable \f[V]YTDLP_NO_LAZY_EXTRACTORS\f[R] to +something nonempty to forcefully disable lazy extractor loading. +.PP +Note: See their \f[V]--help\f[R] for more info. +.SS Forking the project +.PP +If you fork the project on GitHub, you can run your fork\[aq]s build +workflow to automatically build the selected version(s) as artifacts. +Alternatively, you can run the release workflow or enable the nightly +workflow to create full (pre-)releases. +.SH PLUGINS +.PP +Note that \f[B]all\f[R] plugins are imported even if not invoked, and +that \f[B]there are no checks\f[R] performed on plugin code. +\f[B]Use plugins at your own risk and only if you trust the code!\f[R] +.PP +Plugins can be of \f[V]\f[R]s \f[V]extractor\f[R] or +\f[V]postprocessor\f[R]. +- 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 built-in extractors. +- Postprocessor plugins can be invoked using +\f[V]--use-postprocessor NAME\f[R]. +.PP +Plugins are loaded from the namespace packages +\f[V]yt_dlp_plugins.extractor\f[R] and +\f[V]yt_dlp_plugins.postprocessor\f[R]. +.PP +In other words, the file structure on the disk looks something like: +.IP +.nf +\f[C] + yt_dlp_plugins/ + extractor/ + myplugin.py + postprocessor/ + myplugin.py +\f[R] +.fi +.PP +yt-dlp looks for these \f[V]yt_dlp_plugins\f[R] namespace folders in +many locations (see below) and loads in plugins from \f[B]all\f[R] of +them. +Set the environment variable \f[V]YTDLP_NO_PLUGINS\f[R] to something +nonempty to disable loading plugins entirely. +.PP +See the wiki for some known +plugins (https://github.com/yt-dlp/yt-dlp/wiki/Plugins) +.SS Installing Plugins +.PP +Plugins can be installed using various methods and locations. +.IP "1." 3 +\f[B]Configuration directories\f[R]: Plugin packages (containing a +\f[V]yt_dlp_plugins\f[R] namespace folder) can be dropped into the +following standard configuration locations: +.RS 4 +.IP \[bu] 2 +\f[B]User Plugins\f[R] +.RS 2 +.IP \[bu] 2 +\f[V]${XDG_CONFIG_HOME}/yt-dlp/plugins//yt_dlp_plugins/\f[R] +(recommended on Linux/macOS) +.IP \[bu] 2 +\f[V]${XDG_CONFIG_HOME}/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.IP \[bu] 2 +\f[V]${APPDATA}/yt-dlp/plugins//yt_dlp_plugins/\f[R] +(recommended on Windows) +.IP \[bu] 2 +\f[V]${APPDATA}/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.IP \[bu] 2 +\f[V]\[ti]/.yt-dlp/plugins//yt_dlp_plugins/\f[R] +.IP \[bu] 2 +\f[V]\[ti]/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.RE +.IP \[bu] 2 +\f[B]System Plugins\f[R] +.RS 2 +.IP \[bu] 2 +\f[V]/etc/yt-dlp/plugins//yt_dlp_plugins/\f[R] +.IP \[bu] 2 +\f[V]/etc/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.RE +.RE +.IP "2." 3 +\f[B]Executable location\f[R]: Plugin packages can similarly be +installed in a \f[V]yt-dlp-plugins\f[R] directory under the executable +location (recommended for portable installations): +.RS 4 +.IP \[bu] 2 +Binary: where \f[V]/yt-dlp.exe\f[R], +\f[V]/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.IP \[bu] 2 +Source: where \f[V]/yt_dlp/__main__.py\f[R], +\f[V]/yt-dlp-plugins//yt_dlp_plugins/\f[R] +.RE +.IP "3." 3 +\f[B]pip and other locations in \f[VB]PYTHONPATH\f[B]\f[R] +.RS 4 +.IP \[bu] 2 +Plugin packages can be installed and managed using \f[V]pip\f[R]. +See +yt-dlp-sample-plugins (https://github.com/yt-dlp/yt-dlp-sample-plugins) +for an example. +.RS 2 +.IP \[bu] 2 +Note: plugin files between plugin packages installed with pip must have +unique filenames. +.RE +.IP \[bu] 2 +Any path in \f[V]PYTHONPATH\f[R] is searched in for the +\f[V]yt_dlp_plugins\f[R] namespace folder. +.RS 2 +.IP \[bu] 2 +Note: This does not apply for Pyinstaller builds. +.RE +.RE +.PP +\f[V].zip\f[R], \f[V].egg\f[R] and \f[V].whl\f[R] archives containing a +\f[V]yt_dlp_plugins\f[R] namespace folder in their root are also +supported as plugin packages. +.IP \[bu] 2 +e.g. +\f[V]${XDG_CONFIG_HOME}/yt-dlp/plugins/mypluginpkg.zip\f[R] where +\f[V]mypluginpkg.zip\f[R] contains +\f[V]yt_dlp_plugins//myplugin.py\f[R] +.PP +Run yt-dlp with \f[V]--verbose\f[R] to check if the plugin has been +loaded. +.SS Developing Plugins +.PP +See the +yt-dlp-sample-plugins (https://github.com/yt-dlp/yt-dlp-sample-plugins) +repo for a template plugin package and the Plugin +Development (https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development) +section of the wiki for a plugin development guide. +.PP +All public classes with a name ending in \f[V]IE\f[R]/\f[V]PP\f[R] are +imported from each file for extractors and postprocessors respectively. +This respects underscore prefix (e.g. +\f[V]_MyBasePluginIE\f[R] is private) and \f[V]__all__\f[R]. +Modules can similarly be excluded by prefixing the module name with an +underscore (e.g. +\f[V]_myplugin.py\f[R]). +.PP +To replace an existing extractor with a subclass of one, set the +\f[V]plugin_name\f[R] class keyword argument (e.g. +\f[V]class MyPluginIE(ABuiltInIE, plugin_name=\[aq]myplugin\[aq])\f[R] +will replace \f[V]ABuiltInIE\f[R] with \f[V]MyPluginIE\f[R]). +Since the extractor replaces the parent, you should exclude the subclass +extractor from being imported separately by making it private using one +of the methods described above. +.PP +If you are a plugin author, add +yt-dlp-plugins (https://github.com/topics/yt-dlp-plugins) as a topic to +your repository for discoverability. +.PP +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. +.SH EMBEDDING YT-DLP +.PP +yt-dlp makes the best effort to be a good command-line program, and thus +should be callable from any programming language. +.PP +Your program should avoid parsing the normal stdout since they may +change in future versions. +Instead, they should use options such as \f[V]-J\f[R], +\f[V]--print\f[R], \f[V]--progress-template\f[R], \f[V]--exec\f[R] etc +to create console output that you can reliably reproduce and parse. +.PP +From a Python program, you can embed yt-dlp in a more powerful fashion, +like this: +.IP +.nf +\f[C] +from yt_dlp import YoutubeDL + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] +with YoutubeDL() as ydl: + ydl.download(URLS) +\f[R] +.fi +.PP +Most likely, you\[aq]ll want to use various options. +For a list of options available, have a look at +\f[V]yt_dlp/YoutubeDL.py\f[R] or \f[V]help(yt_dlp.YoutubeDL)\f[R] in a +Python shell. +If you are already familiar with the CLI, you can use +\f[V]devscripts/cli_to_api.py\f[R] (https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/cli_to_api.py) +to translate any CLI switches to \f[V]YoutubeDL\f[R] params. +.PP +\f[B]Tip\f[R]: 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 \f[V]YoutubeDL.extract_info\f[R] 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 +\f[V]YoutubeDL.sanitize_info\f[R] as shown in the example below +.SS Embedding examples +.SS Extracting information +.IP +.nf +\f[C] +import json +import yt_dlp + +URL = \[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq] + +# ℹ️ See help(yt_dlp.YoutubeDL) for a list of available options and public functions +ydl_opts = {} +with yt_dlp.YoutubeDL(ydl_opts) as ydl: + info = ydl.extract_info(URL, download=False) + + # ℹ️ ydl.sanitize_info makes the info json-serializable + print(json.dumps(ydl.sanitize_info(info))) +\f[R] +.fi +.SS Download using an info-json +.IP +.nf +\f[C] +import yt_dlp + +INFO_FILE = \[aq]path/to/video.info.json\[aq] + +with yt_dlp.YoutubeDL() as ydl: + error_code = ydl.download_with_info_file(INFO_FILE) + +print(\[aq]Some videos failed to download\[aq] if error_code + else \[aq]All videos successfully downloaded\[aq]) +\f[R] +.fi +.SS Extract audio +.IP +.nf +\f[C] +import yt_dlp + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] + +ydl_opts = { + \[aq]format\[aq]: \[aq]m4a/bestaudio/best\[aq], + # ℹ️ See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments + \[aq]postprocessors\[aq]: [{ # Extract audio using ffmpeg + \[aq]key\[aq]: \[aq]FFmpegExtractAudio\[aq], + \[aq]preferredcodec\[aq]: \[aq]m4a\[aq], + }] +} + +with yt_dlp.YoutubeDL(ydl_opts) as ydl: + error_code = ydl.download(URLS) +\f[R] +.fi +.SS Filter videos +.IP +.nf +\f[C] +import yt_dlp + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] + +def longer_than_a_minute(info, *, incomplete): + \[dq]\[dq]\[dq]Download only videos longer than a minute (or with unknown duration)\[dq]\[dq]\[dq] + duration = info.get(\[aq]duration\[aq]) + if duration and duration < 60: + return \[aq]The video is too short\[aq] + +ydl_opts = { + \[aq]match_filter\[aq]: longer_than_a_minute, +} + +with yt_dlp.YoutubeDL(ydl_opts) as ydl: + error_code = ydl.download(URLS) +\f[R] +.fi +.SS Adding logger and progress hook +.IP +.nf +\f[C] +import yt_dlp + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] + +class MyLogger: + def debug(self, msg): + # For compatibility with youtube-dl, both debug and info are passed into debug + # You can distinguish them by the prefix \[aq][debug] \[aq] + if msg.startswith(\[aq][debug] \[aq]): + pass + else: + self.info(msg) + + def info(self, msg): + pass + + def warning(self, msg): + pass + + def error(self, msg): + print(msg) + + +# ℹ️ See \[dq]progress_hooks\[dq] in help(yt_dlp.YoutubeDL) +def my_hook(d): + if d[\[aq]status\[aq]] == \[aq]finished\[aq]: + print(\[aq]Done downloading, now post-processing ...\[aq]) + + +ydl_opts = { + \[aq]logger\[aq]: MyLogger(), + \[aq]progress_hooks\[aq]: [my_hook], +} + +with yt_dlp.YoutubeDL(ydl_opts) as ydl: + ydl.download(URLS) +\f[R] +.fi +.SS Add a custom PostProcessor +.IP +.nf +\f[C] +import yt_dlp + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] + +# ℹ️ See help(yt_dlp.postprocessor.PostProcessor) +class MyCustomPP(yt_dlp.postprocessor.PostProcessor): + def run(self, info): + self.to_screen(\[aq]Doing stuff\[aq]) + return [], info + + +with yt_dlp.YoutubeDL() as ydl: + # ℹ️ \[dq]when\[dq] can take any value in yt_dlp.utils.POSTPROCESS_WHEN + ydl.add_post_processor(MyCustomPP(), when=\[aq]pre_process\[aq]) + ydl.download(URLS) +\f[R] +.fi +.SS Use a custom format selector +.IP +.nf +\f[C] +import yt_dlp + +URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]] + +def format_selector(ctx): + \[dq]\[dq]\[dq] Select the best video and the best audio that won\[aq]t result in an mkv. + NOTE: This is just an example and does not handle all cases \[dq]\[dq]\[dq] + + # formats are already sorted worst to best + formats = ctx.get(\[aq]formats\[aq])[::-1] + + # acodec=\[aq]none\[aq] means there is no audio + best_video = next(f for f in formats + if f[\[aq]vcodec\[aq]] != \[aq]none\[aq] and f[\[aq]acodec\[aq]] == \[aq]none\[aq]) + + # find compatible audio extension + audio_ext = {\[aq]mp4\[aq]: \[aq]m4a\[aq], \[aq]webm\[aq]: \[aq]webm\[aq]}[best_video[\[aq]ext\[aq]]] + # vcodec=\[aq]none\[aq] means there is no video + best_audio = next(f for f in formats if ( + f[\[aq]acodec\[aq]] != \[aq]none\[aq] and f[\[aq]vcodec\[aq]] == \[aq]none\[aq] and f[\[aq]ext\[aq]] == audio_ext)) + + # These are the minimum required fields for a merged format + yield { + \[aq]format_id\[aq]: f\[aq]{best_video[\[dq]format_id\[dq]]}+{best_audio[\[dq]format_id\[dq]]}\[aq], + \[aq]ext\[aq]: best_video[\[aq]ext\[aq]], + \[aq]requested_formats\[aq]: [best_video, best_audio], + # Must be + separated list of protocols + \[aq]protocol\[aq]: f\[aq]{best_video[\[dq]protocol\[dq]]}+{best_audio[\[dq]protocol\[dq]]}\[aq] + } + + +ydl_opts = { + \[aq]format\[aq]: format_selector, +} + +with yt_dlp.YoutubeDL(ydl_opts) as ydl: + ydl.download(URLS) +\f[R] +.fi +.SH CHANGES FROM YOUTUBE-DL +.SS New features +.IP \[bu] 2 +Forked from +\f[B]yt-dlc\[at]f9401f2\f[R] (https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee) +and merged with +\f[B]youtube-dl\[at]a08f2b7\f[R] (https://github.com/ytdl-org/youtube-dl/commit/a08f2b7e4567cdc50c0614ee0a4ffdff49b8b6e6) +(exceptions (https://github.com/yt-dlp/yt-dlp/issues/21)) +.IP \[bu] 2 +\f[B]SponsorBlock Integration\f[R]: You can mark/remove sponsor sections +in YouTube videos by utilizing the +SponsorBlock (https://sponsor.ajay.app) API +.IP \[bu] 2 +\f[B]Format Sorting\f[R]: 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 \f[V]-S\f[R]. +This allows for much easier format selection than what is possible by +simply using \f[V]--format\f[R] (examples) +.IP \[bu] 2 +\f[B]Merged with animelover1984/youtube-dl\f[R]: You get most of the +features and improvements from +animelover1984/youtube-dl (https://github.com/animelover1984/youtube-dl) +including \f[V]--write-comments\f[R], \f[V]BiliBiliSearch\f[R], +\f[V]BilibiliChannel\f[R], Embedding thumbnail in mp4/ogg/opus, playlist +infojson etc. +See #31 (https://github.com/yt-dlp/yt-dlp/pull/31) for details. +.IP \[bu] 2 +\f[B]YouTube improvements\f[R]: +.RS 2 +.IP \[bu] 2 +Supports Clips, Stories (\f[V]ytstories:\f[R]), Search +(including filters)\f[B]*\f[R], YouTube Music Search, Channel-specific +search, Search prefixes (\f[V]ytsearch:\f[R], +\f[V]ytsearchdate:\f[R])\f[B]*\f[R], Mixes, and Feeds (\f[V]:ytfav\f[R], +\f[V]:ytwatchlater\f[R], \f[V]:ytsubs\f[R], \f[V]:ythistory\f[R], +\f[V]:ytrec\f[R], \f[V]:ytnotif\f[R]) +.IP \[bu] 2 +Fix for n-sig based +throttling (https://github.com/ytdl-org/youtube-dl/issues/29326) +\f[B]*\f[R] +.IP \[bu] 2 +Download livestreams from the start using \f[V]--live-from-start\f[R] +(\f[I]experimental\f[R]) +.IP \[bu] 2 +Channel URLs download all uploads of the channel, including shorts and +live +.IP \[bu] 2 +Support for logging in with +OAuth (https://github.com/yt-dlp/yt-dlp/wiki/Extractors#logging-in-with-oauth) +.RE +.IP \[bu] 2 +\f[B]Cookies from browser\f[R]: Cookies can be automatically extracted +from all major web browsers using +\f[V]--cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER]\f[R] +.IP \[bu] 2 +\f[B]Download time range\f[R]: Videos can be downloaded partially based +on either timestamps or chapters using \f[V]--download-sections\f[R] +.IP \[bu] 2 +\f[B]Split video by chapters\f[R]: Videos can be split into multiple +files based on chapters using \f[V]--split-chapters\f[R] +.IP \[bu] 2 +\f[B]Multi-threaded fragment downloads\f[R]: Download multiple fragments +of m3u8/mpd videos in parallel. +Use \f[V]--concurrent-fragments\f[R] (\f[V]-N\f[R]) option to set the +number of threads used +.IP \[bu] 2 +\f[B]Aria2c with HLS/DASH\f[R]: You can use \f[V]aria2c\f[R] as the +external downloader for DASH(mpd) and HLS(m3u8) formats +.IP \[bu] 2 +\f[B]New and fixed extractors\f[R]: Many new extractors have been added +and a lot of existing ones have been fixed. +See the changelog or the list of supported sites +.IP \[bu] 2 +\f[B]New MSOs\f[R]: Philo, Spectrum, SlingTV, Cablevision, RCN etc. +.IP \[bu] 2 +\f[B]Subtitle extraction from manifests\f[R]: Subtitles can be extracted +from streaming media manifests. +See +commit/be6202f (https://github.com/yt-dlp/yt-dlp/commit/be6202f12b97858b9d716e608394b51065d0419f) +for details +.IP \[bu] 2 +\f[B]Multiple paths and output templates\f[R]: You can give different +output templates and download paths for different types of files. +You can also set a temporary path where intermediary files are +downloaded to using \f[V]--paths\f[R] (\f[V]-P\f[R]) +.IP \[bu] 2 +\f[B]Portable Configuration\f[R]: Configuration files are automatically +loaded from the home and root directories. +See CONFIGURATION for details +.IP \[bu] 2 +\f[B]Output template improvements\f[R]: Output templates can now have +date-time formatting, numeric offsets, object traversal etc. +See output template for details. +Even more advanced operations can also be done with the help of +\f[V]--parse-metadata\f[R] and \f[V]--replace-in-metadata\f[R] +.IP \[bu] 2 +\f[B]Other new options\f[R]: Many new options have been added such as +\f[V]--alias\f[R], \f[V]--print\f[R], \f[V]--concat-playlist\f[R], +\f[V]--wait-for-video\f[R], \f[V]--retry-sleep\f[R], +\f[V]--sleep-requests\f[R], \f[V]--convert-thumbnails\f[R], +\f[V]--force-download-archive\f[R], \f[V]--force-overwrites\f[R], +\f[V]--break-match-filters\f[R] etc +.IP \[bu] 2 +\f[B]Improvements\f[R]: Regex and other operators in +\f[V]--format\f[R]/\f[V]--match-filters\f[R], multiple +\f[V]--postprocessor-args\f[R] and \f[V]--downloader-args\f[R], faster +archive checking, more format selection options, merge +multi-video/audio, multiple \f[V]--config-locations\f[R], +\f[V]--exec\f[R] at different stages, etc +.IP \[bu] 2 +\f[B]Plugins\f[R]: Extractors and PostProcessors can be loaded from an +external file. +See plugins for details +.IP \[bu] 2 +\f[B]Self updater\f[R]: The releases can be updated using +\f[V]yt-dlp -U\f[R], and downgraded using \f[V]--update-to\f[R] if +required +.IP \[bu] 2 +\f[B]Automated builds\f[R]: Nightly/master builds can be used with +\f[V]--update-to nightly\f[R] and \f[V]--update-to master\f[R] +.PP +See changelog or commits (https://github.com/yt-dlp/yt-dlp/commits) for +the full list of changes +.PP +Features marked with a \f[B]*\f[R] have been back-ported to youtube-dl +.SS Differences in default behavior +.PP +Some of yt-dlp\[aq]s default options are different from that of +youtube-dl and youtube-dlc: +.IP \[bu] 2 +yt-dlp supports only Python 3.9+, and will 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) +.IP \[bu] 2 +The options \f[V]--auto-number\f[R] (\f[V]-A\f[R]), \f[V]--title\f[R] +(\f[V]-t\f[R]) and \f[V]--literal\f[R] (\f[V]-l\f[R]), no longer work. +See removed options for details +.IP \[bu] 2 +\f[V]avconv\f[R] is not supported as an alternative to \f[V]ffmpeg\f[R] +.IP \[bu] 2 +yt-dlp stores config files in slightly different locations to +youtube-dl. +See CONFIGURATION for a list of correct locations +.IP \[bu] 2 +The default output template is \f[V]%(title)s [%(id)s].%(ext)s\f[R]. +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 \f[V]%(title)s-%(id)s.%(ext)s\f[R]. +Instead, you may use \f[V]--compat-options filename\f[R] +.IP \[bu] 2 +The default format sorting is different from youtube-dl and prefers +higher resolution and better codecs rather than higher bitrates. +You can use the \f[V]--format-sort\f[R] option to change this to any +order you prefer, or use \f[V]--compat-options format-sort\f[R] to use +youtube-dl\[aq]s sorting order. +Older versions of yt-dlp preferred VP9 due to its broader compatibility; +you can use \f[V]--compat-options prefer-vp9-sort\f[R] to revert to that +format sorting preference. +These two compat options cannot be used together +.IP \[bu] 2 +The default format selector is \f[V]bv*+ba/b\f[R]. +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[V]-f bv+ba/b\f[R] or \f[V]--compat-options format-spec\f[R] to +revert this +.IP \[bu] 2 +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[V]-f bv*+ba\f[R]). +If needed, this feature must be enabled using +\f[V]--audio-multistreams\f[R] and \f[V]--video-multistreams\f[R]. +You can also use \f[V]--compat-options multistreams\f[R] to enable both +.IP \[bu] 2 +\f[V]--no-abort-on-error\f[R] is enabled by default. +Use \f[V]--abort-on-error\f[R] or +\f[V]--compat-options abort-on-error\f[R] to abort on errors instead +.IP \[bu] 2 +When writing metadata files such as thumbnails, description or infojson, +the same information (if available) is also written for playlists. +Use \f[V]--no-write-playlist-metafiles\f[R] or +\f[V]--compat-options no-playlist-metafiles\f[R] to not write these +files +.IP \[bu] 2 +\f[V]--add-metadata\f[R] attaches the \f[V]infojson\f[R] to +\f[V]mkv\f[R] files in addition to writing the metadata when used with +\f[V]--write-info-json\f[R]. +Use \f[V]--no-embed-info-json\f[R] or +\f[V]--compat-options no-attach-info-json\f[R] to revert this +.IP \[bu] 2 +Some metadata are embedded into different fields when using +\f[V]--add-metadata\f[R] as compared to youtube-dl. +Most notably, \f[V]comment\f[R] field contains the \f[V]webpage_url\f[R] +and \f[V]synopsis\f[R] contains the \f[V]description\f[R]. +You can use \f[V]--parse-metadata\f[R] to modify this to your liking or +use \f[V]--compat-options embed-metadata\f[R] to revert this +.IP \[bu] 2 +\f[V]playlist_index\f[R] behaves differently when used with options like +\f[V]--playlist-reverse\f[R] and \f[V]--playlist-items\f[R]. +See #302 (https://github.com/yt-dlp/yt-dlp/issues/302) for details. +You can use \f[V]--compat-options playlist-index\f[R] if you want to +keep the earlier behavior +.IP \[bu] 2 +The output of \f[V]-F\f[R] is listed in a new format. +Use \f[V]--compat-options list-formats\f[R] to revert this +.IP \[bu] 2 +Live chats (if available) are considered as subtitles. +Use \f[V]--sub-langs all,-live_chat\f[R] to download all subtitles +except live chat. +You can also use \f[V]--compat-options no-live-chat\f[R] to prevent any +live chat/danmaku from downloading +.IP \[bu] 2 +YouTube channel URLs download all uploads of the channel. +To download only the videos in a specific tab, pass the tab\[aq]s URL. +If the channel does not show the requested tab, an error will be raised. +Also, \f[V]/live\f[R] URLs raise an error if there are no live videos +instead of silently downloading the entire channel. +You may use \f[V]--compat-options no-youtube-channel-redirect\f[R] to +revert all these redirections +.IP \[bu] 2 +Unavailable videos are also listed for YouTube playlists. +Use \f[V]--compat-options no-youtube-unavailable-videos\f[R] to remove +this +.IP \[bu] 2 +The upload dates extracted from YouTube are in UTC. +.IP \[bu] 2 +If \f[V]ffmpeg\f[R] is used as the downloader, the downloading and +merging of formats happen in a single step when possible. +Use \f[V]--compat-options no-direct-merge\f[R] to revert this +.IP \[bu] 2 +Thumbnail embedding in \f[V]mp4\f[R] is done with mutagen if possible. +Use \f[V]--compat-options embed-thumbnail-atomicparsley\f[R] to force +the use of AtomicParsley instead +.IP \[bu] 2 +Some internal metadata such as filenames are removed by default from the +infojson. +Use \f[V]--no-clean-infojson\f[R] or +\f[V]--compat-options no-clean-infojson\f[R] to revert this +.IP \[bu] 2 +When \f[V]--embed-subs\f[R] and \f[V]--write-subs\f[R] are used +together, the subtitles are written to disk and also embedded in the +media file. +You can use just \f[V]--embed-subs\f[R] to embed the subs and +automatically delete the separate file. +See #630 +(comment) (https://github.com/yt-dlp/yt-dlp/issues/630#issuecomment-893659460) +for more info. +\f[V]--compat-options no-keep-subs\f[R] can be used to revert this +.IP \[bu] 2 +\f[V]certifi\f[R] will be used for SSL root certificates, if installed. +If you want to use system certificates (e.g. +self-signed), use \f[V]--compat-options no-certifi\f[R] +.IP \[bu] 2 +yt-dlp\[aq]s sanitization of invalid characters in filenames is +different/smarter than in youtube-dl. +You can use \f[V]--compat-options filename-sanitization\f[R] to revert +to youtube-dl\[aq]s behavior +.IP \[bu] 2 +[STRIKEOUT:yt-dlp tries to parse the external downloader outputs into +the standard progress output if possible (Currently implemented: +aria2c (https://github.com/yt-dlp/yt-dlp/issues/5931)). +You can use \f[V]--compat-options no-external-downloader-progress\f[R] +to get the downloader output as-is] +.IP \[bu] 2 +yt-dlp versions between 2021.09.01 and 2023.01.02 applies +\f[V]--match-filters\f[R] to nested playlists. +This was an unintentional side-effect of +8f18ac (https://github.com/yt-dlp/yt-dlp/commit/8f18aca8717bb0dd49054555af8d386e5eda3a88) +and is fixed in +d7b460 (https://github.com/yt-dlp/yt-dlp/commit/d7b460d0e5fc710950582baed2e3fc616ed98a80). +Use \f[V]--compat-options playlist-match-filter\f[R] to revert this +.IP \[bu] 2 +yt-dlp versions between 2021.11.10 and 2023.06.21 estimated +\f[V]filesize_approx\f[R] values for fragmented/manifest formats. +This was added for convenience in +f2fe69 (https://github.com/yt-dlp/yt-dlp/commit/f2fe69c7b0d208bdb1f6292b4ae92bc1e1a7444a), +but was reverted in +0dff8e (https://github.com/yt-dlp/yt-dlp/commit/0dff8e4d1e6e9fb938f4256ea9af7d81f42fd54f) +due to the potentially extreme inaccuracy of the estimated values. +Use \f[V]--compat-options manifest-filesize-approx\f[R] to keep +extracting the estimated values +.IP \[bu] 2 +yt-dlp uses modern http client backends such as \f[V]requests\f[R]. +Use \f[V]--compat-options prefer-legacy-http-handler\f[R] to prefer the +legacy http handler (\f[V]urllib\f[R]) to be used for standard http +requests. +.IP \[bu] 2 +The sub-modules \f[V]swfinterp\f[R], \f[V]casefold\f[R] are removed. +.IP \[bu] 2 +Passing \f[V]--simulate\f[R] (or calling \f[V]extract_info\f[R] with +\f[V]download=False\f[R]) no longer alters the default format selection. +See #9843 (https://github.com/yt-dlp/yt-dlp/issues/9843) for details. +.PP +For ease of use, a few more compat options are available: +.IP \[bu] 2 +\f[V]--compat-options all\f[R]: Use all compat options (\f[B]Do NOT use +this!\f[R]) +.IP \[bu] 2 +\f[V]--compat-options youtube-dl\f[R]: Same as +\f[V]--compat-options all,-multistreams,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort\f[R] +.IP \[bu] 2 +\f[V]--compat-options youtube-dlc\f[R]: Same as +\f[V]--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort\f[R] +.IP \[bu] 2 +\f[V]--compat-options 2021\f[R]: Same as +\f[V]--compat-options 2022,no-certifi,filename-sanitization\f[R] +.IP \[bu] 2 +\f[V]--compat-options 2022\f[R]: Same as +\f[V]--compat-options 2023,playlist-match-filter,no-external-downloader-progress,prefer-legacy-http-handler,manifest-filesize-approx\f[R] +.IP \[bu] 2 +\f[V]--compat-options 2023\f[R]: Same as +\f[V]--compat-options 2024,prefer-vp9-sort\f[R] +.IP \[bu] 2 +\f[V]--compat-options 2024\f[R]: Currently does nothing. +Use this to enable all future compat options +.PP +The following compat options restore vulnerable behavior from before +security patches: +.IP \[bu] 2 +\f[V]--compat-options allow-unsafe-ext\f[R]: Allow files with any +extension (including unsafe ones) to be downloaded +(GHSA-79w7-vh3h-8g4j (https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j)) +.RS 2 +.RS +.PP +:warning: Only use if a valid file download is rejected because its +extension is detected as uncommon +.PP +\f[B]This option can enable remote code execution! +Consider opening an +issue (https://github.com/yt-dlp/yt-dlp/issues/new/choose) instead!\f[R] +.RE +.RE +.SS Deprecated options +.PP +These are all the deprecated options and the current alternative to +achieve the same effect +.SS Almost redundant options +.PP +While these options are almost the same as their new counterparts, there +are some differences that prevents them being redundant +.IP +.nf +\f[C] +-j, --dump-json --print \[dq]%()j\[dq] +-F, --list-formats --print formats_table +--list-thumbnails --print thumbnails_table --print playlist:thumbnails_table +--list-subs --print automatic_captions_table --print subtitles_table +\f[R] +.fi +.SS Redundant options +.PP +While these options are redundant, they are still expected to be used +due to their ease of use +.IP +.nf +\f[C] +--get-description --print description +--get-duration --print duration_string +--get-filename --print filename +--get-format --print format +--get-id --print id +--get-thumbnail --print thumbnail +-e, --get-title --print title +-g, --get-url --print urls +--match-title REGEX --match-filters \[dq]title \[ti]= (?i)REGEX\[dq] +--reject-title REGEX --match-filters \[dq]title !\[ti]= (?i)REGEX\[dq] +--min-views COUNT --match-filters \[dq]view_count >=? COUNT\[dq] +--max-views COUNT --match-filters \[dq]view_count <=? COUNT\[dq] +--break-on-reject Use --break-match-filters +--user-agent UA --add-headers \[dq]User-Agent:UA\[dq] +--referer URL --add-headers \[dq]Referer:URL\[dq] +--playlist-start NUMBER -I NUMBER: +--playlist-end NUMBER -I :NUMBER +--playlist-reverse -I ::-1 +--no-playlist-reverse Default +--no-colors --color no_color +\f[R] +.fi +.SS Not recommended +.PP +While these options still work, their use is not recommended since there +are other alternatives to achieve the same +.IP +.nf +\f[C] +--force-generic-extractor --ies generic,default +--exec-before-download CMD --exec \[dq]before_dl:CMD\[dq] +--no-exec-before-download --no-exec +--all-formats -f all +--all-subs --sub-langs all --write-subs +--print-json -j --no-simulate +--autonumber-size NUMBER Use string formatting, e.g. %(autonumber)03d +--autonumber-start NUMBER Use internal field formatting like %(autonumber+NUMBER)s +--id -o \[dq]%(id)s.%(ext)s\[dq] +--metadata-from-title FORMAT --parse-metadata \[dq]%(title)s:FORMAT\[dq] +--hls-prefer-native --downloader \[dq]m3u8:native\[dq] +--hls-prefer-ffmpeg --downloader \[dq]m3u8:ffmpeg\[dq] +--list-formats-old --compat-options list-formats (Alias: --no-list-formats-as-table) +--list-formats-as-table --compat-options -list-formats [Default] (Alias: --no-list-formats-old) +--youtube-skip-dash-manifest --extractor-args \[dq]youtube:skip=dash\[dq] (Alias: --no-youtube-include-dash-manifest) +--youtube-skip-hls-manifest --extractor-args \[dq]youtube:skip=hls\[dq] (Alias: --no-youtube-include-hls-manifest) +--youtube-include-dash-manifest Default (Alias: --no-youtube-skip-dash-manifest) +--youtube-include-hls-manifest Default (Alias: --no-youtube-skip-hls-manifest) +--geo-bypass --xff \[dq]default\[dq] +--no-geo-bypass --xff \[dq]never\[dq] +--geo-bypass-country CODE --xff CODE +--geo-bypass-ip-block IP_BLOCK --xff IP_BLOCK +\f[R] +.fi +.SS Developer options +.PP +These options are not intended to be used by the end-user +.IP +.nf +\f[C] +--test Download only part of video for testing extractors +--load-pages Load pages dumped by --write-pages +--youtube-print-sig-code For testing youtube signatures +--allow-unplayable-formats List unplayable formats also +--no-allow-unplayable-formats Default +\f[R] +.fi +.SS Old aliases +.PP +These are aliases that are no longer documented for various reasons +.IP +.nf +\f[C] +--avconv-location --ffmpeg-location +--clean-infojson --clean-info-json +--cn-verification-proxy URL --geo-verification-proxy URL +--dump-headers --print-traffic +--dump-intermediate-pages --dump-pages +--force-write-download-archive --force-write-archive +--load-info --load-info-json +--no-clean-infojson --no-clean-info-json +--no-split-tracks --no-split-chapters +--no-write-srt --no-write-subs +--prefer-unsecure --prefer-insecure +--rate-limit RATE --limit-rate RATE +--split-tracks --split-chapters +--srt-lang LANGS --sub-langs LANGS +--trim-file-names LENGTH --trim-filenames LENGTH +--write-srt --write-subs +--yes-overwrites --force-overwrites +\f[R] +.fi +.SS Sponskrub Options +.PP +Support for SponSkrub (https://github.com/faissaloo/SponSkrub) has been +deprecated in favor of the \f[V]--sponsorblock\f[R] options +.IP +.nf +\f[C] +--sponskrub --sponsorblock-mark all +--no-sponskrub --no-sponsorblock +--sponskrub-cut --sponsorblock-remove all +--no-sponskrub-cut --sponsorblock-remove -all +--sponskrub-force Not applicable +--no-sponskrub-force Not applicable +--sponskrub-location Not applicable +--sponskrub-args Not applicable +\f[R] +.fi +.SS No longer supported +.PP +These options may no longer work as intended +.IP +.nf +\f[C] +--prefer-avconv avconv is not officially supported by yt-dlp (Alias: --no-prefer-ffmpeg) +--prefer-ffmpeg Default (Alias: --no-prefer-avconv) +-C, --call-home Not implemented +--no-call-home Default +--include-ads No longer supported +--no-include-ads Default +--write-annotations No supported site has annotations now +--no-write-annotations Default +--compat-options seperate-video-versions No longer needed +--compat-options no-youtube-prefer-utc-upload-date No longer supported +\f[R] +.fi +.SS Removed +.PP +These options were deprecated since 2014 and have now been entirely +removed +.IP +.nf +\f[C] +-A, --auto-number -o \[dq]%(autonumber)s-%(id)s.%(ext)s\[dq] +-t, -l, --title, --literal -o \[dq]%(title)s-%(id)s.%(ext)s\[dq] +\f[R] +.fi +.SH CONTRIBUTING +.PP +See CONTRIBUTING.md for instructions on Opening an Issue and +Contributing code to the project +.SH WIKI +.PP +See the Wiki (https://github.com/yt-dlp/yt-dlp/wiki) for more +information diff --git a/.venv/share/zsh/site-functions/_yt-dlp b/.venv/share/zsh/site-functions/_yt-dlp new file mode 100644 index 0000000000000000000000000000000000000000..c7f0cc1c0559d0c1d3f8202253a47752dbb67be8 --- /dev/null +++ b/.venv/share/zsh/site-functions/_yt-dlp @@ -0,0 +1,30 @@ +#compdef yt-dlp + +__yt_dlp() { + local curcontext="$curcontext" fileopts diropts cur prev + typeset -A opt_args + fileopts="--download-archive|-a|--batch-file|--load-info-json|--load-info|--cookies|--no-cookies" + diropts="--cache-dir" + cur=$words[CURRENT] + case $cur in + :) + _arguments '*: :(::ytfavorites ::ytrecommended ::ytsubscriptions ::ytwatchlater ::ythistory)' + ;; + *) + prev=$words[CURRENT-1] + if [[ ${prev} =~ ${fileopts} ]]; then + _path_files + elif [[ ${prev} =~ ${diropts} ]]; then + _path_files -/ + elif [[ ${prev} == "--remux-video" ]]; then + _arguments '*: :(mp4 mkv)' + elif [[ ${prev} == "--recode-video" ]]; then + _arguments '*: :(mp4 flv ogg webm mkv)' + else + _arguments '*: :(--help --version --update --no-update --update-to --ignore-errors --no-abort-on-error --abort-on-error --dump-user-agent --list-extractors --extractor-descriptions --use-extractors --force-generic-extractor --default-search --ignore-config --no-config-locations --config-locations --plugin-dirs --no-plugin-dirs --flat-playlist --no-flat-playlist --live-from-start --no-live-from-start --wait-for-video --no-wait-for-video --mark-watched --no-mark-watched --no-colors --color --compat-options --alias --preset-alias --proxy --socket-timeout --source-address --impersonate --list-impersonate-targets --force-ipv4 --force-ipv6 --enable-file-urls --geo-verification-proxy --cn-verification-proxy --xff --geo-bypass --no-geo-bypass --geo-bypass-country --geo-bypass-ip-block --playlist-start --playlist-end --playlist-items --match-title --reject-title --min-filesize --max-filesize --date --datebefore --dateafter --min-views --max-views --match-filters --no-match-filters --break-match-filters --no-break-match-filters --no-playlist --yes-playlist --age-limit --download-archive --no-download-archive --max-downloads --break-on-existing --no-break-on-existing --break-on-reject --break-per-input --no-break-per-input --skip-playlist-after-errors --include-ads --no-include-ads --concurrent-fragments --limit-rate --throttled-rate --retries --file-access-retries --fragment-retries --retry-sleep --skip-unavailable-fragments --abort-on-unavailable-fragments --keep-fragments --no-keep-fragments --buffer-size --resize-buffer --no-resize-buffer --http-chunk-size --test --playlist-reverse --no-playlist-reverse --playlist-random --lazy-playlist --no-lazy-playlist --xattr-set-filesize --hls-prefer-native --hls-prefer-ffmpeg --hls-use-mpegts --no-hls-use-mpegts --download-sections --downloader --downloader-args --batch-file --no-batch-file --id --paths --output --output-na-placeholder --autonumber-size --autonumber-start --restrict-filenames --no-restrict-filenames --windows-filenames --no-windows-filenames --trim-filenames --no-overwrites --force-overwrites --no-force-overwrites --continue --no-continue --part --no-part --mtime --no-mtime --write-description --no-write-description --write-info-json --no-write-info-json --write-annotations --no-write-annotations --write-playlist-metafiles --no-write-playlist-metafiles --clean-info-json --no-clean-info-json --write-comments --no-write-comments --load-info-json --cookies --no-cookies --cookies-from-browser --no-cookies-from-browser --cache-dir --no-cache-dir --rm-cache-dir --write-thumbnail --no-write-thumbnail --write-all-thumbnails --list-thumbnails --write-link --write-url-link --write-webloc-link --write-desktop-link --quiet --no-quiet --no-warnings --simulate --no-simulate --ignore-no-formats-error --no-ignore-no-formats-error --skip-download --print --print-to-file --get-url --get-title --get-id --get-thumbnail --get-description --get-duration --get-filename --get-format --dump-json --dump-single-json --print-json --force-write-archive --newline --no-progress --progress --console-title --progress-template --progress-delta --verbose --dump-pages --write-pages --load-pages --youtube-print-sig-code --print-traffic --call-home --no-call-home --encoding --legacy-server-connect --no-check-certificates --prefer-insecure --user-agent --referer --add-headers --bidi-workaround --sleep-requests --sleep-interval --max-sleep-interval --sleep-subtitles --format --format-sort --format-sort-force --no-format-sort-force --video-multistreams --no-video-multistreams --audio-multistreams --no-audio-multistreams --all-formats --prefer-free-formats --no-prefer-free-formats --check-formats --check-all-formats --no-check-formats --list-formats --list-formats-as-table --list-formats-old --merge-output-format --allow-unplayable-formats --no-allow-unplayable-formats --write-subs --no-write-subs --write-auto-subs --no-write-auto-subs --all-subs --list-subs --sub-format --sub-langs --username --password --twofactor --netrc --netrc-location --netrc-cmd --video-password --ap-mso --ap-username --ap-password --ap-list-mso --client-certificate --client-certificate-key --client-certificate-password --extract-audio --audio-format --audio-quality --remux-video --recode-video --postprocessor-args --keep-video --no-keep-video --post-overwrites --no-post-overwrites --embed-subs --no-embed-subs --embed-thumbnail --no-embed-thumbnail --embed-metadata --no-embed-metadata --embed-chapters --no-embed-chapters --embed-info-json --no-embed-info-json --metadata-from-title --parse-metadata --replace-in-metadata --xattrs --concat-playlist --fixup --prefer-avconv --prefer-ffmpeg --ffmpeg-location --exec --no-exec --exec-before-download --no-exec-before-download --convert-subs --convert-thumbnails --split-chapters --no-split-chapters --remove-chapters --no-remove-chapters --force-keyframes-at-cuts --no-force-keyframes-at-cuts --use-postprocessor --sponsorblock-mark --sponsorblock-remove --sponsorblock-chapter-title --no-sponsorblock --sponsorblock-api --sponskrub --no-sponskrub --sponskrub-cut --no-sponskrub-cut --sponskrub-force --no-sponskrub-force --sponskrub-location --sponskrub-args --extractor-retries --allow-dynamic-mpd --ignore-dynamic-mpd --hls-split-discontinuity --no-hls-split-discontinuity --extractor-args --youtube-include-dash-manifest --youtube-skip-dash-manifest --youtube-include-hls-manifest --youtube-skip-hls-manifest)' + fi + ;; + esac +} + +__yt_dlp \ No newline at end of file diff --git a/HF_Deploy/.DS_Store b/HF_Deploy/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6781e67e1c3f634ed0db2acf3d4d4d830a8927ef Binary files /dev/null and b/HF_Deploy/.DS_Store differ diff --git a/HF_Deploy/README.md b/HF_Deploy/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d42f23ee069dc84b89b84c0f3adce8566996a622 --- /dev/null +++ b/HF_Deploy/README.md @@ -0,0 +1,35 @@ +# GladiatorBB - Hugging Face Space + +This is the deployment folder for the GladiatorBB bodybuilding pose analyzer app, supporting MoveNet (Gladiator BB), MediaPipe (Gladiator SupaDot), and CNN-based pose classification. + +## How to Update This Space + +1. **Install the Hugging Face Hub CLI:** + ```bash + pip install huggingface_hub + ``` + +2. **Login with your Hugging Face token:** + ```bash + huggingface-cli login + ``` + +3. **Push all files in this folder to your Space:** + ```bash + huggingface-cli upload . scfive/GladiatorBB/ --repo-type=space --include '*' --delete + ``` + +4. **Wait for the build to complete on Hugging Face Spaces.** + +- To update, just repeat step 3 after making changes. +- This folder is self-contained and does not affect your local running app. + +## Notes +- Space SDK: Docker +- App port: 7860 (set in Dockerfile) +- No YOLOv7 support (for reliability on Spaces) +- Large model files (e.g., .h5) are included for CNN pose classification + +--- + +For issues or questions, contact the project maintainer. \ No newline at end of file diff --git a/HF_Deploy/app.py b/HF_Deploy/app.py new file mode 100644 index 0000000000000000000000000000000000000000..a8f051c3824ae16bfa7302a898fcd7819cb68aff --- /dev/null +++ b/HF_Deploy/app.py @@ -0,0 +1,272 @@ +from flask import Flask, render_template, request, jsonify, send_from_directory, url_for +from flask_cors import CORS +import cv2 +import torch +import numpy as np +import os +from werkzeug.utils import secure_filename +import sys +import traceback +from tensorflow.keras.models import load_model +from tensorflow.keras.preprocessing import image + +# Add bodybuilding_pose_analyzer to path +sys.path.append('.') # Assuming app.py is at the root of cv.github.io +from bodybuilding_pose_analyzer.src.movenet_analyzer import MoveNetAnalyzer +from bodybuilding_pose_analyzer.src.pose_analyzer import PoseAnalyzer + +app = Flask(__name__, static_url_path='/static', static_folder='static') +CORS(app, resources={r"/*": {"origins": "*"}}) + +app.config['UPLOAD_FOLDER'] = 'static/uploads' +app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB max file size + +try: + os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True) +except PermissionError: + pass # Ignore if we can't create it (e.g., on HF Spaces) + +# Load CNN model for bodybuilding pose classification +cnn_model_path = 'external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5' +cnn_model = load_model(cnn_model_path) +cnn_class_labels = ['Side Chest', 'Front Double Biceps', 'Back Double Biceps', 'Front Lat Spread', 'Back Lat Spread'] + +def predict_pose_cnn(img_path): + img = image.load_img(img_path, target_size=(150, 150)) + img_array = image.img_to_array(img) + img_array = np.expand_dims(img_array, axis=0) / 255.0 + predictions = cnn_model.predict(img_array) + predicted_class = np.argmax(predictions, axis=1) + confidence = float(np.max(predictions)) + return cnn_class_labels[predicted_class[0]], confidence + +@app.route('/static/uploads/') +def serve_video(filename): + response = send_from_directory(app.config['UPLOAD_FOLDER'], filename, as_attachment=False) + # Ensure correct content type, especially for Safari/iOS if issues arise + if filename.lower().endswith('.mp4'): + response.headers['Content-Type'] = 'video/mp4' + return response + +@app.after_request +def after_request(response): + response.headers.add('Access-Control-Allow-Origin', '*') + response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization,X-Requested-With,Accept') + response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS') + return response + +def process_video_movenet(video_path, model_variant='lightning', pose_type='front_double_biceps'): + try: + print(f"[PROCESS_VIDEO_MOVENET] Called with video_path: {video_path}, model_variant: {model_variant}, pose_type: {pose_type}") + if not os.path.exists(video_path): + raise FileNotFoundError(f"Video file not found: {video_path}") + + analyzer = MoveNetAnalyzer(model_name=model_variant) + cap = cv2.VideoCapture(video_path) + if not cap.isOpened(): + raise ValueError(f"Failed to open video file: {video_path}") + fps = int(cap.get(cv2.CAP_PROP_FPS)) + width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) + height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) + print(f"Processing video with MoveNet ({model_variant}): {width}x{height} @ {fps}fps") + output_filename = f'output_movenet_{model_variant}.mp4' + output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename) + fourcc = cv2.VideoWriter_fourcc(*'avc1') + out = cv2.VideoWriter(output_path, fourcc, fps, (width, height)) + frame_count = 0 + current_pose = pose_type # Initialized (e.g., to 'front_double_biceps') + segment_length = 4 * fps if fps > 0 else 120 # 4 seconds worth of frames + cnn_pose = None + last_valid_landmarks = None + while cap.isOpened(): + ret, frame = cap.read() + if not ret: + break + frame_count += 1 + # Detect pose and get landmarks, reusing last valid landmarks if needed + frame_with_pose, landmarks_analysis, landmarks = analyzer.process_frame(frame, current_pose, last_valid_landmarks=last_valid_landmarks) + if landmarks: + last_valid_landmarks = landmarks + # Every 4 seconds, classify the pose (rule-based and CNN) + if (frame_count - 1) % segment_length == 0: + if landmarks: + detected_pose = analyzer.classify_pose(landmarks) + print(f"[AUTO-POSE] Frame {frame_count}: Detected pose: {detected_pose}") + current_pose = detected_pose + else: + print(f"[AUTO-POSE] Frame {frame_count}: No landmarks detected, keeping previous pose: {current_pose}") + # CNN prediction (every 4 seconds) + temp_img_path = f'temp_frame_for_cnn_{frame_count}.jpg' + cv2.imwrite(temp_img_path, frame) + try: + cnn_pose_pred, cnn_conf = predict_pose_cnn(temp_img_path) + print(f"[CNN] Frame {frame_count}: Pose: {cnn_pose_pred}, Conf: {cnn_conf:.2f}") + if cnn_conf >= 0.3: + current_pose = cnn_pose_pred # <--- HERE current_pose is updated + except Exception as e: + print(f"[CNN] Error predicting pose: {e}") + cnn_pose_pred, cnn_conf = None, 0.0 + if os.path.exists(temp_img_path): + os.remove(temp_img_path) + # Determine best pose + if cnn_conf >= 0.3: + best_pose = cnn_pose_pred + elif landmarks: + best_pose = analyzer.classify_pose(landmarks) + else: + best_pose = 'Uncertain' + # Analyze using the current pose + analysis = analyzer.analyze_pose(landmarks, current_pose) if landmarks else {'error': 'No pose detected'} + # Overlay results + y_offset = 90 + if 'error' not in analysis: + display_model_name = f"Gladiator {model_variant.capitalize()}" + cv2.putText(frame_with_pose, f"Model: {display_model_name}", + (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 255), 2) + cv2.putText(frame_with_pose, f"Gladiator Pose: {best_pose}", (10, 60), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2) + for joint, angle in analysis.get('angles', {}).items(): + text_to_display = f"{joint.capitalize()}: {angle:.1f} deg" + cv2.putText(frame_with_pose, text_to_display, + (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2) + y_offset += 25 + for correction in analysis.get('corrections', []): + cv2.putText(frame_with_pose, correction, + (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2) + y_offset += 25 + else: + cv2.putText(frame_with_pose, analysis['error'], + (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) + out.write(frame_with_pose) + cap.release() + out.release() + if frame_count == 0: + raise ValueError("No frames were processed from the video by MoveNet") + print(f"MoveNet video processing completed. Processed {frame_count} frames. Output: {output_path}") + return url_for('serve_video', filename=output_filename, _external=False) + except Exception as e: + print(f'Error in process_video_movenet: {e}') + traceback.print_exc() + raise + +def process_video_mediapipe(video_path): + try: + print(f"[PROCESS_VIDEO_MEDIAPIPE] Called with video_path: {video_path}") + if not os.path.exists(video_path): + raise FileNotFoundError(f"Video file not found: {video_path}") + + analyzer = PoseAnalyzer() + cap = cv2.VideoCapture(video_path) + if not cap.isOpened(): + raise ValueError(f"Failed to open video file: {video_path}") + fps = int(cap.get(cv2.CAP_PROP_FPS)) + width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) + height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) + print(f"Processing video with MediaPipe: {width}x{height} @ {fps}fps") + output_filename = f'output_mediapipe.mp4' + output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename) + fourcc = cv2.VideoWriter_fourcc(*'avc1') + out = cv2.VideoWriter(output_path, fourcc, fps, (width, height)) + frame_count = 0 + cnn_pose = None + segment_length = 4 * fps if fps > 0 else 120 # 4 seconds worth of frames + last_valid_landmarks = None + while cap.isOpened(): + ret, frame = cap.read() + if not ret: + break + frame_count += 1 + # Detect pose and analyze, reusing last valid landmarks if needed + frame_with_pose, analysis, landmarks = analyzer.process_frame(frame, last_valid_landmarks=last_valid_landmarks) + if landmarks: + last_valid_landmarks = landmarks + # Every 4 seconds, classify the pose using CNN + if (frame_count - 1) % segment_length == 0: + temp_img_path = 'temp_frame_for_cnn.jpg' + cv2.imwrite(temp_img_path, frame) + try: + cnn_pose, cnn_conf = predict_pose_cnn(temp_img_path) + print(f"[CNN] Confidence: {cnn_conf:.3f} for pose: {cnn_pose}") + except Exception as e: + print(f"[CNN] Error predicting pose: {e}") + cnn_pose, cnn_conf = None, 0.0 + if os.path.exists(temp_img_path): + os.remove(temp_img_path) + # Determine best pose + if cnn_conf >= 0.3: + best_pose = cnn_pose + else: + best_pose = 'Uncertain' + # Overlay results + y_offset = 30 + cv2.putText(frame_with_pose, f"Model: Gladiator SupaDot", (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 255), 2) + y_offset += 30 + cv2.putText(frame_with_pose, f"Gladiator Pose: {best_pose}", (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (255, 0, 0), 2) + y_offset += 30 + if 'error' not in analysis: + for joint, angle in analysis.get('angles', {}).items(): + text_to_display = f"{joint.capitalize()}: {angle:.1f} deg" + cv2.putText(frame_with_pose, text_to_display, (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 255, 0), 2) + y_offset += 25 + for correction in analysis.get('corrections', []): + cv2.putText(frame_with_pose, correction, (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.6, (0, 0, 255), 2) + y_offset += 25 + else: + cv2.putText(frame_with_pose, analysis['error'], (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) + out.write(frame_with_pose) + cap.release() + out.release() + if frame_count == 0: + raise ValueError("No frames were processed from the video by MediaPipe") + print(f"MediaPipe video processing completed. Processed {frame_count} frames. Output: {output_path}") + return url_for('serve_video', filename=output_filename, _external=False) + except Exception as e: + print(f'Error in process_video_mediapipe: {e}') + traceback.print_exc() + raise + +@app.route('/') +def index(): + return render_template('index.html') + +@app.route('/upload', methods=['POST']) +def upload_file(): + try: + if 'video' not in request.files: + return jsonify({'error': 'No video file provided'}), 400 + file = request.files['video'] + if file.filename == '': + return jsonify({'error': 'No selected file'}), 400 + if file: + allowed_extensions = {'mp4', 'avi', 'mov', 'mkv'} + if '.' not in file.filename or file.filename.rsplit('.', 1)[1].lower() not in allowed_extensions: + return jsonify({'error': 'Invalid file format. Allowed formats: mp4, avi, mov, mkv'}), 400 + filename = secure_filename(file.filename) + filepath = os.path.join(app.config['UPLOAD_FOLDER'], filename) + file.save(filepath) + print(f"File saved to: {filepath}") + try: + model_choice = request.form.get('model_choice', 'Gladiator SupaDot') + if model_choice == 'movenet': + movenet_variant = request.form.get('movenet_variant', 'lightning') + output_path_url = process_video_movenet(filepath, model_variant=movenet_variant) + else: + output_path_url = process_video_mediapipe(filepath) + print(f"[DEBUG] Generated video URL for client: {output_path_url}") + return jsonify({ + 'message': f'Video processed successfully with {model_choice}', + 'output_path': output_path_url + }) + except Exception as e: + print(f"Error processing video: {e}") + traceback.print_exc() + return jsonify({'error': f'Error processing video: {str(e)}'}), 500 + finally: + if os.path.exists(filepath): + os.remove(filepath) + except Exception as e: + print(f"Error in upload_file: {e}") + traceback.print_exc() + return jsonify({'error': 'Internal server error'}), 500 + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=7860, debug=True) \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/.DS_Store b/HF_Deploy/bodybuilding_pose_analyzer/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..39a6a16ea77a8efe8963d6f9478ba1da8b2182b5 Binary files /dev/null and b/HF_Deploy/bodybuilding_pose_analyzer/.DS_Store differ diff --git a/HF_Deploy/bodybuilding_pose_analyzer/README.md b/HF_Deploy/bodybuilding_pose_analyzer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2959e2c84609b0419c16098931a2aa2e566e7573 --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/README.md @@ -0,0 +1,63 @@ +# Bodybuilding Pose Analyzer + +A real-time pose analysis tool for bodybuilders that helps analyze and provide feedback on common bodybuilding poses. + +## Features + +- Real-time pose detection using MediaPipe +- Analysis of common bodybuilding poses: + - Front Double Biceps + - Side Chest + - Back Double Biceps +- Angle measurements for key body parts +- Real-time feedback and corrections +- FPS display + +## Requirements + +- Python 3.8+ +- Webcam +- Required Python packages (listed in requirements.txt) + +## Installation + +1. Clone the repository: +```bash +git clone +cd bodybuilding_pose_analyzer +``` + +2. Create a virtual environment (recommended): +```bash +python -m venv venv +source venv/bin/activate # On Windows: venv\Scripts\activate +``` + +3. Install required packages: +```bash +pip install -r requirements.txt +``` + +## Usage + +1. Run the demo script: +```bash +python src/demo.py +``` + +2. Position yourself in front of the webcam +3. The system will automatically detect your pose and provide feedback +4. Press 'q' to quit the application + +## Supported Poses + +Currently, the system supports the following poses: +- Front Double Biceps +- Side Chest +- Back Double Biceps + +More poses will be added in future updates. + +## Contributing + +Feel free to submit issues and enhancement requests! \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/requirements.txt b/HF_Deploy/bodybuilding_pose_analyzer/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e3dd3a6065795a40e0a5a4823fc20c623d6baec6 --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/requirements.txt @@ -0,0 +1,8 @@ +opencv-python>=4.8.0 +mediapipe>=0.10.0 +numpy>=1.24.0 +torch>=2.0.0 +torchvision>=0.15.0 +scikit-learn>=1.3.0 +matplotlib>=3.7.0 +tqdm>=4.65.0 \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/src/demo.py b/HF_Deploy/bodybuilding_pose_analyzer/src/demo.py new file mode 100644 index 0000000000000000000000000000000000000000..e9df85dc104252d0b69b83868e6fcfd93f8f343e --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/src/demo.py @@ -0,0 +1,80 @@ +import cv2 +import time +import argparse +from pose_analyzer import PoseAnalyzer + +def process_video(video_source, analyzer): + # Initialize video capture + cap = cv2.VideoCapture(video_source) + + # Set window properties + cv2.namedWindow('Bodybuilding Pose Analyzer', cv2.WINDOW_NORMAL) + cv2.resizeWindow('Bodybuilding Pose Analyzer', 1280, 720) + + # FPS calculation variables + prev_time = 0 + curr_time = 0 + + while cap.isOpened(): + # Read frame + ret, frame = cap.read() + if not ret: + break + + # Calculate FPS + curr_time = time.time() + fps = 1 / (curr_time - prev_time) if prev_time > 0 else 0 + prev_time = curr_time + + # Process frame + frame_with_pose, analysis = analyzer.process_frame(frame) + + # Add FPS and analysis text to frame + cv2.putText(frame_with_pose, f'FPS: {fps:.1f}', (10, 30), + cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) + + # Display feedback + if 'error' not in analysis: + y_offset = 70 + cv2.putText(frame_with_pose, f'Pose: {analysis["pose_type"]}', (10, y_offset), + cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) + + for angle_name, angle_value in analysis['angles'].items(): + y_offset += 40 + cv2.putText(frame_with_pose, f'{angle_name}: {angle_value:.1f}°', (10, y_offset), + cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) + + for correction in analysis['corrections']: + y_offset += 40 + cv2.putText(frame_with_pose, correction, (10, y_offset), + cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2) + else: + cv2.putText(frame_with_pose, analysis['error'], (10, 70), + cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2) + + # Display the frame + cv2.imshow('Bodybuilding Pose Analyzer', frame_with_pose) + + # Break the loop if 'q' is pressed + if cv2.waitKey(1) & 0xFF == ord('q'): + break + + # Release resources + cap.release() + cv2.destroyAllWindows() + +def main(): + # Parse command line arguments + parser = argparse.ArgumentParser(description='Bodybuilding Pose Analyzer Demo') + parser.add_argument('--video', type=str, help='Path to video file (optional)') + args = parser.parse_args() + + # Initialize the pose analyzer + analyzer = PoseAnalyzer() + + # Process video (either webcam or file) + video_source = args.video if args.video else 0 + process_video(video_source, analyzer) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_analyzer.py b/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_analyzer.py new file mode 100644 index 0000000000000000000000000000000000000000..53f99ca1de87d96ecec69eca6bd23a5adda96bb0 --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_analyzer.py @@ -0,0 +1,302 @@ +import cv2 +import numpy as np +import tensorflow as tf +import tensorflow_hub as hub +from typing import List, Dict, Tuple + +class MoveNetAnalyzer: + KEYPOINT_DICT = { + 'nose': 0, + 'left_eye': 1, + 'right_eye': 2, + 'left_ear': 3, + 'right_ear': 4, + 'left_shoulder': 5, + 'right_shoulder': 6, + 'left_elbow': 7, + 'right_elbow': 8, + 'left_wrist': 9, + 'right_wrist': 10, + 'left_hip': 11, + 'right_hip': 12, + 'left_knee': 13, + 'right_knee': 14, + 'left_ankle': 15, + 'right_ankle': 16 + } + + def __init__(self, model_name="lightning"): + # Initialize MoveNet model + if model_name == "lightning": + self.model = hub.load("https://tfhub.dev/google/movenet/singlepose/lightning/4") + self.input_size = 192 + else: # thunder + self.model = hub.load("https://tfhub.dev/google/movenet/singlepose/thunder/4") + self.input_size = 256 + + self.movenet = self.model.signatures['serving_default'] + + # Define key angles for bodybuilding poses + self.key_angles = { + 'front_double_biceps': { + 'shoulder_angle': (90, 120), # Expected angle range + 'elbow_angle': (80, 100), + 'wrist_angle': (0, 20) + }, + 'side_chest': { + 'shoulder_angle': (45, 75), + 'elbow_angle': (90, 110), + 'wrist_angle': (0, 20) + }, + 'back_double_biceps': { + 'shoulder_angle': (90, 120), + 'elbow_angle': (80, 100), + 'wrist_angle': (0, 20) + } + } + + def detect_pose(self, frame: np.ndarray, last_valid_landmarks=None) -> Tuple[np.ndarray, List[Dict]]: + """ + Detect pose in the given frame and return the frame with pose landmarks drawn + and the list of detected landmarks. + If detection fails, reuse last valid landmarks if provided. + """ + # Resize and pad the image to keep aspect ratio + img = frame.copy() + img = tf.image.resize_with_pad(tf.expand_dims(img, axis=0), self.input_size, self.input_size) + img = tf.cast(img, dtype=tf.int32) + + # Detection + results = self.movenet(img) + keypoints = results['output_0'].numpy() # Shape [1, 1, 17, 3] + + # Draw the pose landmarks on the frame + if keypoints[0, 0, 0, 2] > 0.1: # Lowered confidence threshold for the nose + # Convert keypoints to image coordinates + y, x, c = frame.shape + shaped = np.squeeze(keypoints) # Shape [17, 3] + + # Draw keypoints + for kp in shaped: + ky, kx, kp_conf = kp + if kp_conf > 0.1: + # Convert to image coordinates + x_coord = int(kx * x) + y_coord = int(ky * y) + cv2.circle(frame, (x_coord, y_coord), 6, (0, 255, 0), -1) + + # Convert landmarks to a list of dictionaries + landmarks = [] + for kp in shaped: + landmarks.append({ + 'x': float(kp[1]), + 'y': float(kp[0]), + 'visibility': float(kp[2]) + }) + + return frame, landmarks + + # If detection fails, reuse last valid landmarks if provided + if last_valid_landmarks is not None: + return frame, last_valid_landmarks + return frame, [] + + def calculate_angle(self, landmarks: List[Dict], joint1: int, joint2: int, joint3: int) -> float: + """ + Calculate the angle between three joints. + """ + if len(landmarks) < max(joint1, joint2, joint3): + return None + + # Get the coordinates of the three joints + p1 = np.array([landmarks[joint1]['x'], landmarks[joint1]['y']]) + p2 = np.array([landmarks[joint2]['x'], landmarks[joint2]['y']]) + p3 = np.array([landmarks[joint3]['x'], landmarks[joint3]['y']]) + + # Calculate the angle + v1 = p1 - p2 + v2 = p3 - p2 + + angle = np.degrees(np.arccos( + np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2)) + )) + + return angle + + def analyze_pose(self, landmarks: List[Dict], pose_type: str) -> Dict: + """ + Analyze the pose and provide feedback based on the pose type. + """ + if not landmarks or pose_type not in self.key_angles: + return {'error': 'Invalid pose type or no landmarks detected'} + + feedback = { + 'pose_type': pose_type, + 'angles': {}, + 'corrections': [] + } + + pose_rules = self.key_angles[pose_type] + + if pose_type == 'front_double_biceps': + # Example: Left Shoulder - Elbow - Wrist for elbow angle + # Example: Left Hip - Shoulder - Elbow for shoulder angle (arm abduction) + # Note: These are examples, actual biomechanical definitions can be complex. + # We'll stick to the previous definition for front_double_biceps shoulder angle for now. + # Shoulder angle: right_hip - right_shoulder - right_elbow (can also use left) + # Elbow angle: right_shoulder - right_elbow - right_wrist (can also use left) + # Wrist angle (simplistic): right_elbow - right_wrist - a point slightly above wrist (not easily done without more points) + + # Using right side for front_double_biceps as an example, consistent with a typical bodybuilding pose display + # Shoulder Angle (approximating arm abduction/flexion relative to torso) + # Using Right Hip, Right Shoulder, Right Elbow + rs = self.KEYPOINT_DICT['right_shoulder'] + re = self.KEYPOINT_DICT['right_elbow'] + rh = self.KEYPOINT_DICT['right_hip'] + rw = self.KEYPOINT_DICT['right_wrist'] + + shoulder_angle = self.calculate_angle(landmarks, rh, rs, re) + if shoulder_angle is not None: + feedback['angles']['R Shoulder'] = shoulder_angle + if not (pose_rules['shoulder_angle'][0] <= shoulder_angle <= pose_rules['shoulder_angle'][1]): + feedback['corrections'].append( + f"Adjust R Shoulder to {pose_rules['shoulder_angle'][0]}-{pose_rules['shoulder_angle'][1]} deg" + ) + + elbow_angle = self.calculate_angle(landmarks, rs, re, rw) + if elbow_angle is not None: + feedback['angles']['R Elbow'] = elbow_angle + if not (pose_rules['elbow_angle'][0] <= elbow_angle <= pose_rules['elbow_angle'][1]): + feedback['corrections'].append( + f"Adjust R Elbow to {pose_rules['elbow_angle'][0]}-{pose_rules['elbow_angle'][1]} deg" + ) + # Wrist angle is hard to define meaningfully with current keypoints for this pose, skipping for now. + + elif pose_type == 'side_chest': + # Assuming side chest often displays left side to judges + ls = self.KEYPOINT_DICT['left_shoulder'] + le = self.KEYPOINT_DICT['left_elbow'] + lw = self.KEYPOINT_DICT['left_wrist'] + lh = self.KEYPOINT_DICT['left_hip'] # For shoulder angle relative to torso + + # Shoulder angle (e.g. arm flexion/extension in sagittal plane for the front arm) + # For side chest, the front arm's shoulder angle relative to the torso (hip-shoulder-elbow) + shoulder_angle = self.calculate_angle(landmarks, lh, ls, le) + if shoulder_angle is not None: + feedback['angles']['L Shoulder'] = shoulder_angle + if not (pose_rules['shoulder_angle'][0] <= shoulder_angle <= pose_rules['shoulder_angle'][1]): + feedback['corrections'].append( + f"Adjust L Shoulder to {pose_rules['shoulder_angle'][0]}-{pose_rules['shoulder_angle'][1]} deg" + ) + + elbow_angle = self.calculate_angle(landmarks, ls, le, lw) + if elbow_angle is not None: + feedback['angles']['L Elbow'] = elbow_angle + if not (pose_rules['elbow_angle'][0] <= elbow_angle <= pose_rules['elbow_angle'][1]): + feedback['corrections'].append( + f"Adjust L Elbow to {pose_rules['elbow_angle'][0]}-{pose_rules['elbow_angle'][1]} deg" + ) + # Wrist angle for side chest is also nuanced, skipping detailed check for now. + + elif pose_type == 'back_double_biceps': + # Similar to front, but from back. We can calculate for both arms or pick one. + # Let's do right side for consistency with front_double_biceps example. + rs = self.KEYPOINT_DICT['right_shoulder'] + re = self.KEYPOINT_DICT['right_elbow'] + rh = self.KEYPOINT_DICT['right_hip'] + rw = self.KEYPOINT_DICT['right_wrist'] + + shoulder_angle = self.calculate_angle(landmarks, rh, rs, re) + if shoulder_angle is not None: + feedback['angles']['R Shoulder'] = shoulder_angle + if not (pose_rules['shoulder_angle'][0] <= shoulder_angle <= pose_rules['shoulder_angle'][1]): + feedback['corrections'].append( + f"Adjust R Shoulder to {pose_rules['shoulder_angle'][0]}-{pose_rules['shoulder_angle'][1]} deg" + ) + + elbow_angle = self.calculate_angle(landmarks, rs, re, rw) + if elbow_angle is not None: + feedback['angles']['R Elbow'] = elbow_angle + if not (pose_rules['elbow_angle'][0] <= elbow_angle <= pose_rules['elbow_angle'][1]): + feedback['corrections'].append( + f"Adjust R Elbow to {pose_rules['elbow_angle'][0]}-{pose_rules['elbow_angle'][1]} deg" + ) + + return feedback + + def process_frame(self, frame: np.ndarray, pose_type: str = 'front_double_biceps', last_valid_landmarks=None) -> Tuple[np.ndarray, Dict, List[Dict]]: + """ + Process a single frame, detect pose, and analyze it. Returns frame, analysis, and used landmarks. + """ + # Detect pose + frame_with_pose, landmarks = self.detect_pose(frame, last_valid_landmarks=last_valid_landmarks) + + # Analyze pose if landmarks are detected + analysis = self.analyze_pose(landmarks, pose_type) if landmarks else {'error': 'No pose detected'} + + return frame_with_pose, analysis, landmarks + + def classify_pose(self, landmarks: List[Dict]) -> str: + """ + Classify the pose based on keypoint positions and angles. + Returns one of: 'front_double_biceps', 'side_chest', 'back_double_biceps'. + """ + if not landmarks or len(landmarks) < 17: + return 'front_double_biceps' # Default/fallback + + # Calculate angles for both arms + # Right side + rs = self.KEYPOINT_DICT['right_shoulder'] + re = self.KEYPOINT_DICT['right_elbow'] + rh = self.KEYPOINT_DICT['right_hip'] + rw = self.KEYPOINT_DICT['right_wrist'] + # Left side + ls = self.KEYPOINT_DICT['left_shoulder'] + le = self.KEYPOINT_DICT['left_elbow'] + lh = self.KEYPOINT_DICT['left_hip'] + lw = self.KEYPOINT_DICT['left_wrist'] + + # Shoulder angles + r_shoulder_angle = self.calculate_angle(landmarks, rh, rs, re) + l_shoulder_angle = self.calculate_angle(landmarks, lh, ls, le) + # Elbow angles + r_elbow_angle = self.calculate_angle(landmarks, rs, re, rw) + l_elbow_angle = self.calculate_angle(landmarks, ls, le, lw) + + # Heuristic rules: + # - Front double biceps: both arms raised, elbows bent, both shoulders abducted + # - Side chest: one arm across chest (elbow in front of body), other arm flexed + # - Back double biceps: both arms raised, elbows bent, but person is facing away (shoulders/hips x order reversed) + + # Use x-coordinates to estimate facing direction + # If right shoulder x < left shoulder x, assume facing front; else, facing back + facing_front = landmarks[rs]['x'] < landmarks[ls]['x'] + + # Count how many arms are "up" (shoulder angle in expected range) + arms_up = 0 + if r_shoulder_angle and 80 < r_shoulder_angle < 150: + arms_up += 1 + if l_shoulder_angle and 80 < l_shoulder_angle < 150: + arms_up += 1 + elbows_bent = 0 + if r_elbow_angle and 60 < r_elbow_angle < 130: + elbows_bent += 1 + if l_elbow_angle and 60 < l_elbow_angle < 130: + elbows_bent += 1 + + # Side chest: one arm's elbow is much closer to the body's midline (x of elbow near x of nose) + nose_x = landmarks[self.KEYPOINT_DICT['nose']]['x'] + le_x = landmarks[le]['x'] + re_x = landmarks[re]['x'] + side_chest_like = (abs(le_x - nose_x) < 0.08 or abs(re_x - nose_x) < 0.08) + + if arms_up == 2 and elbows_bent == 2: + if facing_front: + return 'front_double_biceps' + else: + return 'back_double_biceps' + elif side_chest_like: + return 'side_chest' + else: + # Default/fallback + return 'front_double_biceps' \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_demo.py b/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_demo.py new file mode 100644 index 0000000000000000000000000000000000000000..d8558c50dea549bfc294112623905f686580452e --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/src/movenet_demo.py @@ -0,0 +1,66 @@ +import cv2 +import argparse +from movenet_analyzer import MoveNetAnalyzer + +def main(): + parser = argparse.ArgumentParser(description='MoveNet Pose Analysis Demo') + parser.add_argument('--video', type=str, help='Path to video file (optional)') + parser.add_argument('--model', type=str, default='lightning', choices=['lightning', 'thunder'], + help='MoveNet model variant (lightning or thunder)') + args = parser.parse_args() + + # Initialize the MoveNet analyzer + analyzer = MoveNetAnalyzer(model_name=args.model) + + # Initialize video capture + if args.video: + cap = cv2.VideoCapture(args.video) + else: + cap = cv2.VideoCapture(0) # Use webcam if no video file provided + + if not cap.isOpened(): + print("Error: Could not open video source") + return + + while True: + ret, frame = cap.read() + if not ret: + break + + # Process frame + frame_with_pose, analysis = analyzer.process_frame(frame) + + # Display analysis results + if 'error' not in analysis: + # Display pose type + cv2.putText(frame_with_pose, f"Pose: {analysis['pose_type']}", + (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2) + + # Display angles + y_offset = 60 + for joint, angle in analysis['angles'].items(): + cv2.putText(frame_with_pose, f"{joint}: {angle:.1f}°", + (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2) + y_offset += 30 + + # Display corrections + for correction in analysis['corrections']: + cv2.putText(frame_with_pose, correction, + (10, y_offset), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) + y_offset += 30 + else: + cv2.putText(frame_with_pose, analysis['error'], + (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2) + + # Display the frame + cv2.imshow('MoveNet Pose Analysis', frame_with_pose) + + # Break the loop if 'q' is pressed + if cv2.waitKey(1) & 0xFF == ord('q'): + break + + cap.release() + cv2.destroyAllWindows() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/HF_Deploy/bodybuilding_pose_analyzer/src/pose_analyzer.py b/HF_Deploy/bodybuilding_pose_analyzer/src/pose_analyzer.py new file mode 100644 index 0000000000000000000000000000000000000000..51dfaa7d14f0e9f7a4850a81e8680377dfe42111 --- /dev/null +++ b/HF_Deploy/bodybuilding_pose_analyzer/src/pose_analyzer.py @@ -0,0 +1,200 @@ +import cv2 +import mediapipe as mp +import numpy as np +from typing import List, Dict, Tuple + +class PoseAnalyzer: + # Add MediaPipe skeleton connections as a class variable + MP_CONNECTIONS = [ + (11, 13), (13, 15), # Left arm + (12, 14), (14, 16), # Right arm + (11, 12), # Shoulders + (11, 23), (12, 24), # Torso sides + (23, 24), # Hips + (23, 25), (25, 27), # Left leg + (24, 26), (26, 28), # Right leg + (27, 31), (28, 32), # Ankles to feet + (15, 17), (16, 18), # Wrists to hands + (15, 19), (16, 20), # Wrists to pinky + (15, 21), (16, 22), # Wrists to index + (15, 17), (17, 19), (19, 21), # Left hand + (16, 18), (18, 20), (20, 22) # Right hand + ] + def __init__(self): + # Initialize MediaPipe Pose + self.mp_pose = mp.solutions.pose + self.pose = self.mp_pose.Pose( + static_image_mode=False, + model_complexity=2, # Using the most accurate model + min_detection_confidence=0.1, + min_tracking_confidence=0.1 + ) + self.mp_drawing = mp.solutions.drawing_utils + + # Define key angles for bodybuilding poses + self.key_angles = { + 'front_double_biceps': { + 'shoulder_angle': (90, 120), # Expected angle range + 'elbow_angle': (80, 100), + 'wrist_angle': (0, 20) + }, + 'side_chest': { + 'shoulder_angle': (45, 75), + 'elbow_angle': (90, 110), + 'wrist_angle': (0, 20) + }, + 'back_double_biceps': { + 'shoulder_angle': (90, 120), + 'elbow_angle': (80, 100), + 'wrist_angle': (0, 20) + } + } + + def detect_pose(self, frame: np.ndarray, last_valid_landmarks=None) -> Tuple[np.ndarray, List[Dict]]: + """ + Detect pose in the given frame and return the frame with pose landmarks drawn + and the list of detected landmarks. If detection fails, reuse last valid landmarks if provided. + """ + # Convert the BGR image to RGB + rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + + # Process the frame and detect pose + results = self.pose.process(rgb_frame) + + # Draw the pose landmarks on the frame + if results.pose_landmarks: + # Draw all 33 keypoints as bright red, smaller circles, and show index + for idx, landmark in enumerate(results.pose_landmarks.landmark): + x = int(landmark.x * frame.shape[1]) + y = int(landmark.y * frame.shape[0]) + if landmark.visibility > 0.1: # Lowered threshold from 0.3 to 0.1 + cv2.circle(frame, (x, y), 3, (0, 0, 255), -1) + cv2.putText(frame, str(idx), (x+8, y-8), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (255, 255, 255), 1) + # Draw skeleton lines + # Convert landmarks to pixel coordinates for easier access + landmark_points = [] + for landmark in results.pose_landmarks.landmark: + landmark_points.append((int(landmark.x * frame.shape[1]), int(landmark.y * frame.shape[0]), landmark.visibility)) + for pt1, pt2 in self.MP_CONNECTIONS: + if pt1 < len(landmark_points) and pt2 < len(landmark_points): + x1, y1, v1 = landmark_points[pt1] + x2, y2, v2 = landmark_points[pt2] + if v1 > 0.1 and v2 > 0.1: + cv2.line(frame, (x1, y1), (x2, y2), (0, 255, 255), 2) + # Convert landmarks to a list of dictionaries + landmarks = [] + for idx, landmark in enumerate(results.pose_landmarks.landmark): + landmarks.append({ + 'x': landmark.x, + 'y': landmark.y, + 'z': landmark.z, + 'visibility': landmark.visibility + }) + return frame, landmarks + # If detection fails, reuse last valid landmarks if provided + if last_valid_landmarks is not None: + return frame, last_valid_landmarks + return frame, [] + + def calculate_angle(self, landmarks: List[Dict], joint1: int, joint2: int, joint3: int) -> float: + """ + Calculate the angle between three joints. + """ + if len(landmarks) < max(joint1, joint2, joint3): + return None + + # Get the coordinates of the three joints + p1 = np.array([landmarks[joint1]['x'], landmarks[joint1]['y']]) + p2 = np.array([landmarks[joint2]['x'], landmarks[joint2]['y']]) + p3 = np.array([landmarks[joint3]['x'], landmarks[joint3]['y']]) + + # Calculate the angle + v1 = p1 - p2 + v2 = p3 - p2 + + angle = np.degrees(np.arccos( + np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2)) + )) + + return angle + + def analyze_pose(self, landmarks: List[Dict], pose_type: str) -> Dict: + """ + Analyze the pose and provide feedback based on the pose type. + Enhanced: Calculates angles for both left and right arms (shoulder, elbow, wrist) for all pose types. + """ + if not landmarks or pose_type not in self.key_angles: + return {'error': 'Invalid pose type or no landmarks detected'} + + feedback = { + 'pose_type': pose_type, + 'angles': {}, + 'corrections': [] + } + # Indices for MediaPipe 33 keypoints + LEFT_SHOULDER = 11 + RIGHT_SHOULDER = 12 + LEFT_ELBOW = 13 + RIGHT_ELBOW = 14 + LEFT_WRIST = 15 + RIGHT_WRIST = 16 + LEFT_HIP = 23 + RIGHT_HIP = 24 + LEFT_KNEE = 25 + RIGHT_KNEE = 26 + LEFT_ANKLE = 27 + RIGHT_ANKLE = 28 + # Calculate angles for both arms + # Shoulder angles (hip-shoulder-elbow) + l_shoulder_angle = self.calculate_angle(landmarks, LEFT_HIP, LEFT_SHOULDER, LEFT_ELBOW) + r_shoulder_angle = self.calculate_angle(landmarks, RIGHT_HIP, RIGHT_SHOULDER, RIGHT_ELBOW) + # Elbow angles (shoulder-elbow-wrist) + l_elbow_angle = self.calculate_angle(landmarks, LEFT_SHOULDER, LEFT_ELBOW, LEFT_WRIST) + r_elbow_angle = self.calculate_angle(landmarks, RIGHT_SHOULDER, RIGHT_ELBOW, RIGHT_WRIST) + # Wrist angles (elbow-wrist-hand index, if available) + # MediaPipe does not have hand index, so we can use a pseudo point (e.g., extend wrist direction) + # For now, skip wrist angle or set to None + # Leg angles (optional) + l_knee_angle = self.calculate_angle(landmarks, LEFT_HIP, LEFT_KNEE, LEFT_ANKLE) + r_knee_angle = self.calculate_angle(landmarks, RIGHT_HIP, RIGHT_KNEE, RIGHT_ANKLE) + # Add angles to feedback + if l_shoulder_angle: + feedback['angles']['L Shoulder'] = l_shoulder_angle + if not self.key_angles[pose_type]['shoulder_angle'][0] <= l_shoulder_angle <= self.key_angles[pose_type]['shoulder_angle'][1]: + feedback['corrections'].append( + f"Adjust L Shoulder to {self.key_angles[pose_type]['shoulder_angle'][0]}-{self.key_angles[pose_type]['shoulder_angle'][1]} deg" + ) + if r_shoulder_angle: + feedback['angles']['R Shoulder'] = r_shoulder_angle + if not self.key_angles[pose_type]['shoulder_angle'][0] <= r_shoulder_angle <= self.key_angles[pose_type]['shoulder_angle'][1]: + feedback['corrections'].append( + f"Adjust R Shoulder to {self.key_angles[pose_type]['shoulder_angle'][0]}-{self.key_angles[pose_type]['shoulder_angle'][1]} deg" + ) + if l_elbow_angle: + feedback['angles']['L Elbow'] = l_elbow_angle + if not self.key_angles[pose_type]['elbow_angle'][0] <= l_elbow_angle <= self.key_angles[pose_type]['elbow_angle'][1]: + feedback['corrections'].append( + f"Adjust L Elbow to {self.key_angles[pose_type]['elbow_angle'][0]}-{self.key_angles[pose_type]['elbow_angle'][1]} deg" + ) + if r_elbow_angle: + feedback['angles']['R Elbow'] = r_elbow_angle + if not self.key_angles[pose_type]['elbow_angle'][0] <= r_elbow_angle <= self.key_angles[pose_type]['elbow_angle'][1]: + feedback['corrections'].append( + f"Adjust R Elbow to {self.key_angles[pose_type]['elbow_angle'][0]}-{self.key_angles[pose_type]['elbow_angle'][1]} deg" + ) + # Optionally add knee angles + if l_knee_angle: + feedback['angles']['L Knee'] = l_knee_angle + if r_knee_angle: + feedback['angles']['R Knee'] = r_knee_angle + return feedback + + def process_frame(self, frame: np.ndarray, pose_type: str = 'front_double_biceps', last_valid_landmarks=None) -> Tuple[np.ndarray, Dict, List[Dict]]: + """ + Process a single frame, detect pose, and analyze it. Returns frame, analysis, and used landmarks. + """ + # Detect pose + frame_with_pose, landmarks = self.detect_pose(frame, last_valid_landmarks=last_valid_landmarks) + # Analyze pose if landmarks are detected + analysis = self.analyze_pose(landmarks, pose_type) if landmarks else {'error': 'No pose detected'} + return frame_with_pose, analysis, landmarks \ No newline at end of file diff --git a/HF_Deploy/external/.DS_Store b/HF_Deploy/external/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..851d1f14b8ac6aea4f950fa3e8deb5cf9bd7793d Binary files /dev/null and b/HF_Deploy/external/.DS_Store differ diff --git a/HF_Deploy/requirements.txt b/HF_Deploy/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..9966b497735f7f99e7a228c069b2ec4932f75c6b --- /dev/null +++ b/HF_Deploy/requirements.txt @@ -0,0 +1,10 @@ +flask +flask-cors +tensorflow==2.15.0 +mediapipe +numpy +opencv-python +werkzeug +h5py +torch +tensorflow_hub diff --git a/HF_Deploy/static/.DS_Store b/HF_Deploy/static/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f8c1ff088e675cd0bc0c737456525b7d40e4975e Binary files /dev/null and b/HF_Deploy/static/.DS_Store differ diff --git a/HF_Deploy/templates/index.html b/HF_Deploy/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..f2931b9a239223b5b3d27db356bab475bb41c408 --- /dev/null +++ b/HF_Deploy/templates/index.html @@ -0,0 +1,176 @@ + + + + + + Bodybuilding Pose Analyzer + + + +
+

Bodybuilding Pose Analyzer

+ +
+
+

Upload Video

+
+
+ + +
+ +
+ +
+
+ + +
+
+
+
+
+ +
+
+ + +
+
+
+
+ + +
+
+ + + + +
+
+ + + + \ No newline at end of file diff --git a/HFup/requirements.txt b/HFup/requirements.txt index 188c789ad17c6097d1e3bfb91b48659e5d8cab54..538e3e39825b40ad360bfd1fe09dcd4b64802226 100644 --- a/HFup/requirements.txt +++ b/HFup/requirements.txt @@ -78,3 +78,4 @@ tzdata==2025.2 urllib3==2.4.0 Werkzeug==3.1.3 wrapt==1.17.2 + \ No newline at end of file diff --git a/app.py b/app.py index fb625f6ac098eda7c845ebb6a09e661c83f72207..c6f994f2f46fb80f759db499d96f6808acffc1ee 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,8 @@ +# Patch for Hugging Face Spaces: set MPLCONFIGDIR to avoid permission errors with matplotlib +import os +os.environ["MPLCONFIGDIR"] = "/tmp/matplotlib" +os.makedirs("/tmp/matplotlib", exist_ok=True) + from flask import Flask, render_template, request, jsonify, send_from_directory, url_for from flask_cors import CORS import cv2 diff --git a/bodybuilding-pose-classifier b/bodybuilding-pose-classifier new file mode 160000 index 0000000000000000000000000000000000000000..f98ce8e7926ff2670ca2370b60a4a63ff18cb141 --- /dev/null +++ b/bodybuilding-pose-classifier @@ -0,0 +1 @@ +Subproject commit f98ce8e7926ff2670ca2370b60a4a63ff18cb141 diff --git a/bodybuilding_pose_analyzer/src/movenet_analyzer.py b/bodybuilding_pose_analyzer/src/movenet_analyzer.py index a94f4129adac00443972abbdb46731531e989f3e..79573d2c91105a1cbe20b9fe8bcf9ac5bc984136 100644 --- a/bodybuilding_pose_analyzer/src/movenet_analyzer.py +++ b/bodybuilding_pose_analyzer/src/movenet_analyzer.py @@ -240,7 +240,7 @@ class MoveNetAnalyzer: # Clear notes if pose_type was valid and processed, unless specific notes were added by pose logic if not feedback['notes']: # Only clear if no specific notes were added during pose rule processing feedback.pop('notes', None) - + return feedback def process_frame(self, frame: np.ndarray, pose_type: str = 'front_double_biceps', last_valid_landmarks=None) -> Tuple[np.ndarray, Dict, List[Dict]]: diff --git a/bodybuilding_pose_classifier.py b/bodybuilding_pose_classifier.py new file mode 100644 index 0000000000000000000000000000000000000000..864528c693f86bb189219a2f1ca6f5fbe42b6d76 --- /dev/null +++ b/bodybuilding_pose_classifier.py @@ -0,0 +1,68 @@ +import tensorflow as tf +from tensorflow.keras.models import load_model +from tensorflow.keras.preprocessing import image +import numpy as np +import argparse +import os + +# Define class labels (ensure these match your training) +CNN_CLASS_LABELS = ['Side Chest', 'Front Double Biceps', 'Back Double Biceps', 'Front Lat Spread', 'Back Lat Spread'] +MODEL_PATH = 'bodybuilding_pose_classifier_savedmodel.keras' # Corrected model path + +def predict_pose_from_image(model, img_path): + """ + Loads an image, preprocesses it, and predicts the bodybuilding pose. + + Args: + model: The loaded Keras model. + img_path (str): Path to the image file. + + Returns: + tuple: (predicted_class_label, confidence_score) or (None, None) if error. + """ + try: + if not os.path.exists(img_path): + print(f"Error: Image path not found: {img_path}") + return None, None + + # Load and preprocess the image + img = image.load_img(img_path, target_size=(150, 150)) + img_array = image.img_to_array(img) + img_array = np.expand_dims(img_array, axis=0) / 255.0 # Normalize + + # Make prediction + predictions = model.predict(img_array) + predicted_class_index = np.argmax(predictions, axis=1)[0] + confidence = float(np.max(predictions)) + + predicted_class_label = CNN_CLASS_LABELS[predicted_class_index] + + return predicted_class_label, confidence + except Exception as e: + print(f"Error during prediction: {e}") + return None, None + +def main(): + parser = argparse.ArgumentParser(description="Classify a bodybuilding pose from an image.") + parser.add_argument("image_path", help="Path to the input image file.") + args = parser.parse_args() + + # Load the Keras model + print(f"Loading model from: {MODEL_PATH}") + try: + model = load_model(MODEL_PATH) + # Optional: Print model summary to verify + # model.summary() + except Exception as e: + print(f"Error loading model: {e}") + return + + print(f"Classifying image: {args.image_path}") + predicted_pose, confidence_score = predict_pose_from_image(model, args.image_path) + + if predicted_pose and confidence_score is not None: + print(f"Predicted Pose: {predicted_pose}") + print(f"Confidence: {confidence_score:.2f}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/keras2env/bin/Activate.ps1 b/keras2env/bin/Activate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b49d77ba44b24fe6d69f6bbe75139b3b5dc23075 --- /dev/null +++ b/keras2env/bin/Activate.ps1 @@ -0,0 +1,247 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } + $env:VIRTUAL_ENV_PROMPT = $Prompt +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/keras2env/bin/activate b/keras2env/bin/activate new file mode 100644 index 0000000000000000000000000000000000000000..43453efc316eb2a6cb3f35a2ac49ae91b8b82f90 --- /dev/null +++ b/keras2env/bin/activate @@ -0,0 +1,69 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/Users/sc-gladiator/cv.github.io/keras2env" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1="(keras2env) ${PS1:-}" + export PS1 + VIRTUAL_ENV_PROMPT="(keras2env) " + export VIRTUAL_ENV_PROMPT +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null +fi diff --git a/keras2env/bin/activate.csh b/keras2env/bin/activate.csh new file mode 100644 index 0000000000000000000000000000000000000000..e24950cbe5dd7ebacd00c7ed671d09b07da0e8ea --- /dev/null +++ b/keras2env/bin/activate.csh @@ -0,0 +1,26 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/keras2env" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = "(keras2env) $prompt" + setenv VIRTUAL_ENV_PROMPT "(keras2env) " +endif + +alias pydoc python -m pydoc + +rehash diff --git a/keras2env/bin/activate.fish b/keras2env/bin/activate.fish new file mode 100644 index 0000000000000000000000000000000000000000..d9a766f3d85a30584ed75024ec36c3d83abab006 --- /dev/null +++ b/keras2env/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/); you cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/keras2env" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) "(keras2env) " (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" + set -gx VIRTUAL_ENV_PROMPT "(keras2env) " +end diff --git a/keras2env/bin/f2py b/keras2env/bin/f2py new file mode 100755 index 0000000000000000000000000000000000000000..004c679b4c538cec1d4172a2a2a468f3736a665a --- /dev/null +++ b/keras2env/bin/f2py @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/flask b/keras2env/bin/flask new file mode 100755 index 0000000000000000000000000000000000000000..af0b385919fc98f91120db3681a09d04d6566053 --- /dev/null +++ b/keras2env/bin/flask @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from flask.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/fonttools b/keras2env/bin/fonttools new file mode 100755 index 0000000000000000000000000000000000000000..1da2ae9704652c1469660a65a4863c57d1b430e7 --- /dev/null +++ b/keras2env/bin/fonttools @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/futurize b/keras2env/bin/futurize new file mode 100755 index 0000000000000000000000000000000000000000..ae7786a9db9a07c08a03e00a494763a4929a8613 --- /dev/null +++ b/keras2env/bin/futurize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from libfuturize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/import_pb_to_tensorboard b/keras2env/bin/import_pb_to_tensorboard new file mode 100755 index 0000000000000000000000000000000000000000..68b0631d5dd3b200025c5899bd2975f568afcc9c --- /dev/null +++ b/keras2env/bin/import_pb_to_tensorboard @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.import_pb_to_tensorboard import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/isympy b/keras2env/bin/isympy new file mode 100755 index 0000000000000000000000000000000000000000..6adeea24a53ea8c3163763d0da1ec13782b4e470 --- /dev/null +++ b/keras2env/bin/isympy @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from isympy import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/markdown-it b/keras2env/bin/markdown-it new file mode 100755 index 0000000000000000000000000000000000000000..6ed601542e1fd5792c5c87f658462008092b189d --- /dev/null +++ b/keras2env/bin/markdown-it @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from markdown_it.cli.parse import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/markdown_py b/keras2env/bin/markdown_py new file mode 100755 index 0000000000000000000000000000000000000000..b0b2f2b6ea73bf78b0107b7ad8d1ff6d8db83689 --- /dev/null +++ b/keras2env/bin/markdown_py @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from markdown.__main__ import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/keras2env/bin/ngrok-asgi b/keras2env/bin/ngrok-asgi new file mode 100755 index 0000000000000000000000000000000000000000..20484e56b9103cd2879a9cff8ea27e4a78719266 --- /dev/null +++ b/keras2env/bin/ngrok-asgi @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from ngrok import __main__ +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(__main__.asgi_cli()) diff --git a/keras2env/bin/normalizer b/keras2env/bin/normalizer new file mode 100755 index 0000000000000000000000000000000000000000..e7ef916dac28e518a10812405427253c52d6b810 --- /dev/null +++ b/keras2env/bin/normalizer @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from charset_normalizer import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli.cli_detect()) diff --git a/keras2env/bin/pasteurize b/keras2env/bin/pasteurize new file mode 100755 index 0000000000000000000000000000000000000000..61ab4f47e058f3280c6faa6b2dfe0812e038cb7b --- /dev/null +++ b/keras2env/bin/pasteurize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from libpasteurize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pip b/keras2env/bin/pip new file mode 100755 index 0000000000000000000000000000000000000000..6f37467a69d04d9a0eca5b5a8f552ace231eb594 --- /dev/null +++ b/keras2env/bin/pip @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pip3 b/keras2env/bin/pip3 new file mode 100755 index 0000000000000000000000000000000000000000..6f37467a69d04d9a0eca5b5a8f552ace231eb594 --- /dev/null +++ b/keras2env/bin/pip3 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pip3.10 b/keras2env/bin/pip3.10 new file mode 100755 index 0000000000000000000000000000000000000000..6f37467a69d04d9a0eca5b5a8f552ace231eb594 --- /dev/null +++ b/keras2env/bin/pip3.10 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pyftmerge b/keras2env/bin/pyftmerge new file mode 100755 index 0000000000000000000000000000000000000000..b3f4caa0f29f139bbbae5f5be75f56eef5a5b9e5 --- /dev/null +++ b/keras2env/bin/pyftmerge @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.merge import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pyftsubset b/keras2env/bin/pyftsubset new file mode 100755 index 0000000000000000000000000000000000000000..97fd022048a0d0561a536e82b65dcd1251a59ae7 --- /dev/null +++ b/keras2env/bin/pyftsubset @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.subset import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/pygmentize b/keras2env/bin/pygmentize new file mode 100755 index 0000000000000000000000000000000000000000..6024e8dd3302bfa9f1f8d1ed0f0cac88ec9bee64 --- /dev/null +++ b/keras2env/bin/pygmentize @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/python b/keras2env/bin/python new file mode 120000 index 0000000000000000000000000000000000000000..b8a0adbbb97ea11f36eb0c6b2a3c2881e96f8e26 --- /dev/null +++ b/keras2env/bin/python @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/keras2env/bin/python3 b/keras2env/bin/python3 new file mode 120000 index 0000000000000000000000000000000000000000..88948d6da77073dc2236cde311d7fa1b82a86f97 --- /dev/null +++ b/keras2env/bin/python3 @@ -0,0 +1 @@ +/Users/sc-gladiator/cv.github.io/tf2.12env/bin/python3 \ No newline at end of file diff --git a/keras2env/bin/python3.10 b/keras2env/bin/python3.10 new file mode 120000 index 0000000000000000000000000000000000000000..b8a0adbbb97ea11f36eb0c6b2a3c2881e96f8e26 --- /dev/null +++ b/keras2env/bin/python3.10 @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/keras2env/bin/saved_model_cli b/keras2env/bin/saved_model_cli new file mode 100755 index 0000000000000000000000000000000000000000..210be462fdde2e88c0c6707222f88d8a2df55a20 --- /dev/null +++ b/keras2env/bin/saved_model_cli @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.saved_model_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/tensorboard b/keras2env/bin/tensorboard new file mode 100755 index 0000000000000000000000000000000000000000..ac9ee0a90d5628cb90e55679baeab69deecfb798 --- /dev/null +++ b/keras2env/bin/tensorboard @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorboard.main import run_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_main()) diff --git a/keras2env/bin/tf_upgrade_v2 b/keras2env/bin/tf_upgrade_v2 new file mode 100755 index 0000000000000000000000000000000000000000..db826b39fa955c6096fdb53265d80a4b1a82a0c4 --- /dev/null +++ b/keras2env/bin/tf_upgrade_v2 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.tools.compatibility.tf_upgrade_v2_main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/tflite_convert b/keras2env/bin/tflite_convert new file mode 100755 index 0000000000000000000000000000000000000000..e5565511004f5dc703a3cd4958d1570c39a04505 --- /dev/null +++ b/keras2env/bin/tflite_convert @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/toco b/keras2env/bin/toco new file mode 100755 index 0000000000000000000000000000000000000000..e5565511004f5dc703a3cd4958d1570c39a04505 --- /dev/null +++ b/keras2env/bin/toco @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/torchfrtrace b/keras2env/bin/torchfrtrace new file mode 100755 index 0000000000000000000000000000000000000000..60f2947fc5ed84c4ed03ddfaf7dfa298e5f9b3d4 --- /dev/null +++ b/keras2env/bin/torchfrtrace @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tools.flight_recorder.fr_trace import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/torchrun b/keras2env/bin/torchrun new file mode 100755 index 0000000000000000000000000000000000000000..f132ac7a3c8f36110c1261fb8a3f93d7a15b3aff --- /dev/null +++ b/keras2env/bin/torchrun @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from torch.distributed.run import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/tqdm b/keras2env/bin/tqdm new file mode 100755 index 0000000000000000000000000000000000000000..b7edbd400288284d0fb2dd5fd9a221a34f79ae0a --- /dev/null +++ b/keras2env/bin/tqdm @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from tqdm.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/ttx b/keras2env/bin/ttx new file mode 100755 index 0000000000000000000000000000000000000000..284faaa752e1558cde0a069e2a9bb58d5d53918e --- /dev/null +++ b/keras2env/bin/ttx @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.ttx import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/bin/wheel b/keras2env/bin/wheel new file mode 100755 index 0000000000000000000000000000000000000000..dc96ce0ea030e5c629babaf8eecd300f98643460 --- /dev/null +++ b/keras2env/bin/wheel @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/keras2env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/keras2env/pyvenv.cfg b/keras2env/pyvenv.cfg new file mode 100644 index 0000000000000000000000000000000000000000..35015eb95de91026a54f5e0911ce80f638c1c17b --- /dev/null +++ b/keras2env/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /Users/sc-gladiator/cv.github.io/tf2.12env/bin +include-system-site-packages = false +version = 3.10.13 diff --git a/keras2env/share/man/man1/isympy.1 b/keras2env/share/man/man1/isympy.1 new file mode 100644 index 0000000000000000000000000000000000000000..0ff966158a28c5ad1a6cd954e454842b25fdd999 --- /dev/null +++ b/keras2env/share/man/man1/isympy.1 @@ -0,0 +1,188 @@ +'\" -*- coding: us-ascii -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH isympy 1 2007-10-8 "" "" +.SH NAME +isympy \- interactive shell for SymPy +.SH SYNOPSIS +'nh +.fi +.ad l +\fBisympy\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[\fB-c\fR | \fB--console\fR] [\fB-p\fR ENCODING | \fB--pretty\fR ENCODING] [\fB-t\fR TYPE | \fB--types\fR TYPE] [\fB-o\fR ORDER | \fB--order\fR ORDER] [\fB-q\fR | \fB--quiet\fR] [\fB-d\fR | \fB--doctest\fR] [\fB-C\fR | \fB--no-cache\fR] [\fB-a\fR | \fB--auto\fR] [\fB-D\fR | \fB--debug\fR] [ +-- | PYTHONOPTIONS] +'in \n(.iu-\nxu +.ad b +'hy +'nh +.fi +.ad l +\fBisympy\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[ +{\fB-h\fR | \fB--help\fR} +| +{\fB-v\fR | \fB--version\fR} +] +'in \n(.iu-\nxu +.ad b +'hy +.SH DESCRIPTION +isympy is a Python shell for SymPy. It is just a normal python shell +(ipython shell if you have the ipython package installed) that executes +the following commands so that you don't have to: +.PP +.nf +\*(T< +>>> from __future__ import division +>>> from sympy import * +>>> x, y, z = symbols("x,y,z") +>>> k, m, n = symbols("k,m,n", integer=True) + \*(T> +.fi +.PP +So starting isympy is equivalent to starting python (or ipython) and +executing the above commands by hand. It is intended for easy and quick +experimentation with SymPy. For more complicated programs, it is recommended +to write a script and import things explicitly (using the "from sympy +import sin, log, Symbol, ..." idiom). +.SH OPTIONS +.TP +\*(T<\fB\-c \fR\*(T>\fISHELL\fR, \*(T<\fB\-\-console=\fR\*(T>\fISHELL\fR +Use the specified shell (python or ipython) as +console backend instead of the default one (ipython +if present or python otherwise). + +Example: isympy -c python + +\fISHELL\fR could be either +\&'ipython' or 'python' +.TP +\*(T<\fB\-p \fR\*(T>\fIENCODING\fR, \*(T<\fB\-\-pretty=\fR\*(T>\fIENCODING\fR +Setup pretty printing in SymPy. By default, the most pretty, unicode +printing is enabled (if the terminal supports it). You can use less +pretty ASCII printing instead or no pretty printing at all. + +Example: isympy -p no + +\fIENCODING\fR must be one of 'unicode', +\&'ascii' or 'no'. +.TP +\*(T<\fB\-t \fR\*(T>\fITYPE\fR, \*(T<\fB\-\-types=\fR\*(T>\fITYPE\fR +Setup the ground types for the polys. By default, gmpy ground types +are used if gmpy2 or gmpy is installed, otherwise it falls back to python +ground types, which are a little bit slower. You can manually +choose python ground types even if gmpy is installed (e.g., for testing purposes). + +Note that sympy ground types are not supported, and should be used +only for experimental purposes. + +Note that the gmpy1 ground type is primarily intended for testing; it the +use of gmpy even if gmpy2 is available. + +This is the same as setting the environment variable +SYMPY_GROUND_TYPES to the given ground type (e.g., +SYMPY_GROUND_TYPES='gmpy') + +The ground types can be determined interactively from the variable +sympy.polys.domains.GROUND_TYPES inside the isympy shell itself. + +Example: isympy -t python + +\fITYPE\fR must be one of 'gmpy', +\&'gmpy1' or 'python'. +.TP +\*(T<\fB\-o \fR\*(T>\fIORDER\fR, \*(T<\fB\-\-order=\fR\*(T>\fIORDER\fR +Setup the ordering of terms for printing. The default is lex, which +orders terms lexicographically (e.g., x**2 + x + 1). You can choose +other orderings, such as rev-lex, which will use reverse +lexicographic ordering (e.g., 1 + x + x**2). + +Note that for very large expressions, ORDER='none' may speed up +printing considerably, with the tradeoff that the order of the terms +in the printed expression will have no canonical order + +Example: isympy -o rev-lax + +\fIORDER\fR must be one of 'lex', 'rev-lex', 'grlex', +\&'rev-grlex', 'grevlex', 'rev-grevlex', 'old', or 'none'. +.TP +\*(T<\fB\-q\fR\*(T>, \*(T<\fB\-\-quiet\fR\*(T> +Print only Python's and SymPy's versions to stdout at startup, and nothing else. +.TP +\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-\-doctest\fR\*(T> +Use the same format that should be used for doctests. This is +equivalent to '\fIisympy -c python -p no\fR'. +.TP +\*(T<\fB\-C\fR\*(T>, \*(T<\fB\-\-no\-cache\fR\*(T> +Disable the caching mechanism. Disabling the cache may slow certain +operations down considerably. This is useful for testing the cache, +or for benchmarking, as the cache can result in deceptive benchmark timings. + +This is the same as setting the environment variable SYMPY_USE_CACHE +to 'no'. +.TP +\*(T<\fB\-a\fR\*(T>, \*(T<\fB\-\-auto\fR\*(T> +Automatically create missing symbols. Normally, typing a name of a +Symbol that has not been instantiated first would raise NameError, +but with this option enabled, any undefined name will be +automatically created as a Symbol. This only works in IPython 0.11. + +Note that this is intended only for interactive, calculator style +usage. In a script that uses SymPy, Symbols should be instantiated +at the top, so that it's clear what they are. + +This will not override any names that are already defined, which +includes the single character letters represented by the mnemonic +QCOSINE (see the "Gotchas and Pitfalls" document in the +documentation). You can delete existing names by executing "del +name" in the shell itself. You can see if a name is defined by typing +"'name' in globals()". + +The Symbols that are created using this have default assumptions. +If you want to place assumptions on symbols, you should create them +using symbols() or var(). + +Finally, this only works in the top level namespace. So, for +example, if you define a function in isympy with an undefined +Symbol, it will not work. +.TP +\*(T<\fB\-D\fR\*(T>, \*(T<\fB\-\-debug\fR\*(T> +Enable debugging output. This is the same as setting the +environment variable SYMPY_DEBUG to 'True'. The debug status is set +in the variable SYMPY_DEBUG within isympy. +.TP +-- \fIPYTHONOPTIONS\fR +These options will be passed on to \fIipython (1)\fR shell. +Only supported when ipython is being used (standard python shell not supported). + +Two dashes (--) are required to separate \fIPYTHONOPTIONS\fR +from the other isympy options. + +For example, to run iSymPy without startup banner and colors: + +isympy -q -c ipython -- --colors=NoColor +.TP +\*(T<\fB\-h\fR\*(T>, \*(T<\fB\-\-help\fR\*(T> +Print help output and exit. +.TP +\*(T<\fB\-v\fR\*(T>, \*(T<\fB\-\-version\fR\*(T> +Print isympy version information and exit. +.SH FILES +.TP +\*(T<\fI${HOME}/.sympy\-history\fR\*(T> +Saves the history of commands when using the python +shell as backend. +.SH BUGS +The upstreams BTS can be found at \(lahttps://github.com/sympy/sympy/issues\(ra +Please report all bugs that you find in there, this will help improve +the overall quality of SymPy. +.SH "SEE ALSO" +\fBipython\fR(1), \fBpython\fR(1) diff --git a/keras2env/share/man/man1/ttx.1 b/keras2env/share/man/man1/ttx.1 new file mode 100644 index 0000000000000000000000000000000000000000..bba23b5e51629509a499f4471fc8196e9863d211 --- /dev/null +++ b/keras2env/share/man/man1/ttx.1 @@ -0,0 +1,225 @@ +.Dd May 18, 2004 +.\" ttx is not specific to any OS, but contrary to what groff_mdoc(7) +.\" seems to imply, entirely omitting the .Os macro causes 'BSD' to +.\" be used, so I give a zero-width space as its argument. +.Os \& +.\" The "FontTools Manual" argument apparently has no effect in +.\" groff 1.18.1. I think it is a bug in the -mdoc groff package. +.Dt TTX 1 "FontTools Manual" +.Sh NAME +.Nm ttx +.Nd tool for manipulating TrueType and OpenType fonts +.Sh SYNOPSIS +.Nm +.Bk +.Op Ar option ... +.Ek +.Bk +.Ar file ... +.Ek +.Sh DESCRIPTION +.Nm +is a tool for manipulating TrueType and OpenType fonts. It can convert +TrueType and OpenType fonts to and from an +.Tn XML Ns -based format called +.Tn TTX . +.Tn TTX +files have a +.Ql .ttx +extension. +.Pp +For each +.Ar file +argument it is given, +.Nm +detects whether it is a +.Ql .ttf , +.Ql .otf +or +.Ql .ttx +file and acts accordingly: if it is a +.Ql .ttf +or +.Ql .otf +file, it generates a +.Ql .ttx +file; if it is a +.Ql .ttx +file, it generates a +.Ql .ttf +or +.Ql .otf +file. +.Pp +By default, every output file is created in the same directory as the +corresponding input file and with the same name except for the +extension, which is substituted appropriately. +.Nm +never overwrites existing files; if necessary, it appends a suffix to +the output file name before the extension, as in +.Pa Arial#1.ttf . +.Ss "General options" +.Bl -tag -width ".Fl t Ar table" +.It Fl h +Display usage information. +.It Fl d Ar dir +Write the output files to directory +.Ar dir +instead of writing every output file to the same directory as the +corresponding input file. +.It Fl o Ar file +Write the output to +.Ar file +instead of writing it to the same directory as the +corresponding input file. +.It Fl v +Be verbose. Write more messages to the standard output describing what +is being done. +.It Fl a +Allow virtual glyphs ID's on compile or decompile. +.El +.Ss "Dump options" +The following options control the process of dumping font files +(TrueType or OpenType) to +.Tn TTX +files. +.Bl -tag -width ".Fl t Ar table" +.It Fl l +List table information. Instead of dumping the font to a +.Tn TTX +file, display minimal information about each table. +.It Fl t Ar table +Dump table +.Ar table . +This option may be given multiple times to dump several tables at +once. When not specified, all tables are dumped. +.It Fl x Ar table +Exclude table +.Ar table +from the list of tables to dump. This option may be given multiple +times to exclude several tables from the dump. The +.Fl t +and +.Fl x +options are mutually exclusive. +.It Fl s +Split tables. Dump each table to a separate +.Tn TTX +file and write (under the name that would have been used for the output +file if the +.Fl s +option had not been given) one small +.Tn TTX +file containing references to the individual table dump files. This +file can be used as input to +.Nm +as long as the referenced files can be found in the same directory. +.It Fl i +.\" XXX: I suppose OpenType programs (exist and) are also affected. +Don't disassemble TrueType instructions. When this option is specified, +all TrueType programs (glyph programs, the font program and the +pre-program) are written to the +.Tn TTX +file as hexadecimal data instead of +assembly. This saves some time and results in smaller +.Tn TTX +files. +.It Fl y Ar n +When decompiling a TrueType Collection (TTC) file, +decompile font number +.Ar n , +starting from 0. +.El +.Ss "Compilation options" +The following options control the process of compiling +.Tn TTX +files into font files (TrueType or OpenType): +.Bl -tag -width ".Fl t Ar table" +.It Fl m Ar fontfile +Merge the input +.Tn TTX +file +.Ar file +with +.Ar fontfile . +No more than one +.Ar file +argument can be specified when this option is used. +.It Fl b +Don't recalculate glyph bounding boxes. Use the values in the +.Tn TTX +file as is. +.El +.Sh "THE TTX FILE FORMAT" +You can find some information about the +.Tn TTX +file format in +.Pa documentation.html . +In particular, you will find in that file the list of tables understood by +.Nm +and the relations between TrueType GlyphIDs and the glyph names used in +.Tn TTX +files. +.Sh EXAMPLES +In the following examples, all files are read from and written to the +current directory. Additionally, the name given for the output file +assumes in every case that it did not exist before +.Nm +was invoked. +.Pp +Dump the TrueType font contained in +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx FreeSans.ttf +.Pp +Compile +.Pa MyFont.ttx +into a TrueType or OpenType font file: +.Pp +.Dl ttx MyFont.ttx +.Pp +List the tables in +.Pa FreeSans.ttf +along with some information: +.Pp +.Dl ttx -l FreeSans.ttf +.Pp +Dump the +.Sq cmap +table from +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx -t cmap FreeSans.ttf +.Sh NOTES +On MS\-Windows and MacOS, +.Nm +is available as a graphical application to which files can be dropped. +.Sh SEE ALSO +.Pa documentation.html +.Pp +.Xr fontforge 1 , +.Xr ftinfo 1 , +.Xr gfontview 1 , +.Xr xmbdfed 1 , +.Xr Font::TTF 3pm +.Sh AUTHORS +.Nm +was written by +.An -nosplit +.An "Just van Rossum" Aq just@letterror.com . +.Pp +This manual page was written by +.An "Florent Rougon" Aq f.rougon@free.fr +for the Debian GNU/Linux system based on the existing FontTools +documentation. It may be freely used, modified and distributed without +restrictions. +.\" For Emacs: +.\" Local Variables: +.\" fill-column: 72 +.\" sentence-end: "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ \n]*" +.\" sentence-end-double-space: t +.\" End: \ No newline at end of file diff --git a/resave_model.py b/resave_model.py new file mode 100644 index 0000000000000000000000000000000000000000..440f25604a2bd9ac3c8d36af9b98f89047d8ade9 --- /dev/null +++ b/resave_model.py @@ -0,0 +1,5 @@ +from tensorflow.keras.models import load_model + +model = load_model('/Users/sc-gladiator/cv.github.io/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5') +# model.save('bodybuilding_pose_classifier_tf2.12.h5') +model.save('bodybuilding_pose_classifier_savedmodel.keras') \ No newline at end of file diff --git a/tf2.12env/bin/Activate.ps1 b/tf2.12env/bin/Activate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b49d77ba44b24fe6d69f6bbe75139b3b5dc23075 --- /dev/null +++ b/tf2.12env/bin/Activate.ps1 @@ -0,0 +1,247 @@ +<# +.Synopsis +Activate a Python virtual environment for the current PowerShell session. + +.Description +Pushes the python executable for a virtual environment to the front of the +$Env:PATH environment variable and sets the prompt to signify that you are +in a Python virtual environment. Makes use of the command line switches as +well as the `pyvenv.cfg` file values present in the virtual environment. + +.Parameter VenvDir +Path to the directory that contains the virtual environment to activate. The +default value for this is the parent of the directory that the Activate.ps1 +script is located within. + +.Parameter Prompt +The prompt prefix to display when this virtual environment is activated. By +default, this prompt is the name of the virtual environment folder (VenvDir) +surrounded by parentheses and followed by a single space (ie. '(.venv) '). + +.Example +Activate.ps1 +Activates the Python virtual environment that contains the Activate.ps1 script. + +.Example +Activate.ps1 -Verbose +Activates the Python virtual environment that contains the Activate.ps1 script, +and shows extra information about the activation as it executes. + +.Example +Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv +Activates the Python virtual environment located in the specified location. + +.Example +Activate.ps1 -Prompt "MyPython" +Activates the Python virtual environment that contains the Activate.ps1 script, +and prefixes the current prompt with the specified string (surrounded in +parentheses) while the virtual environment is active. + +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +https://go.microsoft.com/fwlink/?LinkID=135170 + +#> +Param( + [Parameter(Mandatory = $false)] + [String] + $VenvDir, + [Parameter(Mandatory = $false)] + [String] + $Prompt +) + +<# Function declarations --------------------------------------------------- #> + +<# +.Synopsis +Remove all shell session elements added by the Activate script, including the +addition of the virtual environment's Python executable from the beginning of +the PATH variable. + +.Parameter NonDestructive +If present, do not remove this function from the global namespace for the +session. + +#> +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + + # The prior prompt: + if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) { + Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt + Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT + } + + # The prior PYTHONHOME: + if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) { + Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME + Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME + } + + # The prior PATH: + if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) { + Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH + Remove-Item -Path Env:_OLD_VIRTUAL_PATH + } + + # Just remove the VIRTUAL_ENV altogether: + if (Test-Path -Path Env:VIRTUAL_ENV) { + Remove-Item -Path env:VIRTUAL_ENV + } + + # Just remove VIRTUAL_ENV_PROMPT altogether. + if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) { + Remove-Item -Path env:VIRTUAL_ENV_PROMPT + } + + # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether: + if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) { + Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force + } + + # Leave deactivate function in the global namespace if requested: + if (-not $NonDestructive) { + Remove-Item -Path function:deactivate + } +} + +<# +.Description +Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the +given folder, and returns them in a map. + +For each line in the pyvenv.cfg file, if that line can be parsed into exactly +two strings separated by `=` (with any amount of whitespace surrounding the =) +then it is considered a `key = value` line. The left hand string is the key, +the right hand is the value. + +If the value starts with a `'` or a `"` then the first and last character is +stripped from the value before being captured. + +.Parameter ConfigDir +Path to the directory that contains the `pyvenv.cfg` file. +#> +function Get-PyVenvConfig( + [String] + $ConfigDir +) { + Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg" + + # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue). + $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue + + # An empty map will be returned if no config file is found. + $pyvenvConfig = @{ } + + if ($pyvenvConfigPath) { + + Write-Verbose "File exists, parse `key = value` lines" + $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath + + $pyvenvConfigContent | ForEach-Object { + $keyval = $PSItem -split "\s*=\s*", 2 + if ($keyval[0] -and $keyval[1]) { + $val = $keyval[1] + + # Remove extraneous quotations around a string value. + if ("'""".Contains($val.Substring(0, 1))) { + $val = $val.Substring(1, $val.Length - 2) + } + + $pyvenvConfig[$keyval[0]] = $val + Write-Verbose "Adding Key: '$($keyval[0])'='$val'" + } + } + } + return $pyvenvConfig +} + + +<# Begin Activate script --------------------------------------------------- #> + +# Determine the containing directory of this script +$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition +$VenvExecDir = Get-Item -Path $VenvExecPath + +Write-Verbose "Activation script is located in path: '$VenvExecPath'" +Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)" +Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" + +# Set values required in priority: CmdLine, ConfigFile, Default +# First, get the location of the virtual environment, it might not be +# VenvExecDir if specified on the command line. +if ($VenvDir) { + Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" +} +else { + Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." + $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") + Write-Verbose "VenvDir=$VenvDir" +} + +# Next, read the `pyvenv.cfg` file to determine any required value such +# as `prompt`. +$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir + +# Next, set the prompt from the command line, or the config file, or +# just use the name of the virtual environment folder. +if ($Prompt) { + Write-Verbose "Prompt specified as argument, using '$Prompt'" +} +else { + Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" + if ($pyvenvCfg -and $pyvenvCfg['prompt']) { + Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" + $Prompt = $pyvenvCfg['prompt']; + } + else { + Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)" + Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'" + $Prompt = Split-Path -Path $venvDir -Leaf + } +} + +Write-Verbose "Prompt = '$Prompt'" +Write-Verbose "VenvDir='$VenvDir'" + +# Deactivate any currently active virtual environment, but leave the +# deactivate function in place. +deactivate -nondestructive + +# Now set the environment variable VIRTUAL_ENV, used by many tools to determine +# that there is an activated venv. +$env:VIRTUAL_ENV = $VenvDir + +if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) { + + Write-Verbose "Setting prompt to '$Prompt'" + + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT { "" } + Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT + New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt + + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) " + _OLD_VIRTUAL_PROMPT + } + $env:VIRTUAL_ENV_PROMPT = $Prompt +} + +# Clear PYTHONHOME +if (Test-Path -Path Env:PYTHONHOME) { + Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME + Remove-Item -Path Env:PYTHONHOME +} + +# Add the venv to the PATH +Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH +$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH" diff --git a/tf2.12env/bin/activate b/tf2.12env/bin/activate new file mode 100644 index 0000000000000000000000000000000000000000..6fbf8d2c756661ae137efe7477405c098383edea --- /dev/null +++ b/tf2.12env/bin/activate @@ -0,0 +1,69 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="/Users/sc-gladiator/cv.github.io/tf2.12env" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + PS1="(tf2.12env) ${PS1:-}" + export PS1 + VIRTUAL_ENV_PROMPT="(tf2.12env) " + export VIRTUAL_ENV_PROMPT +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r 2> /dev/null +fi diff --git a/tf2.12env/bin/activate.csh b/tf2.12env/bin/activate.csh new file mode 100644 index 0000000000000000000000000000000000000000..b607f001a6223d9ce2c7a7bc8fb9630cd22af02b --- /dev/null +++ b/tf2.12env/bin/activate.csh @@ -0,0 +1,26 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . +# Ported to Python 3.3 venv by Andrew Svetlov + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/tf2.12env" + +set _OLD_VIRTUAL_PATH="$PATH" +setenv PATH "$VIRTUAL_ENV/bin:$PATH" + + +set _OLD_VIRTUAL_PROMPT="$prompt" + +if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then + set prompt = "(tf2.12env) $prompt" + setenv VIRTUAL_ENV_PROMPT "(tf2.12env) " +endif + +alias pydoc python -m pydoc + +rehash diff --git a/tf2.12env/bin/activate.fish b/tf2.12env/bin/activate.fish new file mode 100644 index 0000000000000000000000000000000000000000..2a28acda7e76501434f78d44af966515e0cffcb4 --- /dev/null +++ b/tf2.12env/bin/activate.fish @@ -0,0 +1,69 @@ +# This file must be used with "source /bin/activate.fish" *from fish* +# (https://fishshell.com/); you cannot run it directly. + +function deactivate -d "Exit virtual environment and return to normal shell environment" + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + set -gx PATH $_OLD_VIRTUAL_PATH + set -e _OLD_VIRTUAL_PATH + end + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + set -e _OLD_FISH_PROMPT_OVERRIDE + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + if test "$argv[1]" != "nondestructive" + # Self-destruct! + functions -e deactivate + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV "/Users/sc-gladiator/cv.github.io/tf2.12env" + +set -gx _OLD_VIRTUAL_PATH $PATH +set -gx PATH "$VIRTUAL_ENV/bin" $PATH + +# Unset PYTHONHOME if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # fish uses a function instead of an env var to generate the prompt. + + # Save the current fish_prompt function as the function _old_fish_prompt. + functions -c fish_prompt _old_fish_prompt + + # With the original prompt function renamed, we can override with our own. + function fish_prompt + # Save the return status of the last command. + set -l old_status $status + + # Output the venv prompt; color taken from the blue of the Python logo. + printf "%s%s%s" (set_color 4B8BBE) "(tf2.12env) " (set_color normal) + + # Restore the return status of the previous command. + echo "exit $old_status" | . + # Output the original/"old" prompt. + _old_fish_prompt + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" + set -gx VIRTUAL_ENV_PROMPT "(tf2.12env) " +end diff --git a/tf2.12env/bin/pip b/tf2.12env/bin/pip new file mode 100755 index 0000000000000000000000000000000000000000..999bde78a162632c158040abbfae011e3188e08d --- /dev/null +++ b/tf2.12env/bin/pip @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/tf2.12env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/tf2.12env/bin/pip3 b/tf2.12env/bin/pip3 new file mode 100755 index 0000000000000000000000000000000000000000..999bde78a162632c158040abbfae011e3188e08d --- /dev/null +++ b/tf2.12env/bin/pip3 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/tf2.12env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/tf2.12env/bin/pip3.10 b/tf2.12env/bin/pip3.10 new file mode 100755 index 0000000000000000000000000000000000000000..999bde78a162632c158040abbfae011e3188e08d --- /dev/null +++ b/tf2.12env/bin/pip3.10 @@ -0,0 +1,8 @@ +#!/Users/sc-gladiator/cv.github.io/tf2.12env/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/tf2.12env/bin/python b/tf2.12env/bin/python new file mode 120000 index 0000000000000000000000000000000000000000..b8a0adbbb97ea11f36eb0c6b2a3c2881e96f8e26 --- /dev/null +++ b/tf2.12env/bin/python @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/tf2.12env/bin/python3 b/tf2.12env/bin/python3 new file mode 120000 index 0000000000000000000000000000000000000000..342ddb4249d762881172b9ac82fb6faf9817db02 --- /dev/null +++ b/tf2.12env/bin/python3 @@ -0,0 +1 @@ +/Users/sc-gladiator/cv.github.io/.venv/bin/python3 \ No newline at end of file diff --git a/tf2.12env/bin/python3.10 b/tf2.12env/bin/python3.10 new file mode 120000 index 0000000000000000000000000000000000000000..b8a0adbbb97ea11f36eb0c6b2a3c2881e96f8e26 --- /dev/null +++ b/tf2.12env/bin/python3.10 @@ -0,0 +1 @@ +python3 \ No newline at end of file diff --git a/tf2.12env/pyvenv.cfg b/tf2.12env/pyvenv.cfg new file mode 100644 index 0000000000000000000000000000000000000000..0822927e6895f29c27a9666ea3d5c8ce9a9d208f --- /dev/null +++ b/tf2.12env/pyvenv.cfg @@ -0,0 +1,3 @@ +home = /Users/sc-gladiator/cv.github.io/.venv/bin +include-system-site-packages = false +version = 3.10.13 diff --git a/yolov7-w6-pose.pt b/yolov7-w6-pose.pt new file mode 100644 index 0000000000000000000000000000000000000000..d223f687406454f599289ee0471f9098288cc4ae --- /dev/null +++ b/yolov7-w6-pose.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8394a97f5a5283269028738e80006f3e9835088f00d293108bdee3320f2b0f8d +size 161114789