youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 5746f9da99bdb2439da152027212d49147133575
parent 112da0a0ced71d56db8a1f02a43197b78ca0a851
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Thu, 27 Jun 2013 00:09:25 +0200

Add test for youtube signature algorithm

Diffstat:
Atest/test_youtube_sig.py | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import unittest +import sys + +# Allow direct execution +import os +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from youtube_dl.extractor.youtube import YoutubeIE +from helper import FakeYDL + +sig = YoutubeIE(FakeYDL())._decrypt_signature + +class TestYoutubeSig(unittest.TestCase): + def test_43_43(self): + wrong = '5AEEAE0EC39677BC65FD9021CCD115F1F2DBD5A59E4.C0B243A3E2DED6769199AF3461781E75122AE135135' + right = '931EA22157E1871643FA9519676DED253A342B0C.4E95A5DBD2F1F511DCC1209DF56CB77693CE0EAE' + self.assertEqual(sig(wrong), right) + +if __name__ == '__main__': + unittest.main()