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 79 not supported #1126

Closed
iTaybb opened this issue Jul 25, 2013 · 11 comments
Closed

Unable to decrypt signature, key length 79 not supported #1126

iTaybb opened this issue Jul 25, 2013 · 11 comments

Comments

@iTaybb
Copy link
Contributor

@iTaybb iTaybb commented Jul 25, 2013

C:>youtube-dl.exe --verbose http://www.youtube.com/watch?v=9bZkp7q19f0
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.youtube.com/watch?v=9bZkp7q
19f0']
[debug] youtube-dl version 2013.07.25.1
[debug] Python version 2.7.3 - Windows-XP-5.1.2600-SP3
[debug] Proxy map: {}
[youtube] Setting language
[youtube] 9bZkp7q19f0: Downloading video webpage
[youtube] 9bZkp7q19f0: Downloading video info webpage
[youtube] 9bZkp7q19f0: Extracting video information
[youtube] 9bZkp7q19f0: Encrypted signatures detected.
[youtube] encrypted signature length 81 (40.40), itag 46, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 37, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 45, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 22, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 44, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 35, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 43, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 34, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 18, html5 player vflLC8JvQ

[youtube] encrypted signature length 81 (40.40), itag 5, html5 player vflLC8JvQ
[youtube] encrypted signature length 81 (40.40), itag 36, html5 player vflLC8JvQ

[youtube] encrypted signature length 79 (38.40), itag 17, html5 player vflLC8JvQ

ERROR: Unable to decrypt signature, key length 79 not supported; retrying might
work; please report this issue on https://yt-dl.org/bug . Be sure to call youtub
e-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 312, in extract_info
File "youtube_dl\extractor\common.pyo", line 96, in extract
File "youtube_dl\extractor\youtube.pyo", line 612, in _real_extract
File "youtube_dl\extractor\youtube.pyo", line 302, in _decrypt_signature
ExtractorError: Unable to decrypt signature, key length 79 not supported; retryi
ng might work; please report this issue on https://yt-dl.org/bug . Be sure to ca
ll youtube-dl with the --verbose flag and include its complete output.

@Baqan
Copy link

@Baqan Baqan commented Jul 25, 2013

Same problem here:

C:\yt-dl>youtube-dl.exe --verbose http://www.youtube.com/watch?v=j5-yKhDd64s
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.youtube.com/watch?v=j5-yKhD
d64s']
[debug] youtube-dl version 2013.07.25.1
[debug] Python version 2.7.3 - Windows-7-6.1.7600
[debug] Proxy map: {}
[youtube] Setting language
[youtube] j5-yKhDd64s: Downloading video webpage
[youtube] j5-yKhDd64s: Downloading video info webpage
[youtube] j5-yKhDd64s: Extracting video information
[youtube] j5-yKhDd64s: Encrypted signatures detected.
[youtube] encrypted signature length 79 (38.40), itag 46, html5 player vflLC8JvQ

ERROR: Unable to decrypt signature, key length 79 not supported; retrying might
work; please report this issue on https://yt-dl.org/bug . Be sure to call youtub
e-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 312, in extract_info
File "youtube_dl\extractor\common.pyo", line 96, in extract
File "youtube_dl\extractor\youtube.pyo", line 612, in _real_extract
File "youtube_dl\extractor\youtube.pyo", line 302, in _decrypt_signature
ExtractorError: Unable to decrypt signature, key length 79 not supported; retryi
ng might work; please report this issue on https://yt-dl.org/bug . Be sure to ca
ll youtube-dl with the --verbose flag and include its complete output.

@patrickslin
Copy link
Contributor

@patrickslin patrickslin commented Jul 25, 2013

I don't know where the sig len 79 is coming from, but all the sigs I see are sig len 81.

pairs:
FA7709F754E334350FE2EFEA649203FE32B28522.AAEE9290E44BB36AF1101F72BA6FB651C234B6FC
AF6B432C156BF6AB27F1011FA63BB44E0929EEAC.22582F23EFB02946AEFE2EF053433E357F9077A4

A65FEBFBAEC98BDF3EFE45ACED4CDB82D52569DB.990B0E690FD3E0E028B8CE5C59C253D392AF2EC6
0CE2FA293D352C95C5EC8B829E0E3DF096E0B096.BD965A5D282DC4DECA54EFE3FDB89CBABFBEF56E

python:
s[56] + s[79:56:-1] + s[41] + s[55:41:-1] + s[80] + s[40] + s[39:34:-1] + s[0] + s[33:29:-1] + s[34] + s[28:9:-1] + s[29] + s[8:0:-1] + s[9]

javascript:
s[56] + s.slice(57, 80).reverse().join('') + s[41] + s.slice(42, 56).reverse().join('') + s[80] + s[40] + s.slice(35, 40).reverse().join('') + s[0] + s.slice(30, 34).reverse().join('') + s[34] + s.slice(10, 29).reverse().join('') + s[29] + s.slice(1, 9).reverse().join('') + s[9]

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 25, 2013

@patrickslin length 81 is fixed now : aedd6bb, about the length 79, you have to keep trying on the browser until you get it (and with one of the formats in adaptive_fmts), there are some lenghts that are only given by Youtube sometimes, I have managed to add some of them, but it's really boring to get them, I'll have a look.

@awojnowski
Copy link
Contributor

@awojnowski awojnowski commented Jul 25, 2013

@Baqan I believe you're looking at the decrypted signature length which is going to be 79. The original signature length (81) is what is begin referred to.

@actarus33
Copy link

@actarus33 actarus33 commented Jul 25, 2013

hi,

PatickSlin, how do you find the way to decrypt the signature? do you have an automatic tool to find it? a tool to compare the crypted signatures and decrypted signature and find how it is scrambled?

@jaimeMF jaimeMF closed this in 5c468ca Jul 25, 2013
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 25, 2013

This is fixed now
@actarus33 I use a javascript bookmarklet to get the encrypted sigs: https://gist.github.com/jaimeMF/039134145e38dd9dcec6, but then I (manually) compare the pair and it's just a matter of time to figure out which is the algo, usually I use two or more pairs to make sure I'm not wrong

@actarus33
Copy link

@actarus33 actarus33 commented Jul 25, 2013

great! nice job

@patrickslin
Copy link
Contributor

@patrickslin patrickslin commented Jul 25, 2013

@actarus33 I wish I had an automatic tool to output the decrypted signatures from the encrypted input... You can capture the content URL network requests using the browser Developer Tools. The requests will include the decrypted 'signature' query parameter. The YouTube player usually makes requests for urls with itag 134 and 140. One is audio and the other is video. These are muxed by the player. Also, the encrypted signatures for adaptive formats can be found in the ytplayer.config.args.adaptive_fmts object. Find the relevant signatures by itags as @jaimeMF mentioned above. I think that it would be pretty straight forward to write something that will figure out the algo based on 2-3 pairs. The fact that the decrypted signature library of characters is bound by type and count to the encrypted input makes this a much easier problem to solve, though still not dead simple. Or better yet, figure out where in YouTube's HTML5 javascript code lies the decryption code. It's got to be there.

@Baqan
Copy link

@Baqan Baqan commented Jul 25, 2013

Thanks! Good work!! =)

@fredfung
Copy link

@fredfung fredfung commented Jul 27, 2013

Hi, are there some documents about detail for get youtube video URL? (I am a C coder, I can only understand youtube-dl a few. And, I want to convert youtube-dl to a C language project, in this project URL-obtained is the point. )

Additional question:
Seems like function real_extract process that, Can I use "HTTP" for get video webpage and video info instead "HTTPS"? In this way, data of "url_encoded_fmt_stream_map" is still useful?
Thank you very much! youtube-dl is such cool. We could say "Niu B" in chinese. ^
^

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
7 participants
You can’t perform that action at this time.