projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'subtitles-rework'
[youtube-dl]
/
youtube_dl
/
postprocessor
/
ffmpeg.py
diff --git
a/youtube_dl/postprocessor/ffmpeg.py
b/youtube_dl/postprocessor/ffmpeg.py
index 3f2e6cf1d38af3c6896cce5c92560f0a0a53d554..398fe050ede3d7da8678fd1453bc1ae475419362 100644
(file)
--- a/
youtube_dl/postprocessor/ffmpeg.py
+++ b/
youtube_dl/postprocessor/ffmpeg.py
@@
-496,10
+496,6
@@
class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
'zu': 'zul',
}
'zu': 'zul',
}
- def __init__(self, downloader=None, subtitlesformat='srt'):
- super(FFmpegEmbedSubtitlePP, self).__init__(downloader)
- self._subformat = subtitlesformat
-
@classmethod
def _conver_lang_code(cls, code):
"""Convert language code from ISO 639-1 to ISO 639-2/T"""
@classmethod
def _conver_lang_code(cls, code):
"""Convert language code from ISO 639-1 to ISO 639-2/T"""
@@
-509,13
+505,14
@@
class FFmpegEmbedSubtitlePP(FFmpegPostProcessor):
if information['ext'] != 'mp4':
self._downloader.to_screen('[ffmpeg] Subtitles can only be embedded in mp4 files')
return True, information
if information['ext'] != 'mp4':
self._downloader.to_screen('[ffmpeg] Subtitles can only be embedded in mp4 files')
return True, information
- if not information.get('subtitles'):
+ subtitles = information.get('requested_subtitles')
+ if not subtitles:
self._downloader.to_screen('[ffmpeg] There aren\'t any subtitles to embed')
return True, information
self._downloader.to_screen('[ffmpeg] There aren\'t any subtitles to embed')
return True, information
- sub_langs =
[key for key in information['subtitles']]
+ sub_langs =
list(subtitles.keys())
filename = information['filepath']
filename = information['filepath']
- input_files = [filename] + [subtitles_filename(filename, lang, s
elf._subformat) for lang in sub_langs
]
+ input_files = [filename] + [subtitles_filename(filename, lang, s
ub_info['ext']) for lang, sub_info in subtitles.items()
]
opts = [
'-map', '0',
opts = [
'-map', '0',