update yt-dlp and fix some bugs with TPE2. Fixes #3

This commit is contained in:
2026-01-31 11:10:33 +00:00
parent 4aa0c5b6d9
commit 879a318e54
6 changed files with 174 additions and 91 deletions

View File

@@ -247,7 +247,8 @@ Python versions 3.10+ (CPython) and 3.11+ (PyPy) are supported. Other
versions and implementations may or may not work correctly.
While all the other dependencies are optional, ffmpeg, ffprobe,
yt-dlp-ejs and a JavaScript runtime are highly recommended
yt-dlp-ejs and a supported JavaScript runtime/engine are highly
recommended
Strongly recommended
@@ -264,11 +265,11 @@ Strongly recommended
Important: What you need is ffmpeg binary, NOT the Python package of
the same name
- yt-dlp-ejs - Required for deciphering YouTube n/sig values. Licensed
under Unlicense, bundles MIT and ISC components.
- yt-dlp-ejs - Required for full YouTube support. Licensed under
Unlicense, bundles MIT and ISC components.
A JavaScript runtime like deno (recommended), node.js, bun, or
QuickJS is also required to run yt-dlp-ejs. See the wiki.
A JavaScript runtime/engine like deno (recommended), node.js, bun,
or QuickJS is also required to run yt-dlp-ejs. See the wiki.
Networking
@@ -289,7 +290,7 @@ 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.
- Can be installed with the curl-cffi extra, e.g.
pip install "yt-dlp[default,curl-cffi]"
- Currently included in most builds except yt-dlp (Unix zipimport
binary), yt-dlp_x86 (Windows 32-bit) and
@@ -343,7 +344,7 @@ will be built for the same CPU architecture as the Python used.
You can run the following commands:
python devscripts/install_deps.py --include-group pyinstaller
python devscripts/install_deps.py --include-extra pyinstaller
python devscripts/make_lazy_extractors.py
python -m bundle.pyinstaller
@@ -580,7 +581,7 @@ Geo-restriction:
Video Selection:
-I, --playlist-items ITEM_SPEC Comma separated playlist_index of the items
-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.
@@ -962,6 +963,8 @@ Video Format Options:
for more details
-S, --format-sort SORTORDER Sort the formats by the fields given, see
"Sorting Formats" for more details
--format-sort-reset Disregard previous user specified sort order
and reset to the default
--format-sort-force Force user specified sort order to have
precedence over all fields, see "Sorting
Formats" for more details (Alias: --S-force)
@@ -1481,7 +1484,7 @@ have some special formatting:
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
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
@@ -1562,6 +1565,8 @@ The available fields are:
- 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)
- save_count (numeric): Number of times the video has been saved or
bookmarked
- 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)
@@ -2035,6 +2040,15 @@ 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.
If you use the -S/--format-sort option multiple times, each subsequent
sorting argument will be prepended to the previous one, and only the
highest priority entry of any duplicated field will be preserved. E.g.
-S proto -S res is equivalent to -S res,proto, and
-S res:720,fps -S vcodec,res:1080 is equivalent to
-S vcodec,res:1080,fps. You can use --format-sort-reset to disregard any
previously passed -S/--format-sort arguments and reset to the default
order.
Tip: You can use the -v -F to see how the formats have been sorted
(worst to best).
@@ -2223,9 +2237,9 @@ metadata:
composer composer or composers
genre genre or genres
genre genre, genres, categories or tags
album album
album album or series
album_artist album_artist or album_artists
@@ -2252,6 +2266,9 @@ Modifying metadata examples
# Regex example
$ yt-dlp --parse-metadata "description:Artist - (?P<artist>.+)"
# Copy the episode field to the title field (with FROM and TO as single fields)
$ yt-dlp --parse-metadata "episode:title"
# Set title as "Series name S01E05"
$ yt-dlp --parse-metadata "%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s"
@@ -2295,20 +2312,20 @@ youtube
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_sdkless, android_vr, tv,
web_creator, mweb, ios, ios_downgraded, android, android_vr, tv,
tv_simply, tv_downgraded, and tv_embedded. By default,
tv,android_sdkless,web is used. If no JavaScript runtime is
available, then android_sdkless,web_safari,web is used. If logged-in
cookies are passed to yt-dlp, then tv_downgraded,web_safari,web is
used for free accounts and tv_downgraded,web_creator,web is used for
premium accounts. The web_music client is added for
music.youtube.com URLs when logged-in cookies are used. The
web_embedded client is added for age-restricted videos but only
works if the video is embeddable. 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
android_vr,ios_downgraded,web,web_safari is used. If no JavaScript
runtime/engine is available, then android_vr,ios_downgraded is used.
If logged-in cookies are passed to yt-dlp, then
tv_downgraded,web,web_safari is used for free accounts and
tv_downgraded,web_creator,web is used for premium accounts. The
web_music client is added for music.youtube.com URLs when logged-in
cookies are used. The web_embedded client is added for
age-restricted videos but only works if the video is embeddable. 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
@@ -2338,11 +2355,15 @@ youtube
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
max-comments,max-parents,max-replies,max-replies-per-thread,max-depth.
Default is all,all,all,all,all
- A max-depth value of 1 will discard all replies, regardless of
the max-replies or max-replies-per-thread values given
- E.g. all,all,1000,10,2 will get a maximum of 1000 replies total,
with up to 10 replies per thread, and only 2 levels of depth
(i.e. top-level comments plus their immediate replies).
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
@@ -2363,7 +2384,7 @@ youtube
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
- po_token: Proof of Origin (PO) Token(s) to use. Comma-separated 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 any of gvs (Google Video Server URLs), player
@@ -2375,18 +2396,20 @@ youtube
requires one for the given context), never (never fetch a PO Token),
or auto (default; only fetch a PO Token if the client requires one
for the given context)
- playback_wait: Duration (in seconds) to wait inbetween the
extraction and download stages in order to ensure the formats are
available. The default is 6 seconds
- jsc_trace: Enable debug logging for JS Challenge fetching. Either
true or false (default)
- use_ad_playback_context: Skip preroll ads to eliminate the mandatory
wait period before download. Do NOT use this when passing premium
account cookies to yt-dlp, as it will result in a loss of premium
formats. Only effective with the web, web_safari, web_music and mweb
player clients. Either true or false (default)
youtube-ejs
- jitless: Run suported Javascript engines in JIT-less mode. Supported
runtimes are deno, node and bun. Provides better security at the
cost of performance/speed. Do note that node and bun are still
considered unsecure. Either true or false (default)
- jitless: Run supported Javascript engines in JIT-less mode.
Supported runtimes are deno, node and bun. Provides better security
at the cost of performance/speed. Do note that node and bun are
still considered insecure. Either true or false (default)
youtubepot-webpo
@@ -2568,10 +2591,11 @@ tver
vimeo
- client: Client to extract video data from. The currently available
clients are android, ios, and web. Only one client can be used. The
web client is used by default. The web client only works with
account cookies or login credentials. The android and ios clients
only work with previously cached OAuth tokens
clients are android, ios, macos and web. Only one client can be
used. The macos client is used by default, but the web client is
used when logged-in. The web client only works with account cookies
or login credentials. The android and ios clients only work with
previously cached OAuth tokens
- original_format_policy: Policy for when to try extracting original
formats. One of always, never, or auto. The default auto policy
tries to avoid exceeding the web client's API rate-limit by only
@@ -3085,7 +3109,7 @@ and youtube-dlc:
files by default. Use --mtime or --compat-options mtime-by-default
to revert this.
For ease of use, a few more compat options are available:
For convenience, there are some compat option aliases available to use:
- --compat-options all: Use all compat options (Do NOT use this!)
- --compat-options youtube-dl: Same as
@@ -3097,8 +3121,13 @@ For ease of use, a few more compat options are available:
- --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: Same as --compat-options mtime-by-default.
Use this to enable all future compat options
- --compat-options 2024: Same as
--compat-options 2025,mtime-by-default
- --compat-options 2025: Currently does nothing. Use this to enable
all future compat options
Using one of the yearly compat option aliases will pin yt-dlp's default
behavior to what it was at the end of that calendar year.
The following compat options restore vulnerable behavior from before
security patches: