From 3d3538e422a711aab238f4d1ab667d72cc9bbdbf Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Tue, 7 Jan 2014 09:35:34 +0100 Subject: [khanacademy] Add support (Fixes #2066) --- test/test_playlists.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_playlists.py b/test/test_playlists.py index 9d522b357..3229823b6 100644 --- a/test/test_playlists.py +++ b/test/test_playlists.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # encoding: utf-8 - # Allow direct execution import os import sys @@ -30,6 +29,7 @@ from youtube_dl.extractor import ( SmotriUserIE, IviCompilationIE, ImdbListIE, + KhanAcademyIE, ) @@ -198,6 +198,16 @@ class TestPlaylists(unittest.TestCase): 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__': unittest.main() -- cgit v1.2.3