aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/postprocessor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-01-07 00:57:24 +0700
committerSergey M․ <dstftw@gmail.com>2019-01-07 00:57:55 +0700
commit04fb6928da5e34fb3c7eaf50592a141400e00487 (patch)
treef039a83e3d7aa1a5650e4f0e2cd8391b008c1341 /youtube_dl/postprocessor
parentb7acc83550598b9facf1b31d3d9a1c2823b29cbe (diff)
[postprocessor/ffmpeg] Embed subtitles with non-standard language codes (refs #18765)
Diffstat (limited to 'youtube_dl/postprocessor')
-rw-r--r--youtube_dl/postprocessor/ffmpeg.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py
index 757b496a1..efcd39d57 100644
--- a/youtube_dl/postprocessor/ffmpeg.py
+++ b/youtube_dl/postprocessor/ffmpeg.py
@@ -384,9 +384,8 @@ class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
opts += ['-c:s', 'mov_text']
for (i, lang) in enumerate(sub_langs):
opts.extend(['-map', '%d:0' % (i + 1)])
- lang_code = ISO639Utils.short2long(lang)
- if lang_code is not None:
- opts.extend(['-metadata:s:s:%d' % i, 'language=%s' % lang_code])
+ lang_code = ISO639Utils.short2long(lang) or lang
+ opts.extend(['-metadata:s:s:%d' % i, 'language=%s' % lang_code])
temp_filename = prepend_extension(filename, 'temp')
self._downloader.to_screen('[ffmpeg] Embedding subtitles in \'%s\'' % filename)