From 190d2ee2a3737fc7c09fa39ffa139bc66bc568fe Mon Sep 17 00:00:00 2001 From: Variet Agent Date: Thu, 19 Mar 2026 08:01:22 +0900 Subject: [PATCH] =?UTF-8?q?fix(subtitle):=20=EC=9E=90=EB=A7=89=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EA=B7=BC?= =?UTF-8?q?=EB=B3=B8=20=EC=88=98=EC=A0=95=20=E2=80=94=20ZIP=20=ED=95=B4?= =?UTF-8?q?=EC=A0=9C=20=EC=A1=B4=EC=9E=AC=EC=B2=B4=ED=81=AC=20+=20discover?= =?UTF-8?q?ed=5Fep=3DNone=20=EC=8B=9C=20=EC=A0=84=EC=B2=B4=20=EC=8A=A4?= =?UTF-8?q?=ED=82=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/anime_pipeline.py | 5 +++++ tools/subtitle_downloader.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/anime_pipeline.py b/tools/anime_pipeline.py index 599d995..b64165f 100644 --- a/tools/anime_pipeline.py +++ b/tools/anime_pipeline.py @@ -762,6 +762,11 @@ class AnimePipeline: logger.info(f"자막 URL 스킵 (기존 존재): ep{discovered_ep}") continue + # 에피소드를 모르는 URL: 기존 영상 에피소드 전부 자막 있으면 다운로드 불필요 + if discovered_ep is None and unit.existing_eps and unit.existing_eps.issubset(existing_sub_eps): + logger.info(f"자막 URL 스킵 (모든 에피소드 자막 존재): {url[:60]}") + continue + try: subs = await self.sub_downloader.find_subtitles(url) for sub in subs: diff --git a/tools/subtitle_downloader.py b/tools/subtitle_downloader.py index 7807ed8..37bc319 100644 --- a/tools/subtitle_downloader.py +++ b/tools/subtitle_downloader.py @@ -324,6 +324,11 @@ class SubtitleDownloader: # 중첩 폴더 무시, 파일만 추출 out_name = Path(name).name out_path = target_dir / out_name + # 이미 존재하면 스킵 (중복 다운로드 방지) + if out_path.exists() and out_path.stat().st_size > 0: + logger.info(f"ZIP 내 파일 이미 존재, 스킵: {out_name}") + extracted.append(str(out_path)) + continue with zf.open(name) as src, open(out_path, "wb") as dst: dst.write(src.read()) extracted.append(str(out_path))