-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
n-parameter: Unhandled exception in decode #32066
Comments
Please post the whole log without cropping the top! In this case, I can see that you're trying to get the YT video with ID |
Oh, I'm sorry. I'm actually using a script here, not the CLI, so the log is not cropped. But here are the options I use:
And this happens to every video I try to download. Started yesterday. |
Coming soon (the above commit): $ python -m youtube_dl -v -F 'i2-ViOyC7Ek'
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'i2-ViOyC7Ek']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 211cbfd5d
[debug] Python version 2.7.18 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] Extracting URL: i2-ViOyC7Ek
[youtube] i2-ViOyC7Ek: Downloading webpage
[debug] [youtube] Decrypted nsig crYhSJ5EIbtdN2OEP => jykH2eTdaP_Dqw
[debug] [youtube] Decrypted nsig cHQcRxq_Yj4Gi4qJ- => EKFC_eOif5yd2A
[info] Available formats for i2-ViOyC7Ek:
format code extension resolution note
249 webm audio only tiny 47k , webm_dash container, opus @ 47k (48000Hz), 20.86MiB
250 webm audio only tiny 59k , webm_dash container, opus @ 59k (48000Hz), 26.04MiB
251 webm audio only tiny 117k , webm_dash container, opus @117k (48000Hz), 51.40MiB
140 m4a audio only tiny 129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 56.72MiB
160 mp4 256x144 144p 38k , mp4_dash container, avc1.4d400c@ 38k, 25fps, video only, 16.73MiB
278 webm 256x144 144p 62k , webm_dash container, vp9@ 62k, 25fps, video only, 27.53MiB
242 webm 426x240 240p 78k , webm_dash container, vp9@ 78k, 25fps, video only, 34.32MiB
133 mp4 426x240 240p 85k , mp4_dash container, avc1.4d4015@ 85k, 25fps, video only, 37.27MiB
134 mp4 640x360 360p 131k , mp4_dash container, avc1.4d401e@ 131k, 25fps, video only, 57.58MiB
243 webm 640x360 360p 134k , webm_dash container, vp9@ 134k, 25fps, video only, 58.99MiB
244 webm 854x480 480p 208k , webm_dash container, vp9@ 208k, 25fps, video only, 91.29MiB
135 mp4 854x480 480p 289k , mp4_dash container, avc1.4d401e@ 289k, 25fps, video only, 126.78MiB
247 webm 1280x720 720p 440k , webm_dash container, vp9@ 440k, 25fps, video only, 192.94MiB
136 mp4 1280x720 720p 628k , mp4_dash container, avc1.4d401f@ 628k, 25fps, video only, 275.33MiB
248 webm 1920x1080 1080p 596k , webm_dash container, vp9@ 596k, 25fps, video only, 261.49MiB
137 mp4 1920x1080 1080p 2500k , mp4_dash container, avc1.640028@2500k, 25fps, video only, 1.07GiB
18 mp4 640x360 360p 260k , avc1.42001E@ 260k, 25fps, mp4a.40.2@ 0k (44100Hz)
22 mp4 1280x720 720p 757k , avc1.64001F@ 757k, 25fps, mp4a.40.2@ 0k (44100Hz) (best)
$ |
You can just pull the |
@dirkf thanks for the fix. |
How should I guess? Do tell, what errors. The patch is only in my personal branch ATM while it's under test. A viable config should be yt-dl current master master with the |
It would be quicker to try to download than paste the error here. |
Your URL is working fine here: hence the question. |
This is what i get when i replace jsinterp.py in the official repo.
|
Please try the brand new master code (#31530 provides updating instructions if you're not just checking it out with git, but the unofficial nightly builds won't be updated yet). Also, perhaps first, try |
Ok thanks again! |
Thank you, @dirkf ! |
@dirkf I started to get the same problem again, with the same symptoms. Should I open a new issue? |
I was able to repro with player cfa9e7cb.json{"youtube-dl_version": "2021.12.17", "data": [["a"], "var b=a.split(\"\"),c=[1376333568,1823589072,-2144372238,\"\\u228b,}(\\\\\",1116357199,908545500,1787938,1551227465,1773490075,1224122792,function(d,e,f,h,l){return e(f,h,l)},\n-2065760685,function(d,e){e=(e%d.length+d.length)%d.length;d.splice(e,1)},\n1865143271,1123975766,-1841155129,-317410287,-91071786,null,function(d,e){for(e=(e%d.length+d.length)%d.length;e--;)d.unshift(d.pop())},\nfunction(d,e,f,h,l,m,n,p,q){return f(h,l,m,n,p,q)},\n1663147904,-846121055,-1357017406,-1764057255,function(){for(var d=64,e=[];++d-e.length-32;)switch(d){case 58:d=96;continue;case 91:d=44;break;case 65:d=47;continue;case 46:d=153;case 123:d-=58;default:e.push(String.fromCharCode(d))}return e},\n-630894549,1908399050,function(d,e){d.push(e)},\n-1872254917,1363217966,\"throw\",b,-1350318754,1668003369,1937163366,1463729574,1330313634,function(d,e,f,h,l,m,n,p){return e(f,h,l,m,n,p)},\n1212186150,function(d,e){if(0!=e.length){d=(d%e.length+e.length)%e.length;var f=e[0];e[0]=e[d];e[d]=f}},\n-765838684,\"reverse\",-817534470,null,function(){for(var d=64,e=[];++d-e.length-32;){switch(d){case 91:d=44;continue;case 123:d=65;break;case 65:d-=18;continue;case 58:d=96;continue;case 46:d=95}e.push(String.fromCharCode(d))}return e},\n626846541,-1367950889,-2112796328,-768513684,null,-1082956352,-1494415394,function(d){for(var e=d.length;e;)d.push(d.splice(--e,1)[0])},\n258269991,-400755099,-1925694323,b,-1598976963,916834761,-924149546,-210204449,1409185050,373906233,function(d,e,f,h,l,m){return e(h,l,m)},\n816354752,function(d){d.reverse()},\n-171453855,function(){for(var d=64,e=[];++d-e.length-32;)switch(d){case 46:d=95;default:e.push(String.fromCharCode(d));case 94:case 95:case 96:break;case 123:d-=76;case 92:case 93:continue;case 58:d=44;case 91:}return e},\n202221142,1012107866,-808618296,-881960835,function(){for(var d=64,e=[];++d-e.length-32;){switch(d){case 58:d-=14;case 91:case 92:case 93:continue;case 123:d=47;case 94:case 95:case 96:continue;case 46:d=95}e.push(String.fromCharCode(d))}return e},\n-755943633,function(d,e){0!=e.length&&(d=(d%e.length+e.length)%e.length,e.splice(0,1,e.splice(d,1,e[0])[0]))},\nb,-842097180,function(d,e,f){var h=f.length;e.forEach(function(l,m,n){this.push(n[m]=f[(f.indexOf(l)-f.indexOf(this[m])+m+h--)%f.length])},d.split(\"\"))},\n-1764057255,function(d,e){d=(d%e.length+e.length)%e.length;e.splice(-d).reverse().forEach(function(f){e.unshift(f)})},\n1494470409];c[18]=c;c[44]=c;c[50]=c;try{try{5!=c[71]&&(0>=c[36]||((((0,c[75])(c[77],c[76])!==(0,c[75])(c[16],c[32]))<<(((0,c[75])(c[Math.pow(8,5)%24- -21],c[50]),c[78])(c[42],c[-209318+new Date(\"1970-01-01T04:01:07.000+04:00\")/1E3*Math.pow(5,5)],(0,c[25])()),(0,c[75])(c[72],c[32]),c[28])(c[18],c[11590+Math.pow(1,4)+-11543])%(0,c[40])(c[49],c[44]),(0,c[80])(c[54],c[32]),c[19])(c[18],c[9]),0))&&(0,c[69])(((((0,c[26])(c[62],c[5],(0,c[21])()),(0,c[43])(c[5],c[17]),c[43])(c[24],c[8]),c[26])(c[73],c[24],\n(0,c[21])()),c[43])(c[81],c[29]),c[33957+Math.pow(5,2)+-33941],((0,c[Math.pow(8,4)%256+43])(c[5],c[38]),c[269%(new Date(\"1970-01-01T11:33:54.000+11:30\")/1E3)+Math.pow(2,4)-25])(c[62],c[5],(0,c[56])())*(0,c[43])(c[24],c[6]),c[14],c[49]),3>=c[19]?((((0,c[41])((0,c[50])(c[75],c[82]),c[32],c[20],c[72]),c[52])(c[72],c[22]),(0,c[37])(c[31],c[7]),(0,c[1])(c[21],c[56]),(0,c[-117*Math.pow(1,1)+118])(c[65],c[12]),c[42])(c[33]),((0,c[40])(c[new Date(\"1969-12-31T21:30:36.000-02:30\")/1E3]),c[13])(c[32],c[36]),\nc[53])(c[52],c[75]):(0,c[73])((((0,c[75])((0,c[40])(c[43]),c[15],c[51],c[17],(0,c[20])()),c[18])(c[34],c[17]),c[13])(c[72],c[0])>>>(0,c[81])(c[17],c[37]),(0,c[40])(c[61]),c[29],(0,c[15])(c[1*Math.pow(7,4)-2339],c[36],(0,c[68])())%(0,c[15])(c[62],c[36],(0,c[68])()),c[18],(0,c[15])(c[51],c[61],(0,c[48])()),c[47],c[17])}catch(d){(0,c[81])(c[36],c[59]),(0,c[15])(c[62],c[61],(0,c[68])())}finally{0!=c[82]&&(c[54]<Math.pow(3,2)-20+21||((0,c[53])(c[80],c[17-382%Math.pow(1,1)]),NaN))&&(0,c[new Date(\"1969-12-31T20:16:21.000-03:45\")/\n1E3])(c[17],c[78])}try{-1!==c[70]&&(6==c[72]||((0,c[29])((0,c[75])((0,c[75])((0,c[18])(c[50],c[61]),c[74],c[17],c[45]),c[27],c[61]),c[15],(0,c[74])(c[49],c[54]),c[13],c[70],(0,c[54])()),0))&&(0,c[6])((((0,c[49])(c[2],c[51],(0,c[19])()),c[61])(c[12]),c[25])(c[77],c[22]),c[26],(0,c[4])(c[9],c[12]),c[49],c[31+Math.pow(5,1)-34],c[51],(0,c[19])()),c[64]>new Date(\"1970-01-01T02:15:07.000+02:15\")/1E3?(0,c[52])(c[28+Math.pow(4,4)%244],c[77]):(0,c[52])(c[11],c[34]),-5>c[69]&&(5==c[Math.pow(8,2)+42-95]&&((0,c[49])(c[2],\nc[51],(0,c[54])()),1)||(0,c[4])(c[36],c[12])),5!=c[62]&&(10>c[55]?((0,c[52])(c[48],c[70]),c[47])(c[39],c[34]):((0,c[76])(c[29],c[78],(0,c[26])()),c[60-505%Math.pow(8,1)])(c[14],c[41]))}catch(d){(((0,c[59])(c[14],c[24]),c[31])(c[69],c[39]),c[76])(c[29],c[78],(0,c[81])()),(0,c[76])(c[40],c[39],(0,c[81])())}finally{-7<=c[35]&&(3===c[56]&&((0,c[53])((0,c[74])(c[34],c[14])+(0,c[18])(c[14]),c[76],c[29],c[39],(0,c[3])()),\"[/,\")||(0,c[53])((0,c[53])((0,c[18])(c[78]),c[31],c[Math.pow(4,5)%207+-142],c[61]),\nc[79],c[45],c[61])),9>c[19]&&(-9===c[1]||((0,c[7])((0,c[52])(c[21],c[35]),c[2],(0,c[37])(c[Math.pow(6,1)%234- -1],c[67]),c[22],c[11]),\"\"))&&((0,c[65])(c[20],c[63]),(0,c[82])(c[35],c[20],(0,c[52])())>(0,c[82])(c[46],c[45],(0,c[32])())),(-8===c[18]||((0,c[80])(c[76],c[67]),0))&&(0,c[38])(c[57],c[26]),-8!=c[-48+Math.pow(3,4)%252]&&(-1!=c[50]&&((0,c[32])((0,c[38])(c[76],c[71]),c[10],c[39],c[40]),1)||((0,c[80])(c[4]),c[38])(c[40],c[81])),-10!=c[0]&&(-7>=c[17]?(0,c[-17085+Math.pow(1,4)- -17116])((0,c[10])(c[51],\nc[40]),c[58],c[23],c[40]):((0,c[55])(c[8],c[76],(0,c[25])()),c[38])(c[57],c[44]))}}catch(d){return\"enhanced_except_n5gB4Of-_w8_\"+a}return b.join(\"\")"]} |
@dirkf
Log:
|
OK, looks like |
The problem player code is trying to left-shift The correct (!) JS result for this is 0, and also for The problem player isn't being served to me regularly, but I'll keep checking to verify that the consequent fix solves the issue. |
Success: $ python3.9 -m youtube_dl -v -F '3gbIsY-eOq0'
[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', '3gbIsY-eOq0']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: d0b1f995c
[debug] Python 3.9.16 (CPython 32bit) - Linux-4.4.0-210-generic-i686-with-glibc2.23 (OpenSSL 1.1.1t 7 Feb 2023, glibc 2.23)
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] 3gbIsY-eOq0: Downloading webpage
> /home/df/Documents/src/youtube-dl/youtube_dl/extractor/youtube.py(1662)_n_descramble()
-> sig_id = ('nsig_value', n_param)
(Pdb) p player_url
'https://www.youtube.com/s/player/cfa9e7cb/player_ias.vflset/en_US/base.js'
(Pdb) c
[debug] [youtube] Decrypted nsig Ym5AQeQbA2N56kd-ov => PBcV05aInCFS6w
...
[debug] [youtube] Decrypted nsig gQQRhkv9X8BrpB06v6 => PUMGuyQl8dp_Ag
...
[info] Available formats for 3gbIsY-eOq0:
format code extension resolution note
249 webm audio only tiny 51k , webm_dash container, opus (48000Hz), 186.89KiB
250 webm audio only tiny 60k , webm_dash container, opus (48000Hz), 220.88KiB
251 webm audio only tiny 113k , webm_dash container, opus (48000Hz), 412.58KiB
140 m4a audio only tiny 129k , m4a_dash container, mp4a.40.2 (44100Hz), 474.13KiB
160 mp4 144x256 144p 63k , mp4_dash container, avc1.4d400c, 25fps, video only, 231.75KiB
278 webm 144x256 144p 80k , webm_dash container, vp9, 25fps, video only, 294.58KiB
242 webm 240x426 240p 128k , webm_dash container, vp9, 25fps, video only, 468.80KiB
133 mp4 240x426 240p 141k , mp4_dash container, avc1.4d4015, 25fps, video only, 515.75KiB
243 webm 360x640 360p 224k , webm_dash container, vp9, 25fps, video only, 819.92KiB
134 mp4 360x640 360p 264k , mp4_dash container, avc1.4d401e, 25fps, video only, 965.64KiB
244 webm 480x854 480p 364k , webm_dash container, vp9, 25fps, video only, 1.30MiB
135 mp4 480x854 480p 588k , mp4_dash container, avc1.4d401e, 25fps, video only, 2.10MiB
247 webm 720x1280 720p 643k , webm_dash container, vp9, 25fps, video only, 2.29MiB
136 mp4 720x1280 720p 1117k , mp4_dash container, avc1.64001f, 25fps, video only, 3.98MiB
248 webm 1080x1920 1080p 1133k , webm_dash container, vp9, 25fps, video only, 4.04MiB
137 mp4 1080x1920 1080p 2039k , mp4_dash container, avc1.640028, 25fps, video only, 7.26MiB
18 mp4 270x480 240p 421k , avc1.42001E, 25fps, mp4a.40.2 (48000Hz), 1.50MiB
22 mp4 720x1280 720p 1246k , avc1.64001F, 25fps, mp4a.40.2 (44100Hz) (best)
$ The relevant change: return update_and_rename_wrapper
+_NaN = float('nan')
+
+
def _js_bit_op(op):
def zeroise(x):
- return 0 if x in (None, JS_Undefined) else x
+ return 0 if x in (None, JS_Undefined, _NaN) else x
@wraps_op(op)
def wrapped(a, b): |
thank you, @dirkf ! |
but I'm still getting the error... :(
UPD: not getting the error anymore... Not sure what it was. |
Ok, I'm getting this on some videos. Since all the logs are the same, I'm gonna add here some video IDs this thing occurs on:
|
Fixed in a85a875. Use The URLs above all showed |
is it |
$ python3.9 ./devscripts/cli_to_api.py --no-cache-dir
{'cachedir': False}
$ |
if you don't mind me asking, what is the relationship between cache dir and displaying player ID? |
It's just that, currently, the player ID is only shown in the debug output when first downloading the player JS, and not when fetching from cache. |
For future proofing, should |
Currently, Actually, the fix I used has a subtle potential bug. The comment at l.132 points out that "NaN cannot be checked by membership". NaN values obtained by |
@dirkf it happened again (
As before, downloading is done with a script, options being:
|
See #32292. |
@dirkf it happened again(
|
Already fixed in master: #32292 (comment) |
Checklist
Verbose log
Description
When attempting to download from Youtube, I get
Unable to decode n-parameter: download likely to be throttled (Unhandled exception in decode
error. Downloading happens at low speed ~50-80 Kib/sThe text was updated successfully, but these errors were encountered: