This commit is contained in:
Deleted user 2024-07-28 01:28:15 +09:00 committed by GitHub
commit bff38e5414
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -607,6 +607,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:
@ -640,7 +641,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])
@ -650,4 +651,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