Skip to content
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

Unable to decrypt signature, key length 81 not supported #1026

Closed
matlads opened this issue Jul 11, 2013 · 11 comments
Closed

Unable to decrypt signature, key length 81 not supported #1026

matlads opened this issue Jul 11, 2013 · 11 comments
Assignees

Comments

@matlads
Copy link

@matlads matlads commented Jul 11, 2013

matlads@martin-pc:Playlist$ youtube-dl 'http://www.youtube.com/watch?v=oR68oAtWY-c&list=RD04ZGoWtY_h4xo'
ERROR: Unable to decrypt signature, key length 81 not supported; retrying might work; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output.

matlads@martin-pc:Playlist$ youtube-dl -U
youtube-dl is up-to-date (2013.07.10)

matlads@martin-pc:Playlist$ youtube-dl --verbose
[debug] System config: []
[debug] User config: ['--extract-audio', '--audio-format', 'mp3', '--keep-video']
[debug] Command-line args: ['--verbose']
[debug] youtube-dl version 2013.07.10
[debug] Python version 2.7.5+ - Linux-3.9-1-amd64-x86_64-with-debian-jessie-sid
[debug] Proxy map: {}
Usage: youtube-dl [options] url [url...]

@ghost
Copy link

@ghost ghost commented Jul 11, 2013

Experiencing same/similar...

$ ./youtube-dl --verbose http://www.youtube.com/watch?v=gR2ny40RQ7A
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.youtube.com/watch?v=gR2ny40RQ7A']
[debug] youtube-dl version 2013.07.10
[debug] Python version 2.7.1 - Darwin-11.4.2-x86_64-i386-64bit
[debug] Proxy map: {}
[youtube] Setting language
[youtube] gR2ny40RQ7A: Downloading video webpage
[youtube] gR2ny40RQ7A: Downloading video info webpage
[youtube] gR2ny40RQ7A: Extracting video information
[youtube] gR2ny40RQ7A: Encrypted signatures detected.
[youtube] encrypted signature length 83 (42.40), itag 45, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 22, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 44, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 35, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 43, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 34, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 18, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 5, html5 player vflcaqGO8
[youtube] encrypted signature length 81 (40.40), itag 36, html5 player vflcaqGO8
ERROR: Unable to decrypt signature, key length 81 not supported; retrying might work; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "./youtube-dl/youtube_dl/YoutubeDL.py", line 312, in extract_info
ie_result = ie.extract(url)
File "./youtube-dl/youtube_dl/extractor/common.py", line 95, in extract
return self._real_extract(url)
File "./youtube-dl/youtube_dl/extractor/youtube.py", line 590, in _real_extract
signature = self._decrypt_signature(url_data['s'][0])
File "./youtube-dl/youtube_dl/extractor/youtube.py", line 198, in _decrypt_signature
raise ExtractorError(u'Unable to decrypt signature, key length %d not supported; retrying might work' % (len(s)))
ExtractorError: Unable to decrypt signature, key length 81 not supported;

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 11, 2013

Thanks to both of you, we'd like to support signature of lenght 81, but until we find a video where we can reproduce it, we cannot fix it.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 11, 2013

I forgot to mention that, as the error message says, trying a second time usually works, it's not the best solutions, but we can't do anything.

@ghost
Copy link

@ghost ghost commented Jul 11, 2013

Looks like mine video went from 83 to 81 ...? Either way, it's always a Vevo issue. Go to youtube.com and search Vevo. I'm assuming it's because we're bypassing Vevo's ad revenue... if you check other youtube apps on iOS -- ALL Vevo videos fail now. :/

[youtube] encrypted signature length 83 (42.40), itag 45, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 22, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 44, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 35, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 43, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 34, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 18, html5 player vflcaqGO8
[youtube] encrypted signature length 83 (42.40), itag 5, html5 player vflcaqGO8
[youtube] encrypted signature length 81 (40.40), itag 36, html5 player vflcaqGO8

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 11, 2013

@jasonrwalters We know it's for vevo videos, the problem is that we have to find a way to get signatures of these lengths. I've been trying reloading the video webpage and I've only found two signatures of length 81, but (42,38) ! ( I accidentally reload the page, I couldn't try to discover the algo). To detect the signatures length I'm using this bookmarklet: https://gist.github.com/jaimeMF/039134145e38dd9dcec6, it's a modified version of the @FiloSottile's script. If someone wants to try to get some key pairs, go ahead, we'd appreciate.

@astral2k5
Copy link

@astral2k5 astral2k5 commented Jul 11, 2013

@jaimeMF, do we need only to paste the output of javascript console ? for me only outputs a list of signatures, i think still encrypted, something like this:
42 40 "0C4C7D4C74A131FB633FCA298FE103116E223AE66C" "." "13A754CCC745A5CB6C1BA735F2EADB5E921B460E"
42 40 "AB0B7612A09B6F221821B9844940CC13A45CD2D733" "." "5B791C7228042C673DA66203B95452FDC4737FA9"
42 40 "5C1CD9B14C2F41C00F3128335B7E8C9D88BECE6884" "." "B5ED7C3E4715273192AFB144B5BE83B28B990ABC"

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 11, 2013

If you find some sigs of length 81 ((42,38) ,(40,40) or something else) copy the output from the javascript console and then the video urls that shown in the web console in Firefox or your favourite browser, but without reloading the page!, like this: http://r1---sn-h5q7dn7e.c.youtube.com/videoplayback?algorithm=throttle-factor&burst=40&clen=62349825&cp=U0hWSFVUUV9OUkNONl9NTlVBOlcxN3duZkhLMW5n&cpn=b7bSPBCi6gxbDdkG&dur=3925.774&expire=1373593098&factor=1.25&fexp=919121%2C902903%2C919318%2C900339%2C916624%2C902544%2C924606%2C929117%2C929121%2C929906%2C929907%2C929127%2C925722%2C925718%2C925714%2C929917%2C929919%2C912512%2C912515%2C912521%2C906838%2C931917%2C931913%2C904830%2C919373%2C904122%2C936303%2C912711%2C921057&gcr=es&gir=yes&id=811da7cb8d1143b0&ip={your_ip_is_here}&ipbits=8&itag=140&keepalive=yes&key=yt1&lmt=1369013036559544&ms=au&mt=1373572591&mv=m&range=0-245759&ratebypass=yes&signature=786B6881AA5F9A89BBA422E8F2F480D578C7F40C.4A8274B13C29D055C13E3145CDDB539705A607DB&source=youtube&sparams=algorithm%2Cburst%2Cclen%2Ccp%2Cdur%2Cfactor%2Cgcr%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Clmt%2Csource%2Cupn%2Cexpire&sver=3&upn=Lrip_6rEQHw

We just need a few of this, just make sure that the javascript output and the video url are from the same page load, i.e.: don't reload the page (that's the critical point).

@astral2k5
Copy link

@astral2k5 astral2k5 commented Jul 11, 2013

It's little hard to catch the actual link that has the 81 length, i have 40,40 but i found it somehow:

40 40 45359917C910DDDD961FA5D1EC35F115F18181C5 . BA763C1F40FF38747FB824CC2749E5362B0358F1

&signature=159917C910DDDD961FA5D14C35F115F38181C5.BA763C1F40FFE8747FB824CC2749E5362B0358F1&

@ghost ghost assigned jaimeMF Jul 11, 2013
@jaimeMF jaimeMF closed this in 606d7e6 Jul 11, 2013
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 11, 2013

I think I've managed to solve it, all the signatures I've found (3 plus the one provided by @astral2k5) can be decrypted. I haven't been able to test it properly, so if you try to download the format with this signature it may not work, but at least it won't stop the extraction.
For those interested in, it seems that it doesn't matter if the signatures is (42, 38) or (40,40) both use the same algorithm.
Thanks for your contribution!

@phihag
Copy link
Contributor

@phihag phihag commented Jul 11, 2013

For anyone who's not using git: These fixes have been included in our latest version 2013.07.12. Type

sudo youtube-dl -U

to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.