-
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
[YouTube] Error 403 when downloading, with "Unable to decode n-parameter", not solved by new cookies #32815
Comments
I'm seeing the same error, same version (installed directly from repo), Verbose logs:
|
Wait NOW it is working again, i just tested YOUR youtube link and it works now with mine too... |
Do you have the verbose log from when it worked? Do you know if it was using the same player id A couple of videos I am trying to pull are not pulling at the moment with this error and using the same player Id as your verbose log for the failure, |
No I dont have it but I can MAKE ONE! redownloads video
|
Yeah, it looks like it changed to a different player ID when it worked. Player Id when error: 590f65a6 |
We can acquire the problem player JS and find out what feature breaks the n-sig descrambling. If this is a roll-out to |
Indeed, I am getting As usual there is the definition of the pointless obfuscated descrambling functionIma=function(a){var b=a.split(""),c=[481196748,function(d,e){d.splice(d.length,0,e)},
-1184122307,-1844585791,-1517999176,-1838315746,-391786256,function(d,e,f,h,l){return e(f,h,l)},
311082973,777402095,-513835569,-1517999176,b,777402095,b,function(d,e){e.length!=0&&(d=(d%e.length+e.length)%e.length,e.splice(0,1,e.splice(d,1,e[0])[0]))},
"/([\\/,[",function(d,e){d.push(e)},
1836568272,",54];c[51]=c;",-132471649,function(d,e,f,h,l,m,n,p,q){return f(h,l,m,n,p,q)},
2099923865,-1844585791,function(d,e,f,h,l,m,n,p){return e(f,h,l,m,n,p)},
-1177328935,1637869400,1340863434,1591384456,function(d){throw d;},
-893696909,-1785346148,186785386,512500232,976315399,55621845,function(d,e,f,h,l,m,n){return d(l,m,n)},
1968846220,-120562974,1415280244,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},
-1617495598,null,function(d){d.reverse()},
function(d,e){e=(e%d.length+d.length)%d.length;d.splice(e,1)},
-439060673,2108931577,function(d,e,f){var h=d.length;e.forEach(function(l,m,n){this.push(n[m]=d[(d.indexOf(l)-d.indexOf(this[m])+m+h--)%d.length])},f.split(""))},
-206894781,"o6LTxqq",-530102236,-785373294,function(d,e,f,h,l,m){return e(h,l,m)},
null,null,1096979497,"\u2210]}(/",1867530696,196808569,-1759560780,-120562974,-939717184,1123017595,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},
976315399,886367998,1481614131,-1632737085,1506052226,-1259426209,function(d){for(var e=d.length;e;)d.push(d.splice(--e,1)[0])},
function(d,e){e=(e%d.length+d.length)%d.length;d.splice(-e).reverse().forEach(function(f){d.unshift(f)})},
-963596628,1599531971,1653761992,193670587,-565480227,b,-1733454587,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},
-147499041,-414478713,444508829,302113098,2140193951,714051216,1812860928,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},
function(d,e){if(d.length!=0){e=(e%d.length+d.length)%d.length;var f=d[0];d[0]=d[e];d[e]=f}},
function(d,e){for(d=(d%e.length+e.length)%e.length;d--;)e.unshift(e.pop())},
-949341690,-2000214115,2049985941];c[42]=c;c[53]=c;c[54]=c;try{try{c[84]<6?((0,c[44])(c[new Date("1969-12-31T14:45:53.000-09:15")/1E3],c[62]),c[71])(c[Math.pow(2,2)+7600-7592],c[new Date("1970-01-01T09:01:20.000+09:00")/1E3]):((0,c[88])(c[42],c[0]),(0,c[88])(c[0],c[28])),(0,c[7])(((0,c[29])(c[77]),c[47])((0,c[63])(),c[14],c[49]),c[11+Math.pow(6,new Date("1970-01-01T05:15:02.000+05:15")/1E3)-3],c[76],c[26])}catch(d){c[54]>new Date("1970-01-01T07:00:00.000+07:00")/1E3&&(c[51]>-9||((0,c[52])((0,c[43])(c[12]),
c[15],(0,c[89])(c[86],c[53]),c[22],c[66]),(0,c[71])((0,c[10])(),c[8],c[73]),0))&&(((0,c[31])((0,c[71])((0,c[10])(),c[36],c[73]),c[1],c[77]),c[19])(c[66],c[57]),c[71])((0,c[18])(),c[8],c[73]),c[72]===7?(0,c[48])(((0,c[68])(c[8],c[79]),c[68])(c[38],c[62]),c[76],(0,c[68])(c[8],c[4]),c[20],(0,c[71])((0,c[18])(),c[38],c[73]),c[44],c[Math.pow(1,1)-7200+7235]):(0,c[76])((0,c[68])(c[38],c[3])+(0,c[1])(c[8]),c[20],(0,c[31])((0,c[19])(c[7],c[42]),c[20],c[63],c[8]),c[29],c[66]),c[72]>=9?(0,c[70])(c[10],c[83]):
(0,c[188%Math.pow(4,4)-118])(c[10],c[25]),c[14]>9?((0,c[70])(c[40],c[30+Math.pow(6,1)- -31]),c[73])((0,c[2])(),c[10],c[75]):(0,c[33])((0,c[4])(c[68],c[89]),c[40],c[29],c[70]),c[79]==-1?(0,c[52])((0,c[40])(c[57],c[33]),c[22-Math.pow(7,1)- -74],c[57],c[72]):((0,c[60])(c[53],c[Math.pow(6,2)-69+38]),c[88])(c[59])}finally{c[55]===-8+Math.pow(4,3)%17?((((0,c[52])((0,c[41])(c[45],c[28]),c[89],c[57],c[79]),c[-503+105*Math.pow(5,1)])(c[new Date("1970-01-01T05:16:27.000+05:15")/1E3]),c[40])(c[29],c[26]),c[92])((0,c[31])(),
c[29],c[1]):(0,c[52])(((0,c[4])((0,c[41])(c[new Date("1969-12-31T21:16:17.000-02:45")/1E3],c[59]),c[Math.pow(3,4)+-31725- -31704],(0,c[88])(c[5]),c[56],c[35]),c[70])(c[64]),c[40],c[28],c[67])}try{c[3]==-5&&((0,c[89])(c[29],c[35]),"NaN")||(0,c[88])(c[28]),c[42]<5&&(c[73]<=0||(((0,c[51])(c[82],c[63]),c[52])(c[87],c[2]),""))&&(0,c[40])((0,c[32])(c[new Date("1970-01-01T05:01:05.000+05:00")/1E3],c[64]),c[3],c[63],c[41]),(0,c[18])(c[87]),(0,c[40])((0,c[53])(),c[63],c[91]),(0,c[40])((0,c[53])(),c[35],c[91])}catch(d){c[57]!==
8&&(c[60-196%Math.pow(1,4)]>=59-Math.pow(1,2)+-50||((0,c[26])((0,c[0])((0,c[69])(c[33],c[58])|(0,c[0])((0,c[69])(c[87],c[62]),c[64],c[5],c[88]),c[38],c[69]),(0,c[85])(c[22],c[5]),c[57],(0,c[19])(c[72],c[32]),c[0],(0,c[19])(c[2],c[33]),c[46],c[6]),0))&&((((0,c[new Date("1970-01-01T06:30:13.000+06:30")/1E3])((0,c[26])(),c[6],c[65]),c[24])(c[17],c[38]),((0,c[13])((0,c[74])(),c[37],c[65]),c[25])(c[38],c[47]),c[62])((0,c[70])(c[6],c[64]),c[43],(0,c[13])((0,c[74])(),c[37],c[65]),c[6],c[16]),c[13])((0,c[74])(),
c[37],c[65]),c[57]!=4&&(c[51]==-7&&((0,c[24])(c[10],c[72]),1)||(0,c[24])(c[83],c[37]))}finally{c[49]>=4&&(c[22]!==-9?((0,c[78])(c[5],(0,c[25])(c[6],c[66]),(0,c[5])(c[28],c[8]),(0,c[44])(c[37]),c[53],c[38]),c[67])((0,c[-62-Math.pow(7,1)*-19])(c[6]),c[70],c[6],c[Math.pow(5,5)+-65280- -62178]):((0,c[67])(((((0,c[35-Math.pow(8,2)+42])((0,c[74])(),c[8],c[65]),c[70])(c[37],c[64]),c[70])(c[38],c[84]),c[25])(c[Math.pow(4,1)-16+73],c[48]),c[13],(0,c[45])(),c[6],c[65]),c[70])(c[37],c[63]))}try{c[68]!=9&&(c[29]==
-9||(((0,c[67])((0,c[19])(c[61],c[75]),c[24],c[68],c[38]),c[48])(c[38]),null))&&(((0,c[73])(c[Math.pow(8,1)*-149+1237]),c[47])(c[20-308%Math.pow(4,2)],c[68]),c[47])(c[80],c[38])}catch(d){(0,c[46])(c[16])}}catch(d){return"enhanced_except_r5sB0OT-_w8_"+a}return b.join("")}; and a pointless redirection var HRa=[Ima]; and the code that calls the descrambler ( a.D&&(b=a.get("n"))&&(b=HRa[0](b),a.set("n",b),HRa.length||Ima("")) Presumably the children who committed this nonsense bike or EV and search out "environmentally-friendly" products and yet they acquiesce in the waste of electricity by their billions of users who aren't savvy enough to avoid YT's JS. |
I have the same trouble |
I'm getting this error too:
Is there a work around? |
I'm getting same error (same problematic player ID
|
I was mucking around and got a different player ID |
A brute-force workaround: diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 3bf483c1c..87fb14124 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1472,6 +1472,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
break
else:
raise ExtractorError('Cannot identify player %r' % player_url)
+ player_id = id_m.group('id')
+ assert player_id != '590f65a6'
return id_m.group('id')
def _get_player_code(self, video_id, player_url, player_id=None):
@@ -1680,6 +1682,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
self._downloader.to_screen('[debug] [%s] %s' % (self.IE_NAME, 'Decrypted nsig {0} => {1}'.format(n_param, self._player_cache[sig_id])))
return self._player_cache[sig_id]
except Exception as e:
+ raise
self._downloader.report_warning(
'[%s] %s (%s %s)' % (
self.IE_NAME, And run youtube-dl until it succeeds: while ! youtube-dl -f251 --verbose https://youtu.be/nVmaUlPHEuc; do sleep 1; done At least this worked for me, with 50+ retries. 🤣 |
I'm getting same error, how to fix it elegantly |
Is there a way to get a specific player in ytdl? That would probably be helpful. Also I got the bad player RNG again... |
maybe the trouble is related to https://techcrunch.com/2024/06/16/youtube-is-testing-another-way-to-combat-ad-blockers/ |
Ironically, a page that doesn't display without a pointless interstitial page. It's not clear how what TC describes would be having this effect. There are two issues:
At yt-dlp, people have observed getting 403 with Web formats when using browser cookies, but not generally without cookies, unless YT bans your data centre, VPN, or bulk downloading IP address. |
Need me to do something? I got the Issue again, with the same Player, so I might be able to reproduce it again if need be, unless youtube randomly decides to give me a working player again. |
The descrambling problem is a parsing error that will be patched soon. As to "getting 403 with Web formats when using browser cookies", I can't see any reason why that should succeed when it fails with yt-dlp. Review the linked yt-dlp issue (and its related issues) for guidance. Maybe we'll be able pull the experimental OAuth2 implementation from https://github.com/coletdjnz/yt-dlp-youtube-oauth2. |
Wait you said web formats? does the mp4 format at ID 18 count as that? Also I did wipe the cookies File in my case, it was a File I needed a few months/years ago to get youtubedl to work at all.
|
yt-dl only extracts Web formats, except for age-gate bypassing. So we can't (without changing the extractor code) use the work-around of fetching the formats as if we were an iThing that yt-dlp users have (since the yt-dlp extractor can get any or all of the various format groups that the YT webpage and APIs offer). |
I have the same problem, using new, nightly build of youtube-dl 2024.06.12 (latest).
Anything can be done to help? |
@astralblue: Which version it patches? Also, due to inability to figure out exactly which version it applies, I tried nightly build without the change and it succeeded after 30+ tries. |
Curiously, yt-dlp does not have this issue. I thought the jsinterp in yt-dlp and youtube-dl were pretty much on par?
|
Yes, but there is a bug in the evaluation of But more significantly, the links from the web player are getting 403 regardless of cookies, unlike in yt-dlp/yt-dlp#10046. |
Ah okay makes sense, so it seems like incorrect/missing nsig is no longer punished by throttling, but by 403. |
Or perhaps not once the descrambling is fixed: $ python -m youtube_dl -v -f 18 --test "https://www.youtube.com/watch?v=qCvqZPf3smI"
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-f', u'18', u'--test', u'https://www.youtube.com/watch?v=qCvqZPf3smI']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 0eafa09a3
[debug] Python 2.7.18 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial - OpenSSL 1.1.1w 11 Sep 2023 - glibc 2.15
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] qCvqZPf3smI: Downloading webpage
[youtube] qCvqZPf3smI: Downloading player 0cbdb0bb
[debug] [youtube] Decrypted nsig pS7nuoyHbD53b1Ogg5 => hJuTwgtHbJ7KNw
[debug] [youtube] Decrypted nsig LJanpw1rKj_ErFkGnX => AJlxnCkg4YIgVA
[debug] Invoking downloader on u'https://rr5---sn-cu-aigss.googlevideo.com/videoplayback?sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&ei=4NdxZu6pOuG6vdIP78qomAM&ip=46.208.6.91&clen=270741677&spc=UWF9fzCMgE5BLW_zLwwxJRScw7NGuV3twVCPUn3eAY514F1rrgeBL-1d4voC&id=o-AP3SKVgbJGwcSKnEmAyKjq2NMA-ojDhdElUs9OJTsuPO&txp=7209224&svpuc=1&gir=yes&xpc=EgVo2aDSNQ%3D%3D&requiressl=yes&ratebypass=yes&source=youtube&mv=m&sig=AJfQdSswRAIgAt-1nRr0gUNENkkHYv5UtUugo2XyVF31falJ5D8GK0ACICx7-MqdNYepmrySWKDwZ2ddQOVkGRiZB4PqxRyHBTxZ&dur=7915.659&ns=eogiHzTeG8t8rGibJ9Ed9BcQ&initcwndbps=1637500&vprv=1&lsig=AHlkHjAwRQIgOtzZ9Ftrvs5OyPilYNUGWeiIXsiYjsXnkb_OtUT_TV4CIQDWR0rn8VzpBnpP_Cwed2YWHzmTR-NLY4Uf9s1utibUyg%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lmt=1718385543727535&c=WEB&sefc=1&bui=AbKP-1Pn_KA2jKDL1neyFLmuv91AKPbt-Pu40GLa0IoUNlGAcJpQ8drZn_2YWMVGi5vTV7Pa3sbdT6Jh&mime=video%2Fmp4&fvip=1&rqh=1&itag=18&mm=31%2C29&mn=sn-cu-aigss%2Csn-cu-c9i6&mh=94&n=hJuTwgtHbJ7KNw&mt=1718736314&expire=1718758464&pl=25&ms=au%2Crdu&mvi=5'
[download] Destination: Crafting 3 Guile Scheme Programs in 2 Hours - System Crafters Live!-qCvqZPf3smI.mp4
[download] 100% of 10.00KiB in 00:00
$ Above got player $ python test/test_youtube_signature.py TestSignature.test_nsig_js_590f65a6
.
----------------------------------------------------------------------
Ran 1 test in 1.966s
OK
$ |
* improve BODMAS (fixes ytdl-org#32815) * support more weird expressions with multiple unary ops
* improve BODMAS (fixes #32815) * support more weird expressions with multiple unary ops
* improve BODMAS (fixes ytdl-org/youtube-dl#32815) * support more weird expressions with multiple unary ops
* https://github.com/ytdl-org/youtube-dl: [PalcoMP3] Conform to new linter rule * no space after @ in decorator [jsinterp] Various tweaks * treat Infinity like NaN * cache operator list [jsinterp] Fix and improve expression parsing * improve BODMAS (fixes ytdl-org#32815) * support more weird expressions with multiple unary ops [jsinterp] Add Debugger from yt-dlp * yt-dlp/yt-dlp@8f53dc4 * thx pukkandan [utils] Save `orig_msg` in `ExtractorError`
Ref: ytdl-org/youtube-dl#32815 Authored by: bashonly
I've been getting similar results for a while. I don't see player 5604538d mentioned in any issues. I've tried with an empty cookie file and with cookies exported from a working firefox session (log using latest daily build attached). Edit: also pasted log inline as it only appeared as a downloadable attachment.
|
Please use the nightly build here. The ytdl-patched repo is not updating from here, actually hasn't been doing so for some time. With today's update (not yet committed):
|
Thanks very much. I hadn't appreciated that '-U' wasn't upgrading to latest. |
As I guess, I have the same problem with v2024.08.02, with one video in particular. It happened with others but one or two restarts were sufficient to overcome it. Not this time though. |
Your problem is #32896: do check the issues list. |
Checklist
Verbose log
and from the youtube-dl-nightly the same type of error
Description
using both youtube-dl and youtube-dl-nightly as compiled from their respective github master repos!
Error 403 when downloading from youtube, resetting cookies and grabbing new cookies did not solve it this time. It worked like 3 hours or so ago, though i DID have issues two days ago where I could fix it myself with the cookie reset. Them Googel Devs trying to mess with downloaders and ad blockers again, I'm guessing.
Extra Info, VPN in Canada does not help, so I am certain this is not only a Germany Issue.
The text was updated successfully, but these errors were encountered: