From 9049ab2238c46355e6896ed07ebf4e66442a91af Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Mon, 24 Jun 2024 11:13:28 -0400 Subject: [PATCH] Fixed issue with subtitles translation failing. #2519 --- bazarr/subtitles/tools/translate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bazarr/subtitles/tools/translate.py b/bazarr/subtitles/tools/translate.py index 59e3542ad..4dcc25471 100644 --- a/bazarr/subtitles/tools/translate.py +++ b/bazarr/subtitles/tools/translate.py @@ -53,7 +53,7 @@ def translate_subtitles_file(video_path, source_srt_file, from_lang, to_lang, fo partial_lines_str = joined_lines_str[:max_characters] if len(joined_lines_str) > max_characters: - new_partial_lines_str = partial_lines_str.rsplit('\n\n\n', 1)[0] + new_partial_lines_str = partial_lines_str.rsplit('\n\n', 1)[0] else: new_partial_lines_str = partial_lines_str @@ -71,7 +71,7 @@ def translate_subtitles_file(video_path, source_srt_file, from_lang, to_lang, fo logging.exception(f'BAZARR Unable to translate subtitles {source_srt_file}') return False else: - translated_partial_srt_list = translated_partial_srt_text.split('\n\n\n') + translated_partial_srt_list = translated_partial_srt_text.split('\n\n') translated_lines_list += translated_partial_srt_list logging.debug(f'BAZARR saving translated subtitles to {dest_srt_file}')