From f6097382a4194a72062c3435c8beacefa3fdbe50 Mon Sep 17 00:00:00 2001 From: projectdx Date: Sat, 3 Jan 2026 20:55:39 +0900 Subject: [PATCH] fix: Resolve SyntaxError caused by accidental backslashes in Python files --- info.yaml | 2 +- lib/zendriver_daemon.py | 8 ++++---- lib/zendriver_ohli24.py | 4 ++-- mod_ohli24.py | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/info.yaml b/info.yaml index a3dc606..3b36b86 100644 --- a/info.yaml +++ b/info.yaml @@ -1,5 +1,5 @@ title: "애니 다운로더" -version: "0.5.5" +version: "0.5.6" package_name: "anime_downloader" developer: "projectdx" description: "anime downloader" diff --git a/lib/zendriver_daemon.py b/lib/zendriver_daemon.py index 564eab4..414ae8a 100644 --- a/lib/zendriver_daemon.py +++ b/lib/zendriver_daemon.py @@ -39,7 +39,7 @@ manual_browser_path: Optional[str] = None def find_browser_executable() -> Optional[str]: - \"\"\"시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)\"\"\" + """시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)""" # 수동 설정된 경로 최우선 if manual_browser_path and os.path.exists(manual_browser_path): return manual_browser_path @@ -282,16 +282,16 @@ def signal_handler(sig: int, frame: Any) -> None: sys.exit(0) -if __name__ == \"__main__\": +if __name__ == "__main__": # 인자 처리 import argparse parser = argparse.ArgumentParser() - parser.add_argument(\"--browser_path\", type=str, default=None) + parser.add_argument("--browser_path", type=str, default=None) args = parser.parse_args() if args.browser_path: manual_browser_path = args.browser_path - log_debug(f\"[ZendriverDaemon] Manual browser path set: {manual_browser_path}\") + log_debug(f"[ZendriverDaemon] Manual browser path set: {manual_browser_path}") # 시그널 핸들러 등록 signal.signal(signal.SIGINT, signal_handler) diff --git a/lib/zendriver_ohli24.py b/lib/zendriver_ohli24.py index b704a50..c4edad6 100644 --- a/lib/zendriver_ohli24.py +++ b/lib/zendriver_ohli24.py @@ -15,7 +15,7 @@ import shutil def find_browser_executable(manual_path=None): - \"\"\"시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)\"\"\" + """시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)""" # 수동 설정 시 우선 if manual_path and os.path.exists(manual_path): return manual_path @@ -43,7 +43,7 @@ def find_browser_executable(manual_path=None): async def fetch_html(url: str, timeout: int = 60, browser_path: str = None) -> dict: - \"\"\"Zendriver로 HTML 페칭\"\"\" + """Zendriver로 HTML 페칭""" try: import zendriver as zd except ImportError as e: diff --git a/mod_ohli24.py b/mod_ohli24.py index c68ac1f..0e394b5 100644 --- a/mod_ohli24.py +++ b/mod_ohli24.py @@ -139,11 +139,11 @@ class LogicOhli24(AnimeModuleBase): # 브라우저 존재 확인 안내 import shutil - browser_path = P.ModelSetting.get(\"ohli24_zendriver_browser_path\") + browser_path = P.ModelSetting.get("ohli24_zendriver_browser_path") if browser_path and os.path.exists(browser_path): has_browser = True else: - has_browser = any(shutil.which(cmd) for cmd in [\"google-chrome\", \"google-chrome-stable\", \"chromium-browser\", \"chromium\"]) + has_browser = any(shutil.which(cmd) for cmd in ["google-chrome", "google-chrome-stable", "chromium-browser", "chromium"]) if not has_browser: logger.warning("[Zendriver] 브라우저(Chrome/Chromium)가 시스템에 설치되어 있지 않습니다. Docker 환경에서는 직접 설치가 필요할 수 있습니다.") @@ -176,10 +176,10 @@ class LogicOhli24(AnimeModuleBase): return False # 데몬 프로세스 시작 (백그라운드) - browser_path = P.ModelSetting.get(\"ohli24_zendriver_browser_path\") + browser_path = P.ModelSetting.get("ohli24_zendriver_browser_path") cmd = [sys.executable, daemon_script] if browser_path: - cmd.extend([\"--browser_path\", browser_path]) + cmd.extend(["--browser_path", browser_path]) cls.zendriver_daemon_process = subprocess.Popen( cmd, @@ -912,7 +912,7 @@ class LogicOhli24(AnimeModuleBase): logger.info("Found item-subject in HTML") else: logger.warning("item-subject NOT found in HTML") - if "itemprop=\"image\"" in response_data: + if "itemprop="image"" in response_data: logger.info("Found itemprop=image in HTML") else: logger.warning("itemprop=image NOT found in HTML") @@ -1542,8 +1542,8 @@ class LogicOhli24(AnimeModuleBase): try: import subprocess import contextlib - script_path = os.path.join(os.path.dirname(__file__), \"lib\", \"zendriver_ohli24.py\") - browser_path = P.ModelSetting.get(\"ohli24_zendriver_browser_path\") + script_path = os.path.join(os.path.dirname(__file__), "lib", "zendriver_ohli24.py") + browser_path = P.ModelSetting.get("ohli24_zendriver_browser_path") cmd = [sys.executable, script_path, url, str(timeout)] if browser_path: @@ -2417,8 +2417,8 @@ class Ohli24QueueEntity(AnimeQueueEntity): if html_content: # m3u8 URL 패턴 찾기 m3u8_patterns = [ - re.compile(r"file:\s*['\"]([^'\"]*(?:\.m3u8|master\.txt)[^'\"]*)['\"]"), - re.compile(r"['\"]([^'\"]*(?:\.m3u8|master\.txt)[^'\"]*)['\"]"), + re.compile(r"file:\s*['"]([^'"]*(?:\.m3u8|master\.txt)[^'"]*)['"]"), + re.compile(r"['"]([^'"]*(?:\.m3u8|master\.txt)[^'"]*)['"]"), ] for pattern in m3u8_patterns: match = pattern.search(html_content) @@ -2437,7 +2437,7 @@ class Ohli24QueueEntity(AnimeQueueEntity): logger.debug(f"HTML Content (First 2000 chars): {html_content[:2000]}") if not vtt_url: - vtt_match = re.search(r"['\"]([^'\"]*\.vtt[^'\"]*)['\"]", html_content) + vtt_match = re.search(r"['"]([^'"]*\.vtt[^'"]*)['"]", html_content) if vtt_match: vtt_url = vtt_match.group(1) if vtt_url.startswith("//"): vtt_url = "https:" + vtt_url