From 0dc9b09e1df920fc353dc3f4f34741251a5e738c Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:08:22 -0700 Subject: [PATCH] Update subgen.py --- subgen/subgen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subgen/subgen.py b/subgen/subgen.py index 808182d..720fad8 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -297,7 +297,8 @@ def gen_subtitles(file_path: str, transcribe_or_translate_str: str, front=True) except Exception as e: print(f"Error processing or transcribing {file_path}: {e}") finally: - files_to_transcribe.remove(file_path) + if file_path in files_to_transcribe: + files_to_transcribe.remove(file_path) delete_model() def get_file_name_without_extension(file_path):