]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - test/test_playlists.py
[khanacademy] Add support (Fixes #2066)
[youtube-dl.git] / test / test_playlists.py
index 576f7fb4ea749f51be96f491ce645b3a95959901..3229823b692b354db39fd370b90bf9cce63a100b 100644 (file)
@@ -1,12 +1,10 @@
 #!/usr/bin/env python
 # encoding: utf-8
 
-
 # Allow direct execution
 import os
 import sys
 import unittest
-from youtube_dl.extractor.ivi import IviCompilationIE
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import FakeYDL
@@ -28,7 +26,10 @@ from youtube_dl.extractor import (
     BambuserChannelIE,
     BandcampAlbumIE,
     SmotriCommunityIE,
-    SmotriUserIE
+    SmotriUserIE,
+    IviCompilationIE,
+    ImdbListIE,
+    KhanAcademyIE,
 )
 
 
@@ -187,6 +188,25 @@ class TestPlaylists(unittest.TestCase):
         self.assertEqual(result['id'], u'dezhurnyi_angel/season2')
         self.assertEqual(result['title'], u'Дежурный ангел (2010 - 2012) 2 сезон')
         self.assertTrue(len(result['entries']) >= 20)
+        
+    def test_imdb_list(self):
+        dl = FakeYDL()
+        ie = ImdbListIE(dl)
+        result = ie.extract('http://www.imdb.com/list/sMjedvGDd8U')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], u'sMjedvGDd8U')
+        self.assertEqual(result['title'], u'Animated and Family Films')
+        self.assertTrue(len(result['entries']) >= 48)
+
+    def test_khanacademy_topic(self):
+        dl = FakeYDL()
+        ie = KhanAcademyIE(dl)
+        result = ie.extract('https://www.khanacademy.org/math/applied-math/cryptography')
+        self.assertIsPlaylist(result)
+        self.assertEqual(result['id'], u'cryptography')
+        self.assertEqual(result['title'], u'Journey into cryptography')
+        self.assertEqual(result['description'], u'How have humans protected their secret messages through history? What has changed today?')
+        self.assertTrue(len(result['entries']) >= 3)
 
 
 if __name__ == '__main__':