diff options
author | Ismael Mejia <iemejia@gmail.com> | 2013-02-22 03:53:54 +0100 |
---|---|---|
committer | Filippo Valsorda <filippo.valsorda@gmail.com> | 2013-03-20 08:41:54 +0100 |
commit | 9e62bc443996c1950de0841997c76d110cb77c6e (patch) | |
tree | 22ec9c71c62b4c60b8b98eac4a26735a97e7727d /test | |
parent | 553d097442ad5ee62d227de2e2703a2377dcf40f (diff) |
Added new option '--sub-format' to choose the format of the subtitles to downloade (defaut=srt)
Diffstat (limited to 'test')
-rw-r--r-- | test/parameters.json | 1 | ||||
-rw-r--r-- | test/test_youtube_subtitles.py | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/test/parameters.json b/test/parameters.json index 0d4bd644c..750b1c96e 100644 --- a/test/parameters.json +++ b/test/parameters.json @@ -29,6 +29,7 @@ "simulate": false, "skip_download": false, "subtitleslang": null, + "subtitlesformat": "srt", "test": true, "updatetime": true, "usenetrc": false, 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() |