A feature-rich command-line audio/video downloader
YoutubeIE: new algo for length 87 (fixes #1105)
patrickslin239e3e0cca36
diff --git a/devscripts/youtube_genalgo.py b/devscripts/youtube_genalgo.pyindex 2b3879f0a5..4aeca3c505 100644--- a/devscripts/youtube_genalgo.py+++ b/devscripts/youtube_genalgo.py@@ -16,7 +16,7 @@ tests = ["J:|}][{=+-_)(*&;%$#@>MNBVCXZASDFGH^KLPOIUYTREWQ0987654321mnbvcxzasdfghrklpoiuytej"),# 87("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>.<",- "!?;:|}][{=+-_)(*&^$#@/MNBVCXZASqFGHJKLPOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytr"),+ "tyuioplkjhgfdsazxcv<nm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>"),# 86 - vfl_ymO4Z 2013/06/27("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<","ertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!/#$%^&*()_-+={[|};?@"),diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.pyindex 51b300532d..6da7c55028 100644--- a/test/test_youtube_sig.py+++ b/test/test_youtube_sig.py@@ -30,7 +30,7 @@ class TestYoutubeSig(unittest.TestCase):def test_87(self):wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>.<"- right = "!?;:|}][{=+-_)(*&^$#@/MNBVCXZASqFGHJKLPOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytr"+ right = "tyuioplkjhgfdsazxcv<nm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>"self.assertEqual(sig(wrong), right)def test_86(self):diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.pyindex 39894ae882..9d3f61be62 100644--- a/youtube_dl/extractor/youtube.py+++ b/youtube_dl/extractor/youtube.py@@ -186,7 +186,7 @@ class YoutubeIE(InfoExtractor):elif len(s) == 88:return s[48] + s[81:67:-1] + s[82] + s[66:62:-1] + s[85] + s[61:48:-1] + s[67] + s[47:12:-1] + s[3] + s[11:3:-1] + s[2] + s[12]elif len(s) == 87:- return s[62] + s[82:62:-1] + s[83] + s[61:52:-1] + s[0] + s[51:2:-1]+ return s[4:23] + s[86] + s[24:85]elif len(s) == 86:return s[2:63] + s[82] + s[64:82] + s[63]elif len(s) == 85: