소스 검색

remove temp file after completion

Karl 1 년 전
부모
커밋
2b41a5fad6
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      auto_subtitle/utils/ffmpeg.py

+ 3 - 2
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)
+    # remove tempfiles
+    os.remove(subtitle_file)
+    os.remove(subtitle_file.replace(".srt",".wav"))