From feca4b22384fd92d471befae04e6453c8a1e8e74 Mon Sep 17 00:00:00 2001 From: TimoYoung Date: Mon, 21 Apr 2025 17:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=85=E5=9C=A8=E7=BF=BB=E8=AF=91=E8=8B=B1?= =?UTF-8?q?=E8=AF=AD=E6=97=B6=E5=90=88=E5=B9=B6=E5=AD=97=E5=B9=95=EF=BC=9B?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9B=B4=E5=A4=9A=E6=97=A5=E5=BF=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/autosubv2/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/autosubv2/__init__.py b/plugins/autosubv2/__init__.py index 88244aa..d1cb7dc 100644 --- a/plugins/autosubv2/__init__.py +++ b/plugins/autosubv2/__init__.py @@ -294,7 +294,7 @@ class AutoSubv2(_PluginBase): if self.send_notify: self.post_message(mtype=NotificationType.Plugin, title="【自动字幕生成】", text=message) # 打印调用栈 - logger.debug(traceback.format_exc()) + logger.error(traceback.format_exc()) self.fail_count += 1 def __process_folder_subtitle(self, path): @@ -789,8 +789,11 @@ class AutoSubv2(_PluginBase): def __translate_zh_subtitle(self, source_lang: str, source_subtitle: str, dest_subtitle: str): self._stats = {'total': 0, 'batch_success': 0, 'batch_fail': 0, 'line_fallback': 0} subs = self.__load_srt(source_subtitle) - valid_subs = self.__merge_srt(subs) - logger.info(f"合并前字幕数: {len(subs)},合并后字幕数: {len(valid_subs)}") + if source_lang in ["en", "eng"]: + valid_subs = self.__merge_srt(subs) + logger.info(f"英文字幕合并:合并前字幕数: {len(subs)},合并后字幕数: {len(valid_subs)}") + else: + valid_subs = subs self._stats['total'] = len(valid_subs) processed = [] current_batch = []