Fixed issue with subtitles translation failing. #2519

pull/2550/head
morpheus65535 5 months ago
parent dcbd8130db
commit 9049ab2238

@ -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}')

Loading…
Cancel
Save