yt-dlp: [youtube] Native nsig extraction failed (Part 3)
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I remove or skip any mandatory* field
Checklist
- I’m reporting a broken site
- I’ve verified that I’m running yt-dlp version 2023.01.06 (update instructions) or later (specify commit)
- I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
- I’ve read about sharing account credentials and I’m willing to share it if required
Region
Southern Europe
Provide a description that is worded well enough to be understood
Since original #4635 has been a) closed, b) locked, I’m posting this (as a duplicate, I know - apologies 😉 ) to alert the team about the new breakage 😠 …
In the last hours of Jan 31st 2023 in my timezone, Google have shipped yt player dac945fd
, which isn’t palatable to the native JS signature decryptor 😭 ; the code falls back to PhantomJS
and the n-sig decryption then succeeds…
Provide verbose output that clearly demonstrates the problem
- Run your yt-dlp command with -vU flag added (
yt-dlp -vU <your command line>
) - Copy the WHOLE output (starting with
[debug] Command-line config
) and insert it below
Complete Verbose Output
yt-dlp -vUF "p7FCgw_GlWc" --ie youtube =>
[debug] Command-line config: ['--ffmpeg-location', '..\\FFmpeg', '--downloader-args', 'ffmpeg:-v 8 -stats', '-vUF', 'p7FCgw_GlWc', '--ie', 'youtube']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version 2023.01.31 [83c4970e5] (win_x86_exe)
[debug] Python 3.7.16 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 1.1.1s 1 Nov 2022)
[debug] exe versions: ffmpeg n5.2-dev-2245-N-109649-gab8cde6 (setts), ffprobe n5.2-dev-2245-N-109649-gab8cde6, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Extractor Plugins: AGB+NSIG (YoutubeIE)
[debug] Plugin directories: ['<redacted>\\yt-dlp\\yt-dlp-plugins\\YTAgeGateBypass.zip\\yt_dlp_plugins', '<redacted>\\yt-dlp\\yt-dlp-plugins\\YTNSigProxy.zip\\yt_dlp_plugins']
[debug] Loaded 1 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.31
yt-dlp is up to date (2023.01.31)
[youtube+AGB+NSIG] Extracting URL: p7FCgw_GlWc
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading webpage
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading android player API JSON
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading tv embedded player API JSON
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading web embedded client config
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading player dac945fd
[youtube+AGB+NSIG] p7FCgw_GlWc: Downloading web embedded player API JSON
[debug] [youtube+AGB+NSIG] Extracting signature function js_dac945fd_110
[debug] Saving youtube-sigfuncs.js_dac945fd_110 to cache
[debug] Saving youtube-nsig.dac945fd to cache
WARNING: [youtube+AGB+NSIG] p7FCgw_GlWc: Native nsig extraction failed: Trying with PhantomJS
n = CM1X2GXxvV6DnIngBB_3JZ ; player = https://www.youtube.com/s/player/dac945fd/player_ias.vflset/en_US/base.js
[debug] [youtube+AGB+NSIG] Signature function returned an exception; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
[youtube+AGB+NSIG] p7FCgw_GlWc: Executing signature code
[debug] [youtube+AGB+NSIG] PhantomJS command line: phantomjs "--ssl-protocol=any" "C:\Users\<redacted>\AppData\Local\Temp\tmp5jwo0rhl"
[debug] [youtube+AGB+NSIG] Decrypted nsig CM1X2GXxvV6DnIngBB_3JZ => 7_ThGFhQ0nuuyQ
[debug] Loading youtube-nsig.dac945fd from cache
WARNING: [youtube+AGB+NSIG] p7FCgw_GlWc: Native nsig extraction failed: Trying with PhantomJS
n = 4sl9vdkJyZenf4-GQROY3b ; player = https://www.youtube.com/s/player/dac945fd/player_ias.vflset/en_US/base.js
[youtube+AGB+NSIG] p7FCgw_GlWc: Executing signature code
[debug] [youtube+AGB+NSIG] PhantomJS command line: phantomjs "--ssl-protocol=any" "C:\Users\<redacted>\AppData\Local\Temp\tmpptgw_phd"
[debug] [youtube+AGB+NSIG] Decrypted nsig 4sl9vdkJyZenf4-GQROY3b => PxVLDoRYUISU7A
[debug] [youtube+AGB+NSIG] Extracting signature function js_dac945fd_106
[debug] Saving youtube-sigfuncs.js_dac945fd_106 to cache
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[info] Available formats for p7FCgw_GlWc:
ID EXT RESOLUTION FPS CH | FILESIZE TBR PROTO | VCODEC VBR ACODEC ABR ASR MORE INFO
-------------------------------------------------------------------------------------------------------------------------
sb2 mhtml 48x27 0 | mhtml | images storyboard
sb1 mhtml 80x45 0 | mhtml | images storyboard
sb0 mhtml 160x90 0 | mhtml | images storyboard
249-drc webm audio only 2 | 3.89MiB 51k https | audio only opus 51k 48k low, DRC, webm_dash
250-drc webm audio only 2 | 5.04MiB 66k https | audio only opus 66k 48k low, DRC, webm_dash
249 webm audio only 2 | 3.89MiB 51k https | audio only opus 51k 48k low, webm_dash
250 webm audio only 2 | 5.05MiB 67k https | audio only opus 67k 48k low, webm_dash
140-drc m4a audio only 2 | 9.83MiB 129k https | audio only mp4a.40.2 129k 44k medium, DRC, m4a_dash
251-drc webm audio only 2 | 9.65MiB 127k https | audio only opus 127k 48k medium, DRC, webm_dash
140 m4a audio only 2 | 9.83MiB 129k https | audio only mp4a.40.2 129k 44k medium, m4a_dash
251 webm audio only 2 | 9.70MiB 128k https | audio only opus 128k 48k medium, webm_dash
394 mp4 256x144 30 | 6.40MiB 84k https | av01.0.00M.08 84k video only 144p, mp4_dash
160 mp4 256x144 30 | 2.53MiB 33k https | avc1.4d400c 33k video only 144p, mp4_dash
278 webm 256x144 30 | 6.12MiB 81k https | vp9 81k video only 144p, webm_dash
395 mp4 426x240 30 | 14.41MiB 190k https | av01.0.00M.08 190k video only 240p, mp4_dash
133 mp4 426x240 30 | 4.23MiB 56k https | avc1.4d4015 56k video only 240p, mp4_dash
242 webm 426x240 30 | 5.17MiB 68k https | vp9 68k video only 240p, webm_dash
396 mp4 640x360 30 | 22.87MiB 301k https | av01.0.01M.08 301k video only 360p, mp4_dash
134 mp4 640x360 30 | 8.67MiB 114k https | avc1.4d401e 114k video only 360p, mp4_dash
18 mp4 640x360 30 2 | ~ 12.63MiB 162k https | avc1.42001E 162k mp4a.40.2 0k 22k 360p
243 webm 640x360 30 | 9.90MiB 130k https | vp9 130k video only 360p, webm_dash
397 mp4 854x480 30 | 41.59MiB 548k https | av01.0.04M.08 548k video only 480p, mp4_dash
135 mp4 854x480 30 | 14.71MiB 194k https | avc1.4d401f 194k video only 480p, mp4_dash
244 webm 854x480 30 | 15.81MiB 208k https | vp9 208k video only 480p, webm_dash
22 mp4 1280x720 30 2 | ~ 45.22MiB 582k https | avc1.64001F 582k mp4a.40.2 0k 44k 720p
398 mp4 1280x720 30 | 84.46MiB 1112k https | av01.0.05M.08 1112k video only 720p, mp4_dash
136 mp4 1280x720 30 | 34.36MiB 453k https | avc1.4d401f 453k video only 720p, mp4_dash
247 webm 1280x720 30 | 30.57MiB 403k https | vp9 403k video only 720p, webm_dash
399 mp4 1920x1080 30 | 133.61MiB 1760k https | av01.0.08M.08 1760k video only 1080p, mp4_dash
137 mp4 1920x1080 30 | 216.45MiB 2851k https | avc1.640028 2851k video only 1080p, mp4_dash
248 webm 1920x1080 30 | 122.86MiB 1618k https | vp9 1618k video only 1080p, webm_dash
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 4
- Comments: 24 (9 by maintainers)
Commits related to this issue
- [jsinterp] Handle `NaN` in bitwise operators Closes #6131 — committed to stanoarn/yt-dlp by pukkandan a year ago
- [jsinterp] Handle negative numbers better Closes #6131 — committed to luisriverag/yt-dlp by pukkandan a year ago
- [jsinterp] Handle `NaN` in bitwise operators Closes #6131 — committed to luisriverag/yt-dlp by pukkandan a year ago
- [jsinterp] Support `if` statements Closes #6131 — committed to HHeroin/yt-dlp by pukkandan a year ago
This expression, at least, is failing:
The correct value is
243 + (102000/1000)*(-239) + 24205 = 70
but yt-dl and probably yt-dlp get 24209:That is, 24209 = 243 + ((((102000/1000) *
null
) - 239) - 24205), considering that in JSnull
multiplies by 0 (yes!). The “lexical parser” is incorrectly failing to associate -239 with the result of 102000/1000 and making the RHS of the multiplication null instead.New player 6f20102c:
https://github.com/dirkf/youtube-dl/commit/211cbfd5d46025a8e4d8f9f3d424aaada4698974 resolves this for yt-dl, but the operator code is slightly different for yt-dlp.
Ofc a proper precedence-based expression evaluator would be better.
In case anyone needs it right now, the yt-dl version of
js_interp.py
will run in yt-dlp (maybe slower than the native version) if these definitions are added in place of the “compat” versions:Same issue: https://github.com/ytdl-org/youtube-dl/issues/32066
Correct answers, according to Mozilla JS:
lE8DhoDmKqnmJJ
->pJTTX6XyJP2BYw
715xvBdpBOUmT9
->a5BfIQLLNe202w
However, yt-dl is now being sent player
d87d581f
, which can be processed successfully, while yt-dlp is still getting6f20102c
(obvs, this changed just when I’d instrumented yt-dl to debug the issue).@anunasica is not on master. The player works fine for me
It works in master. It breaks native nsig extraction in 2023.01.06 for the same reason as player
dac945fd
: anif
statement in one of the array’s functions, which is handled by 8b008d62544b82e24a0ba36c30e8e51855d93419I highly doubt it, because yt-dlp has to use whichever player youtube.com is using, and youtube.com seems to be using
cfa9e7cb
100% of the time now (excluding music videos)That said, even if you see that warning, it only affects a few formats (not the default ones) so it won’t affect regular users*. Super users can use
--list-formats
to pick formats that aren’t throttled (you’ll know if it’s throttled, because it saysTHROTTLED
in all caps)*Excluding age-restricted videos, which are currently always throttled. I found a complicated workaround though, so I’ll post instructions later
PS: I apologise if anyone finds my definition of “regular users” condescending, I’m just trying to address everyone following this issue at the same time
Player
cfa9e7cb
wants to dofalse << NaN
.NaN
should be zeroised (!) but isn’t.