From 2b41a5fad6defc549bee20cc32895a2d063e1c8d Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 8 Jan 2024 12:30:46 +0000 Subject: [PATCH] remove temp file after completion --- auto_subtitle/utils/ffmpeg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto_subtitle/utils/ffmpeg.py b/auto_subtitle/utils/ffmpeg.py index a7c2c31..223cb02 100644 --- a/auto_subtitle/utils/ffmpeg.py +++ b/auto_subtitle/utils/ffmpeg.py @@ -51,5 +51,6 @@ def add_subs_new(subtitles: dict): output = ffmpeg.output(input_stream, subtitle_stream, output_file.replace('.mkv','.mp4'), c='copy', **{'c:s': 'mov_text'}, **{'metadata:s:s:0': 'language=eng'}) ffmpeg.run(output, quiet=True, overwrite_output=True) os.remove(input_file+'_edit') - if '.mkv' in output_file: - os.remove(output_file) \ No newline at end of file + # remove tempfiles + os.remove(subtitle_file) + os.remove(subtitle_file.replace(".srt",".wav")) \ No newline at end of file