From 82fb0126f8f21ff7e2d7901472ebd49c03afea8d Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:12:04 -0600 Subject: [PATCH] Update subgen.py --- subgen/subgen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subgen/subgen.py b/subgen/subgen.py index ed809c2..f081f26 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -91,7 +91,7 @@ def gen_subtitles(inputvideo): try: print(f"Transcribing file: {inputvideo}") result = model.transcribe_stable(inputvideo) - result.to_srt_vtt(inputvideo + subextension, word_level=word_level_highlight) + result.to_srt_vtt(inputvideo.rsplit('.', 1)[0] + ' ' + subextension, word_level=word_level_highlight) print(f"Transcription of {file_path} is completed.") files_to_transcribe.remove(inputvideo) except Exception as e: @@ -104,7 +104,7 @@ def add_file_for_transcription(file_path): if has_subtitle_language(file_path, skipifinternalsublang): print("File already has an internal sub we want, skipping generation") return "File already has an internal sub we want, skipping generation" - elif os.path.exists(file_path + subextension): + elif os.path.exists(file_path.rsplit('.', 1)[0] + ' ' + subextension): print("We already have a subgen created for this file, skipping it") return "We already have a subgen created for this file, skipping it"