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))