mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-06-30 11:02:51 -05:00
[YoutubeDL] store the subtitles to download in the 'requested_subtitles' field
We need to keep the orginal subtitles information, so that the '--load-info' option can be used to list or select the subtitles again. We'll also be able to have a separate field for storing the automatic captions info.
This commit is contained in:
@ -462,13 +462,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 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
|
||||
|
||||
sub_langs = [key for key in information['subtitles']]
|
||||
sub_langs = list(subtitles.keys())
|
||||
filename = information['filepath']
|
||||
input_files = [filename] + [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in information['subtitles'].items()]
|
||||
input_files = [filename] + [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in subtitles.items()]
|
||||
|
||||
opts = [
|
||||
'-map', '0',
|
||||
|
Reference in New Issue
Block a user