From bb59e7caca9f454d610344f545b2c534ad1ce31e Mon Sep 17 00:00:00 2001 From: Variet Agent Date: Thu, 19 Mar 2026 07:06:27 +0900 Subject: [PATCH] =?UTF-8?q?fix(subtitle):=202=EC=B0=A8=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=B2=B4=ED=81=AC=20=E2=80=94=20Content-D?= =?UTF-8?q?isposition=20=ED=8C=8C=EC=9D=BC=EB=AA=85=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A1=B4=EC=9E=AC=20=ED=99=95=EC=9D=B8=20=ED=9B=84=20=EC=93=B0?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/subtitle_downloader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/subtitle_downloader.py b/tools/subtitle_downloader.py index 385978d..7807ed8 100644 --- a/tools/subtitle_downloader.py +++ b/tools/subtitle_downloader.py @@ -252,7 +252,7 @@ class SubtitleDownloader: target_dir = Path(save_dir) if save_dir else self.download_dir target_dir.mkdir(parents=True, exist_ok=True) - # 이미 같은 파일명이 존재하면 스킵 + # 이미 같은 파일명이 존재하면 스킵 (1차 — 원본 파일명 기준) existing = target_dir / sub.filename if existing.exists() and existing.stat().st_size > 0: logger.info(f"자막 이미 존재, 스킵: {existing}") @@ -280,7 +280,13 @@ class SubtitleDownloader: if m: sub.filename = unquote(m.group(1).strip()) + # 실제 파일명으로 2차 존재 체크 (Content-Disposition 반영 후) filepath = target_dir / sub.filename + if filepath.exists() and filepath.stat().st_size > 0: + logger.info(f"자막 이미 존재 (실제 파일명), 스킵: {filepath}") + sub.local_path = str(filepath) + return str(filepath) + filepath.write_bytes(resp.content) # ZIP/7z 자동 해제