mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 03:41:00 +01:00
FFmpegEmbedSubtitlePP: remove the subtitle files if '--keep-video' is not given (closes #5435)
This commit is contained in:
parent
592e97e855
commit
14523ed969
|
@ -513,7 +513,8 @@ def run(self, information):
|
||||||
|
|
||||||
sub_langs = list(subtitles.keys())
|
sub_langs = list(subtitles.keys())
|
||||||
filename = information['filepath']
|
filename = information['filepath']
|
||||||
input_files = [filename] + [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in subtitles.items()]
|
sub_filenames = [subtitles_filename(filename, lang, sub_info['ext']) for lang, sub_info in subtitles.items()]
|
||||||
|
input_files = [filename] + sub_filenames
|
||||||
|
|
||||||
opts = [
|
opts = [
|
||||||
'-map', '0',
|
'-map', '0',
|
||||||
|
@ -535,7 +536,7 @@ def run(self, information):
|
||||||
os.remove(encodeFilename(filename))
|
os.remove(encodeFilename(filename))
|
||||||
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
|
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
|
||||||
|
|
||||||
return [], information
|
return sub_filenames, information
|
||||||
|
|
||||||
|
|
||||||
class FFmpegMetadataPP(FFmpegPostProcessor):
|
class FFmpegMetadataPP(FFmpegPostProcessor):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user