fix: Resolve SyntaxError caused by accidental backslashes in Python files
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
title: "애니 다운로더"
|
title: "애니 다운로더"
|
||||||
version: "0.5.5"
|
version: "0.5.6"
|
||||||
package_name: "anime_downloader"
|
package_name: "anime_downloader"
|
||||||
developer: "projectdx"
|
developer: "projectdx"
|
||||||
description: "anime downloader"
|
description: "anime downloader"
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ manual_browser_path: Optional[str] = None
|
|||||||
|
|
||||||
|
|
||||||
def find_browser_executable() -> Optional[str]:
|
def find_browser_executable() -> Optional[str]:
|
||||||
\"\"\"시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)\"\"\"
|
"""시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)"""
|
||||||
# 수동 설정된 경로 최우선
|
# 수동 설정된 경로 최우선
|
||||||
if manual_browser_path and os.path.exists(manual_browser_path):
|
if manual_browser_path and os.path.exists(manual_browser_path):
|
||||||
return manual_browser_path
|
return manual_browser_path
|
||||||
@@ -282,16 +282,16 @@ def signal_handler(sig: int, frame: Any) -> None:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == \"__main__\":
|
if __name__ == "__main__":
|
||||||
# 인자 처리
|
# 인자 처리
|
||||||
import argparse
|
import argparse
|
||||||
parser = argparse.ArgumentParser()
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.browser_path:
|
if args.browser_path:
|
||||||
manual_browser_path = 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)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import shutil
|
|||||||
|
|
||||||
|
|
||||||
def find_browser_executable(manual_path=None):
|
def find_browser_executable(manual_path=None):
|
||||||
\"\"\"시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)\"\"\"
|
"""시스템에서 브라우저 실행 파일 찾기 (Docker/Ubuntu 환경 대응)"""
|
||||||
# 수동 설정 시 우선
|
# 수동 설정 시 우선
|
||||||
if manual_path and os.path.exists(manual_path):
|
if manual_path and os.path.exists(manual_path):
|
||||||
return 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:
|
async def fetch_html(url: str, timeout: int = 60, browser_path: str = None) -> dict:
|
||||||
\"\"\"Zendriver로 HTML 페칭\"\"\"
|
"""Zendriver로 HTML 페칭"""
|
||||||
try:
|
try:
|
||||||
import zendriver as zd
|
import zendriver as zd
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
|
|||||||
@@ -139,11 +139,11 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
|
|
||||||
# 브라우저 존재 확인 안내
|
# 브라우저 존재 확인 안내
|
||||||
import shutil
|
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):
|
if browser_path and os.path.exists(browser_path):
|
||||||
has_browser = True
|
has_browser = True
|
||||||
else:
|
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:
|
if not has_browser:
|
||||||
logger.warning("[Zendriver] 브라우저(Chrome/Chromium)가 시스템에 설치되어 있지 않습니다. Docker 환경에서는 직접 설치가 필요할 수 있습니다.")
|
logger.warning("[Zendriver] 브라우저(Chrome/Chromium)가 시스템에 설치되어 있지 않습니다. Docker 환경에서는 직접 설치가 필요할 수 있습니다.")
|
||||||
@@ -176,10 +176,10 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
return False
|
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]
|
cmd = [sys.executable, daemon_script]
|
||||||
if browser_path:
|
if browser_path:
|
||||||
cmd.extend([\"--browser_path\", browser_path])
|
cmd.extend(["--browser_path", browser_path])
|
||||||
|
|
||||||
cls.zendriver_daemon_process = subprocess.Popen(
|
cls.zendriver_daemon_process = subprocess.Popen(
|
||||||
cmd,
|
cmd,
|
||||||
@@ -912,7 +912,7 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
logger.info("Found item-subject in HTML")
|
logger.info("Found item-subject in HTML")
|
||||||
else:
|
else:
|
||||||
logger.warning("item-subject NOT found in HTML")
|
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")
|
logger.info("Found itemprop=image in HTML")
|
||||||
else:
|
else:
|
||||||
logger.warning("itemprop=image NOT found in HTML")
|
logger.warning("itemprop=image NOT found in HTML")
|
||||||
@@ -1542,8 +1542,8 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
import contextlib
|
import contextlib
|
||||||
script_path = os.path.join(os.path.dirname(__file__), \"lib\", \"zendriver_ohli24.py\")
|
script_path = os.path.join(os.path.dirname(__file__), "lib", "zendriver_ohli24.py")
|
||||||
browser_path = P.ModelSetting.get(\"ohli24_zendriver_browser_path\")
|
browser_path = P.ModelSetting.get("ohli24_zendriver_browser_path")
|
||||||
|
|
||||||
cmd = [sys.executable, script_path, url, str(timeout)]
|
cmd = [sys.executable, script_path, url, str(timeout)]
|
||||||
if browser_path:
|
if browser_path:
|
||||||
@@ -2417,8 +2417,8 @@ class Ohli24QueueEntity(AnimeQueueEntity):
|
|||||||
if html_content:
|
if html_content:
|
||||||
# m3u8 URL 패턴 찾기
|
# m3u8 URL 패턴 찾기
|
||||||
m3u8_patterns = [
|
m3u8_patterns = [
|
||||||
re.compile(r"file:\s*['\"]([^'\"]*(?:\.m3u8|master\.txt)[^'\"]*)['\"]"),
|
re.compile(r"file:\s*['"]([^'"]*(?:\.m3u8|master\.txt)[^'"]*)['"]"),
|
||||||
re.compile(r"['\"]([^'\"]*(?:\.m3u8|master\.txt)[^'\"]*)['\"]"),
|
re.compile(r"['"]([^'"]*(?:\.m3u8|master\.txt)[^'"]*)['"]"),
|
||||||
]
|
]
|
||||||
for pattern in m3u8_patterns:
|
for pattern in m3u8_patterns:
|
||||||
match = pattern.search(html_content)
|
match = pattern.search(html_content)
|
||||||
@@ -2437,7 +2437,7 @@ class Ohli24QueueEntity(AnimeQueueEntity):
|
|||||||
logger.debug(f"HTML Content (First 2000 chars): {html_content[:2000]}")
|
logger.debug(f"HTML Content (First 2000 chars): {html_content[:2000]}")
|
||||||
|
|
||||||
if not vtt_url:
|
if not vtt_url:
|
||||||
vtt_match = re.search(r"['\"]([^'\"]*\.vtt[^'\"]*)['\"]", html_content)
|
vtt_match = re.search(r"['"]([^'"]*\.vtt[^'"]*)['"]", html_content)
|
||||||
if vtt_match:
|
if vtt_match:
|
||||||
vtt_url = vtt_match.group(1)
|
vtt_url = vtt_match.group(1)
|
||||||
if vtt_url.startswith("//"): vtt_url = "https:" + vtt_url
|
if vtt_url.startswith("//"): vtt_url = "https:" + vtt_url
|
||||||
|
|||||||
Reference in New Issue
Block a user