From 6b37f0be55356ceb90fbd65d3f6a40207637dc61 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 27 Jun 2013 01:51:10 +0200 Subject: [PATCH] Add a clean-room implementation for youtube signatures --- test/test_youtube_sig.py | 35 +++++++++++++++++++++++++++++++++ youtube_dl/extractor/youtube.py | 26 ++++++++++++++++-------- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index ddd27a9dc..5f23fabab 100755 --- a/test/test_youtube_sig.py +++ b/test/test_youtube_sig.py @@ -18,5 +18,40 @@ class TestYoutubeSig(unittest.TestCase): right = '931EA22157E1871643FA9519676DED253A342B0C.4E95A5DBD2F1F511DCC1209DF56CB77693CE0EAE' self.assertEqual(sig(wrong), right) + def test_88(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<" + right = "J:|}][{=+-_)(*&;%$#@>MNBVCXZASDFGH^KLPOIUYTREWQ0987654321mnbvcxzasdfghrklpoiuytej" + self.assertEqual(sig(wrong), right) + + def test_87(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>.<" + right = "!?;:|}][{=+-_)(*&^$#@/MNBVCXZASqFGHJKLPOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytr" + self.assertEqual(sig(wrong), right) + + def test_86(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<" + right = "ertyuioplkjhgfdqazxcvbnm1234567890QWERT}UIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|/;?Y" + self.assertEqual(sig(wrong), right) + + def test_85(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?/>.<" + right = "{>/?;}[.=+-_)(*&^%$#@!MqBVCXZASDFwHJKLPOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytr" + self.assertEqual(sig(wrong), right) + + def test_84(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?>.<" + right = "<.>?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWe098765432rmnbvcxzasdfghjklpoiuyt1" + self.assertEqual(sig(wrong), right) + + def test_83(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!#$%^&*()_+={[};?/>.<" + right = "D.>/?;}[{=+_)(*&^%$#!MNBVCXeAS