From 239e3e0cca362a3fecb702fe0ee11701ee3991b6 Mon Sep 17 00:00:00 2001 From: patrickslin Date: Tue, 23 Jul 2013 17:32:25 -0700 Subject: YoutubeIE: new algo for length 87 (fixes #1105) Squashed commit from the pull requests #1107, #1109 and #1110. --- test/test_youtube_sig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index 51b300532..6da7c5502 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" self.assertEqual(sig(wrong), right) def test_86(self): -- cgit v1.2.3 From aedd6bb97de7ed82da746892e2a0b32ee9c6d6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Thu, 25 Jul 2013 22:06:53 +0200 Subject: YoutubeIE: new algo for length 81 (fixes #1127) --- test/test_youtube_sig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index 6da7c5502..4e50d6f90 100644 --- a/test/test_youtube_sig.py +++ b/test/test_youtube_sig.py @@ -60,7 +60,7 @@ class TestYoutubeSig(unittest.TestCase): def test_81(self): wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>." - right = "urty8ioplkjhgfdsazxcvbqm1234567e90QWERTYUIOPLKHGFDSnZXCVBNM!@#$%^&*(-+={[};?/>." + right = "C>/?;}[{=+-(*&^%$#@!MNBVYXZASDFGHKLPOIU.TREWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp" self.assertEqual(sig(wrong), right) if __name__ == '__main__': -- cgit v1.2.3 From 5c468ca8a852a00a55b4559d31f5e9861e76d748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Thu, 25 Jul 2013 22:50:24 +0200 Subject: YoutubeIE: add algo for length 79 (fixes #1126) --- test/test_youtube_sig.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index 4e50d6f90..4d45a0e08 100644 --- a/test/test_youtube_sig.py +++ b/test/test_youtube_sig.py @@ -63,5 +63,10 @@ class TestYoutubeSig(unittest.TestCase): right = "C>/?;}[{=+-(*&^%$#@!MNBVYXZASDFGHKLPOIU.TREWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp" self.assertEqual(sig(wrong), right) + def test_79(self): + wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/" + right = "Z?;}[{=+-(*&^%$#@!MNBVCXRASDFGHKLPOIUYT/EWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp" + self.assertEqual(sig(wrong), right) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3 From a3c736def2058547e2c9e9fa4013f7c547c72c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Mon, 29 Jul 2013 12:07:38 +0200 Subject: [dailymotion] Add an extractor for Dailymotion playlists --- test/test_playlists.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/test_playlists.py (limited to 'test') diff --git a/test/test_playlists.py b/test/test_playlists.py new file mode 100644 index 000000000..f8cc75afb --- /dev/null +++ b/test/test_playlists.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +import sys +import unittest +import json + +# Allow direct execution +import os +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from youtube_dl.extractor import DailymotionPlaylistIE +from youtube_dl.utils import * + +from helper import FakeYDL + +class TestPlaylists(unittest.TestCase): + def assertIsPlaylist(self, info): + """Make sure the info has '_type' set to 'playlist'""" + self.assertEqual(info['_type'], 'playlist') + + def test_dailymotion_playlist(self): + dl = FakeYDL() + ie = DailymotionPlaylistIE(dl) + result = ie.extract('http://www.dailymotion.com/playlist/xv4bw_nqtv_sport/1#video=xl8v3q') + self.assertIsPlaylist(result) + self.assertEqual(result['title'], u'SPORT') + self.assertTrue(len(result['entries']) > 20) + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.3 From caeefc29ebce8dbfb0c25a79887719055276c9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Mon, 29 Jul 2013 13:12:09 +0200 Subject: [vimeo] add an extractor for channels --- test/test_playlists.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_playlists.py b/test/test_playlists.py index f8cc75afb..65de3a55c 100644 --- a/test/test_playlists.py +++ b/test/test_playlists.py @@ -8,7 +8,7 @@ import json import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.extractor import DailymotionPlaylistIE +from youtube_dl.extractor import DailymotionPlaylistIE, VimeoChannelIE from youtube_dl.utils import * from helper import FakeYDL @@ -26,5 +26,13 @@ class TestPlaylists(unittest.TestCase): self.assertEqual(result['title'], u'SPORT') self.assertTrue(len(result['entries']) > 20) + def test_vimeo_channel(self): + dl = FakeYDL() + ie = VimeoChannelIE(dl) + result = ie.extract('http://vimeo.com/channels/tributes') + self.assertIsPlaylist(result) + self.assertEqual(result['title'], u'Vimeo Tributes') + self.assertTrue(len(result['entries']) > 24) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3 From 75952c6e3dcbab1b7c239b02272ca1bb5336f72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Wed, 31 Jul 2013 10:45:13 +0200 Subject: YoutubeIE: new algo for length 86 (fixes #1156) Now is using the same length as the flash player used for age protected videos, but the algorithm is different, so now for age protected videos it first tries to use the old algo. --- test/test_youtube_sig.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index 4d45a0e08..d06f3c8aa 100644 --- a/test/test_youtube_sig.py +++ b/test/test_youtube_sig.py @@ -10,7 +10,9 @@ 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 +ie = YoutubeIE(FakeYDL()) +sig = ie._decrypt_signature +sig_age_gate = ie._decrypt_signature_age_gate class TestYoutubeSig(unittest.TestCase): def test_92(self): @@ -35,7 +37,7 @@ class TestYoutubeSig(unittest.TestCase): def test_86(self): wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<" - right = "ertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!/#$%^&*()_-+={[|};?@" + right = ">.1}|[{=+-_)(*&^%$#@!MNBVCXZASDFGHJK Date: Fri, 2 Aug 2013 12:38:17 +0200 Subject: [youtube]: new algo for length 83 (fixes #1164) --- test/test_youtube_sig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py index d06f3c8aa..d645c08fb 100644 --- a/test/test_youtube_sig.py +++ b/test/test_youtube_sig.py @@ -52,7 +52,7 @@ class TestYoutubeSig(unittest.TestCase): def test_83(self): wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!#$%^&*()_+={[};?/>.<" - right = "urty8ioplkjhgfdsazxcvbqm1234567S90QWERTYUIOPLKJHGFDnAZXCVBNM!#$%^&*()_+={[};?/>.<" + right = "qwertyuioplkjhg>dsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!#$%^&*()_+={[};?/f" self.assertEqual(sig(wrong), right) def test_82(self): -- cgit v1.2.3 From e2f48f96436f24af3001b4fc2600cc3d3c1bf0ac Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Wed, 7 Aug 2013 20:11:38 +0200 Subject: Remove youtube sig tests The signature algo changes too often for the static test to make sense. --- test/test_youtube_sig.py | 79 ------------------------------------------------ 1 file changed, 79 deletions(-) delete mode 100644 test/test_youtube_sig.py (limited to 'test') diff --git a/test/test_youtube_sig.py b/test/test_youtube_sig.py deleted file mode 100644 index d645c08fb..000000000 --- a/test/test_youtube_sig.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/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 - -ie = YoutubeIE(FakeYDL()) -sig = ie._decrypt_signature -sig_age_gate = ie._decrypt_signature_age_gate - -class TestYoutubeSig(unittest.TestCase): - def test_92(self): - wrong = "F9F9B6E6FD47029957AB911A964CC20D95A181A5D37A2DBEFD67D403DB0E8BE4F4910053E4E8A79.0B70B.0B80B8" - right = "69B6E6FD47029957AB911A9F4CC20D95A181A5D3.A2DBEFD67D403DB0E8BE4F4910053E4E8A7980B7" - self.assertEqual(sig(wrong), right) - - def test_90(self): - wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[]}|:;?/>.<'`" - right = "mrtyuioplkjhgfdsazxcvbne1234567890QWER[YUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={`]}|" - 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 = "tyuioplkjhgfdsazxcv" - self.assertEqual(sig(wrong), right) - - def test_86(self): - wrong = "qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<" - right = ">.1}|[{=+-_)(*&^%$#@!MNBVCXZASDFGHJK Date: Mon, 19 Aug 2013 10:27:42 +0200 Subject: [youtube] Support watch_popup URLs (Fixes #1275) --- test/test_all_urls.py | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/test_all_urls.py b/test/test_all_urls.py index c73d0e467..c54faa380 100644 --- a/test/test_all_urls.py +++ b/test/test_all_urls.py @@ -50,6 +50,7 @@ class TestAllURLsMatching(unittest.TestCase): self.assertEqual(YoutubeIE()._extract_id('http://www.youtube.com/watch?&v=BaW_jenozKc'), 'BaW_jenozKc') self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch?&v=BaW_jenozKc'), 'BaW_jenozKc') self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc'), 'BaW_jenozKc') + self.assertEqual(YoutubeIE()._extract_id('https://www.youtube.com/watch_popup?v=BaW_jenozKc'), 'BaW_jenozKc') def test_no_duplicates(self): ies = gen_extractors() -- cgit v1.2.3