diff options
author | PrinceOfPuppers <joshuamcpherson5@gmail.com> | 2021-02-15 14:38:41 -0500 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2021-02-17 04:58:54 +0700 |
commit | 70baa7bfae8890c8274af7f3c7e2a704d300a326 (patch) | |
tree | 275ec8730ccd13544131cba7ecdc88aff8bae2ab /test | |
parent | 8980f53b4227bc213048fce52c634830dd25e4bb (diff) |
[test_youtube_lists] Actualize youtube flat playlist test (closes #28045)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_youtube_lists.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.py index c4f0abbea..cf2fdf14f 100644 --- a/test/test_youtube_lists.py +++ b/test/test_youtube_lists.py @@ -12,6 +12,7 @@ from test.helper import FakeYDL from youtube_dl.extractor import ( YoutubePlaylistIE, + YoutubeTabIE, YoutubeIE, ) @@ -57,14 +58,22 @@ class TestYoutubeLists(unittest.TestCase): entries = result['entries'] self.assertEqual(len(entries), 100) - def test_youtube_flat_playlist_titles(self): + def test_youtube_flat_playlist_extraction(self): dl = FakeYDL() dl.params['extract_flat'] = True - ie = YoutubePlaylistIE(dl) - result = ie.extract('https://www.youtube.com/playlist?list=PL-KKIb8rvtMSrAO9YFbeM6UQrAqoFTUWv') + ie = YoutubeTabIE(dl) + result = ie.extract('https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc') self.assertIsPlaylist(result) - for entry in result['entries']: - self.assertTrue(entry.get('title')) + entries = list(result['entries']) + self.assertTrue(len(entries) == 1) + video = entries[0] + self.assertEqual(video['_type'], 'url_transparent') + self.assertEqual(video['ie_key'], 'Youtube') + self.assertEqual(video['id'], 'BaW_jenozKc') + self.assertEqual(video['url'], 'BaW_jenozKc') + self.assertEqual(video['title'], 'youtube-dl test video "\'/\\ä↭𝕐') + self.assertEqual(video['duration'], 10) + self.assertEqual(video['uploader'], 'Philipp Hagemeister') if __name__ == '__main__': |