aboutsummaryrefslogtreecommitdiff
path: root/test/test_youtube_subtitles.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-23 02:40:25 -0700
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-23 02:40:25 -0700
commit9e9c164052e982fa56ad11949f6c5d454c26aa44 (patch)
treed0f8142db9d2dc400f83a0f0d4c7f56df6f5fc4d /test/test_youtube_subtitles.py
parent066090dd3f15886be40310f5a0702fe485c1512e (diff)
parent6804038d065e0eeffd9fca2dc55b3262a9191c10 (diff)
Merge pull request #937 from jaimeMF/subtitles_rework
Subtitles rework
Diffstat (limited to 'test/test_youtube_subtitles.py')
-rw-r--r--test/test_youtube_subtitles.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/test_youtube_subtitles.py b/test/test_youtube_subtitles.py
index 86e09c9b1..fe0eac680 100644
--- a/test/test_youtube_subtitles.py
+++ b/test/test_youtube_subtitles.py
@@ -35,47 +35,47 @@ class TestYoutubeSubtitles(unittest.TestCase):
DL.params['writesubtitles'] = True
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
- sub = info_dict[0]['subtitles'][0]
- self.assertEqual(md5(sub[2]), '4cd9278a35ba2305f47354ee13472260')
+ sub = info_dict[0]['subtitles']['en']
+ self.assertEqual(md5(sub), '4cd9278a35ba2305f47354ee13472260')
def test_youtube_subtitles_it(self):
DL = FakeYDL()
DL.params['writesubtitles'] = True
DL.params['subtitleslang'] = 'it'
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
- sub = info_dict[0]['subtitles'][0]
- self.assertEqual(md5(sub[2]), '164a51f16f260476a05b50fe4c2f161d')
+ sub = info_dict[0]['subtitles']['it']
+ self.assertEqual(md5(sub), '164a51f16f260476a05b50fe4c2f161d')
def test_youtube_onlysubtitles(self):
DL = FakeYDL()
DL.params['writesubtitles'] = True
DL.params['onlysubtitles'] = True
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
- sub = info_dict[0]['subtitles'][0]
- self.assertEqual(md5(sub[2]), '4cd9278a35ba2305f47354ee13472260')
+ sub = info_dict[0]['subtitles']['en']
+ self.assertEqual(md5(sub), '4cd9278a35ba2305f47354ee13472260')
def test_youtube_allsubtitles(self):
DL = FakeYDL()
DL.params['allsubtitles'] = True
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
subtitles = info_dict[0]['subtitles']
- self.assertEqual(len(subtitles), 13)
+ self.assertEqual(len(subtitles.keys()), 13)
def test_youtube_subtitles_sbv_format(self):
DL = FakeYDL()
DL.params['writesubtitles'] = True
DL.params['subtitlesformat'] = 'sbv'
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
- sub = info_dict[0]['subtitles'][0]
- self.assertEqual(md5(sub[2]), '13aeaa0c245a8bed9a451cb643e3ad8b')
+ sub = info_dict[0]['subtitles']['en']
+ self.assertEqual(md5(sub), '13aeaa0c245a8bed9a451cb643e3ad8b')
def test_youtube_subtitles_vtt_format(self):
DL = FakeYDL()
DL.params['writesubtitles'] = True
DL.params['subtitlesformat'] = 'vtt'
IE = YoutubeIE(DL)
info_dict = IE.extract('QRS8MkLhQmM')
- sub = info_dict[0]['subtitles'][0]
- self.assertEqual(md5(sub[2]), '356cdc577fde0c6783b9b822e7206ff7')
+ sub = info_dict[0]['subtitles']['en']
+ self.assertEqual(md5(sub), '356cdc577fde0c6783b9b822e7206ff7')
def test_youtube_list_subtitles(self):
DL = FakeYDL()
DL.params['listsubtitles'] = True
@@ -88,8 +88,8 @@ class TestYoutubeSubtitles(unittest.TestCase):
DL.params['subtitleslang'] = 'it'
IE = YoutubeIE(DL)
info_dict = IE.extract('8YoUxe5ncPo')
- sub = info_dict[0]['subtitles'][0]
- self.assertTrue(sub[2] is not None)
+ sub = info_dict[0]['subtitles']['it']
+ self.assertTrue(sub is not None)
if __name__ == '__main__':
unittest.main()