diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-09-20 08:23:50 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-09-20 08:25:10 +0200 |
commit | 7a878d47fa57cbfc8b8df398d6dbe753fdabaf0b (patch) | |
tree | 1a4318c9ceb219701f14feddc5cb5eb9220f0920 | |
parent | c5e743f66f5637fe02fe0b5167fab99a06b903e6 (diff) | |
parent | bc4b9008981096184739666941e73c8d09623502 (diff) |
Merge pull request #1464 from patrickslin/patch-7
Unable to decrypt signature length 93 (fixes #1461)
-rw-r--r-- | devscripts/youtube_genalgo.py | 4 | ||||
-rw-r--r-- | youtube_dl/extractor/youtube.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/devscripts/youtube_genalgo.py b/devscripts/youtube_genalgo.py index 66019ee55..d4546758d 100644 --- a/devscripts/youtube_genalgo.py +++ b/devscripts/youtube_genalgo.py @@ -1,10 +1,14 @@ #!/usr/bin/env python +# encoding: utf-8 # Generate youtube signature algorithm from test cases import sys tests = [ + # 93 - vfl79wBKW 2013/07/20 + (u"qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'`~\"€", + u".>/?;:|}][{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWQ098765'321mnbvcxzasdfghjklpoiu"), # 92 - vflQw-fB4 2013/07/17 ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'`~\"", "mrtyuioplkjhgfdsazxcvbnq1234567890QWERTY}IOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]\"|:;"), diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 23a8097c5..e5f536e6f 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -416,7 +416,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): def _decrypt_signature(self, s): """Turn the encrypted s field into a working signature""" - if len(s) == 92: + if len(s) == 93: + return s[86:29:-1] + s[88] + s[28:5:-1] + elif len(s) == 92: return s[25] + s[3:25] + s[0] + s[26:42] + s[79] + s[43:79] + s[91] + s[80:83] elif len(s) == 90: return s[25] + s[3:25] + s[2] + s[26:40] + s[77] + s[41:77] + s[89] + s[78:81] |