- DL = FakeDownloader()
- IE = YoutubePlaylistIE(DL)
- IE.extract('https://www.youtube.com/user/TheLinuxFoundation')
- self.assertTrue(len(DL.result) >= 320)
+ dl = FakeYDL()
+ ie = YoutubeUserIE(dl)
+ result = ie.extract('https://www.youtube.com/user/TheLinuxFoundation')
+ self.assertTrue(len(result['entries']) >= 320)
+
+ def test_youtube_safe_search(self):
+ dl = FakeYDL()
+ ie = YoutubePlaylistIE(dl)
+ result = ie.extract('PLtPgu7CB4gbY9oDN3drwC3cMbJggS7dKl')
+ self.assertEqual(len(result['entries']), 2)
+
+ def test_youtube_show(self):
+ dl = FakeYDL()
+ ie = YoutubeShowIE(dl)
+ result = ie.extract('http://www.youtube.com/show/airdisasters')
+ self.assertTrue(len(result) >= 3)
+
+ def test_youtube_mix(self):
+ dl = FakeYDL()
+ ie = YoutubePlaylistIE(dl)
+ result = ie.extract('http://www.youtube.com/watch?v=lLJf9qJHR3E&list=RDrjFaenf1T-Y')
+ entries = result['entries']
+ self.assertTrue(len(entries) >= 20)
+ original_video = entries[0]
+ self.assertEqual(original_video['id'], 'rjFaenf1T-Y')
+
+ def test_youtube_toplist(self):
+ dl = FakeYDL()
+ ie = YoutubeTopListIE(dl)
+ result = ie.extract('yttoplist:music:Top Tracks')
+ entries = result['entries']
+ self.assertTrue(len(entries) >= 5)