mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-16 12:20:10 +00:00
[postprocessor/ffmpeg] remove intermediate srt format files
This commit is contained in:
parent
a803582717
commit
2c40837609
1 changed files with 5 additions and 1 deletions
|
@ -614,6 +614,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
|
||||||
return [], info
|
return [], info
|
||||||
self._downloader.to_screen('[ffmpeg] Converting subtitles')
|
self._downloader.to_screen('[ffmpeg] Converting subtitles')
|
||||||
sub_filenames = []
|
sub_filenames = []
|
||||||
|
temp_srt_filenames = []
|
||||||
for lang, sub in subs.items():
|
for lang, sub in subs.items():
|
||||||
ext = sub['ext']
|
ext = sub['ext']
|
||||||
if ext == new_ext:
|
if ext == new_ext:
|
||||||
|
@ -647,7 +648,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
|
||||||
if new_ext == 'srt':
|
if new_ext == 'srt':
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
sub_filenames.append(srt_file)
|
temp_srt_filenames.append(srt_file)
|
||||||
|
|
||||||
self.run_ffmpeg(old_file, new_file, ['-f', new_format])
|
self.run_ffmpeg(old_file, new_file, ['-f', new_format])
|
||||||
|
|
||||||
|
@ -657,4 +658,7 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor):
|
||||||
'data': f.read(),
|
'data': f.read(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for f in temp_srt_filenames:
|
||||||
|
os.remove(encodeFilename(f))
|
||||||
|
|
||||||
return sub_filenames, info
|
return sub_filenames, info
|
||||||
|
|
Loading…
Add table
Reference in a new issue