diff options
author | Remita Amine <remitamine@gmail.com> | 2017-11-29 17:50:38 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2017-11-29 17:50:38 +0100 |
commit | 5ea765fb720523efb2702358e188e5157d08775b (patch) | |
tree | 31d338eafab3f7a9c63428d367f599e102f913e3 /youtube_dl/extractor/mtv.py | |
parent | fb61b57d0f4c6422b2722f56f5740ea1b19adfcf (diff) |
[mtv] correct scc extention in extracted subtitles(closes #13730)
Diffstat (limited to 'youtube_dl/extractor/mtv.py')
-rw-r--r-- | youtube_dl/extractor/mtv.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index 1154a3536..7a3b57abd 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -115,10 +115,17 @@ class MTVServicesInfoExtractor(InfoExtractor): if transcript.get('kind') != 'captions': continue lang = transcript.get('srclang') - subtitles[lang] = [{ - 'url': compat_str(typographic.get('src')), - 'ext': typographic.get('format') - } for typographic in transcript.findall('./typographic')] + for typographic in transcript.findall('./typographic'): + sub_src = typographic.get('src') + if not sub_src: + continue + ext = typographic.get('format') + if ext == 'cea-608': + ext = 'scc' + subtitles.setdefault(lang, []).append({ + 'url': compat_str(sub_src), + 'ext': ext + }) return subtitles def _get_video_info(self, itemdoc, use_hls=True): |