提取内置字幕

This commit is contained in:
Hraulein
2026-05-10 20:54:23 +08:00
parent 083e82ab22
commit ec0250ccb5
3 changed files with 52 additions and 17 deletions
+9 -5
View File
@@ -119,12 +119,16 @@ def run_pipeline(target_dir: Path, args, auto_execute=False):
log.debug(f"✨ [完美豁免] {f.name} 已达最高工业标准,直接放行~")
if args.mode != "clean-ads":
# 💡 传入 dest_dir
RenamerService.scan_existing_subtitles(f, target_stem, m_type, dest_dir, task_mgr)
if (config.EXTRACT_INTERNAL_SUBS or args.extract_internal) and (not skip_heavy or args.extract_internal):
# 💡 传入 dest_dir
SubtitleService.scan_subtitles(f, task_mgr, target_stem, dest_dir)
# 💡 步骤 1:先扫描外挂字幕,接收状态反馈
has_ext_sub = RenamerService.scan_existing_subtitles(f, target_stem, m_type, dest_dir, task_mgr)
# 💡 步骤 2:联动决策
# 如果没有外挂字幕,或者用户在 config 开了全局强制,或者使用了 --extract-internal 参数,才执行内置提取
should_extract_internal = (not has_ext_sub) or config.EXTRACT_INTERNAL_SUBS or args.extract_internal
if should_extract_internal and (not skip_heavy or args.extract_internal or args.mode == "extract-subs"):
SubtitleService.scan_subtitles(f, task_mgr, target_stem, dest_dir)
if args.mode != "extract-subs" and not skip_heavy:
MetadataService.scan_ads(f, task_mgr)
MetadataService.scan_audio_tracks(f, task_mgr)