- DL = FakeYDL()
- DL.params['writesubtitles'] = True
- IE = YoutubeIE(DL)
- info_dict = IE.extract('QRS8MkLhQmM')
- 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['subtitleslangs'] = ['it']
- IE = YoutubeIE(DL)
- info_dict = IE.extract('QRS8MkLhQmM')
- 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']['en']
- self.assertEqual(md5(sub), '4cd9278a35ba2305f47354ee13472260')
+ self.DL.params['writesubtitles'] = True
+ subtitles = self.getSubtitles()
+ self.assertEqual(md5(subtitles['en']), '4cd9278a35ba2305f47354ee13472260')
+ def test_youtube_subtitles_lang(self):
+ self.DL.params['writesubtitles'] = True
+ self.DL.params['subtitleslangs'] = ['it']
+ subtitles = self.getSubtitles()
+ self.assertEqual(md5(subtitles['it']), '164a51f16f260476a05b50fe4c2f161d')