aboutsummaryrefslogtreecommitdiff
path: root/test/test_youtube_subtitles.py
diff options
context:
space:
mode:
authorIsmael Mejia <iemejia@gmail.com>2013-02-22 03:53:54 +0100
committerFilippo Valsorda <filippo.valsorda@gmail.com>2013-03-20 08:41:54 +0100
commit9e62bc443996c1950de0841997c76d110cb77c6e (patch)
tree22ec9c71c62b4c60b8b98eac4a26735a97e7727d /test/test_youtube_subtitles.py
parent553d097442ad5ee62d227de2e2703a2377dcf40f (diff)
Added new option '--sub-format' to choose the format of the subtitles to downloade (defaut=srt)
Diffstat (limited to 'test/test_youtube_subtitles.py')
-rw-r--r--test/test_youtube_subtitles.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_youtube_subtitles.py b/test/test_youtube_subtitles.py
index 3b5a53fca..94adc4555 100644
--- a/test/test_youtube_subtitles.py
+++ b/test/test_youtube_subtitles.py
@@ -42,7 +42,7 @@ class TestYoutubeSubtitles(unittest.TestCase):
DL = FakeDownloader()
DL.params['allsubtitles'] = False
DL.params['writesubtitles'] = False
-
+ DL.params['subtitlesformat'] = 'srt'
def test_youtube_no_subtitles(self):
DL = FakeDownloader()
DL.params['writesubtitles'] = False
@@ -80,6 +80,14 @@ class TestYoutubeSubtitles(unittest.TestCase):
info_dict = IE.extract('QRS8MkLhQmM')
subtitles = info_dict[0]['subtitles']
self.assertEqual(len(subtitles), 12)
+ def test_youtube_subtitles_format(self):
+ DL = FakeDownloader()
+ 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')
if __name__ == '__main__':
unittest.main()