fix: v0.5.12 - Switch to Google Chrome Stable to avoid Snap wrapper issues in Docker
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
title: "애니 다운로더"
|
title: "애니 다운로더"
|
||||||
version: "0.5.11"
|
version: "0.5.12"
|
||||||
package_name: "anime_downloader"
|
package_name: "anime_downloader"
|
||||||
developer: "projectdx"
|
developer: "projectdx"
|
||||||
description: "anime downloader"
|
description: "anime downloader"
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
"os": platform.system(),
|
"os": platform.system(),
|
||||||
"dist": "",
|
"dist": "",
|
||||||
"can_install": False,
|
"can_install": False,
|
||||||
"install_cmd": "apt-get update && apt-get install -y chromium-browser"
|
"install_cmd": "wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list && apt-get update && apt-get install -y google-chrome-stable"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 브라우저 찾기
|
# 브라우저 찾기
|
||||||
@@ -250,7 +250,8 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
res["browser_found"] = True
|
res["browser_found"] = True
|
||||||
res["browser_path"] = manual_path
|
res["browser_path"] = manual_path
|
||||||
else:
|
else:
|
||||||
for cmd in ["google-chrome", "google-chrome-stable", "chromium-browser", "chromium"]:
|
# Snap 이슈를 피하기 위해 google-chrome을 우선순위로 둠
|
||||||
|
for cmd in ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]:
|
||||||
found = shutil.which(cmd)
|
found = shutil.which(cmd)
|
||||||
if found:
|
if found:
|
||||||
res["browser_found"] = True
|
res["browser_found"] = True
|
||||||
@@ -279,12 +280,19 @@ class LogicOhli24(AnimeModuleBase):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
logger.info("[Zendriver] Starting system browser installation...")
|
logger.info("[Zendriver] Starting system browser installation...")
|
||||||
# apt-get update
|
# Google Chrome Repo 등록 및 설치 (Snap 회피용)
|
||||||
|
sp.run(["apt-get", "update"], capture_output=True, text=True, timeout=300)
|
||||||
|
sp.run(["apt-get", "install", "-y", "wget", "gnupg"], capture_output=True, text=True, timeout=300)
|
||||||
|
|
||||||
|
# Google Key & Repo
|
||||||
|
sp.run("wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -", shell=True, capture_output=True, text=True, timeout=60)
|
||||||
|
sp.run("echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google.list", shell=True, capture_output=True, text=True, timeout=60)
|
||||||
|
|
||||||
sp.run(["apt-get", "update"], capture_output=True, text=True, timeout=300)
|
sp.run(["apt-get", "update"], capture_output=True, text=True, timeout=300)
|
||||||
|
|
||||||
# apt-get install
|
# Install Chrome
|
||||||
process = sp.run(
|
process = sp.run(
|
||||||
["apt-get", "install", "-y", "chromium-browser"],
|
["apt-get", "install", "-y", "google-chrome-stable"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
timeout=600
|
timeout=600
|
||||||
|
|||||||
71
zd_debug.py
71
zd_debug.py
@@ -3,48 +3,59 @@ import asyncio
|
|||||||
import zendriver as zd
|
import zendriver as zd
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import inspect
|
import subprocess
|
||||||
|
|
||||||
async def test():
|
async def test():
|
||||||
print("=== Zendriver API Inspection ===")
|
print("=== Zendriver Final Stand Debug ===")
|
||||||
|
|
||||||
# Inspect zd.start
|
browser_bin = "/bin/chromium-browser"
|
||||||
print("\n--- zd.start Signature ---")
|
if not os.path.exists(browser_bin):
|
||||||
|
browser_bin = "/usr/bin/chromium-browser"
|
||||||
|
|
||||||
|
print(f"Testing browser binary: {browser_bin}")
|
||||||
|
|
||||||
|
# 1. Try to run browser version check
|
||||||
try:
|
try:
|
||||||
sig = inspect.signature(zd.start)
|
print("\n--- Checking Browser Version ---")
|
||||||
print(sig)
|
out = subprocess.check_output([browser_bin, "--version"], stderr=subprocess.STDOUT).decode()
|
||||||
for param in sig.parameters.values():
|
print(f"Version output: {out}")
|
||||||
print(f" {param.name}: {param.default}")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Failed to inspect zd.start: {e}")
|
print(f"Version check failed: {e}")
|
||||||
|
if hasattr(e, 'output'):
|
||||||
|
print(f"Error output: {e.output.decode()}")
|
||||||
|
|
||||||
# Inspect zd.Config
|
# 2. Try to run browser with minimum flags to see if it crashes
|
||||||
print("\n--- zd.Config Attributes ---")
|
print("\n--- Direct Subprocess Start Test (Headless + No Sandbox) ---")
|
||||||
try:
|
try:
|
||||||
config = zd.Config()
|
# Just try to get help or something that starts the engine
|
||||||
# Filter out dunder methods
|
cmd = [browser_bin, "--headless", "--no-sandbox", "--disable-gpu", "--remote-debugging-port=9222", "--about:blank"]
|
||||||
attrs = [a for a in dir(config) if not a.startswith("__")]
|
print(f"Running: {' '.join(cmd)}")
|
||||||
print(attrs)
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
await asyncio.sleep(3)
|
||||||
# Check current values
|
if proc.poll() is None:
|
||||||
for a in attrs:
|
print(">>> SUCCESS: Browser process is ALIVE after 3 seconds!")
|
||||||
try:
|
proc.terminate()
|
||||||
val = getattr(config, a)
|
else:
|
||||||
if not callable(val):
|
stdout, stderr = proc.communicate()
|
||||||
print(f" {a} = {val}")
|
print(f"FAIL: Browser process DIED instantly (code {proc.returncode})")
|
||||||
except:
|
print(f"STDOUT: {stdout.decode()}")
|
||||||
pass
|
print(f"STDERR: {stderr.decode()}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Failed to inspect zd.Config: {e}")
|
print(f"Process start test failed: {e}")
|
||||||
|
|
||||||
print("\n--- Testing Config 3: 'arguments' instead of 'browser_args' ---")
|
# 3. Last try with Zendriver and absolute bare settings
|
||||||
|
print("\n--- Zendriver Barebones Test ---")
|
||||||
try:
|
try:
|
||||||
# Based on typical Zendriver usage, it might be 'arguments'
|
browser = await zd.start(
|
||||||
browser = await zd.start(headless=True, no_sandbox=True, arguments=["--no-sandbox", "--disable-dev-shm-usage"])
|
browser_executable_path=browser_bin,
|
||||||
print("Success with Config 3 (arguments)!")
|
headless=True,
|
||||||
|
sandbox=False,
|
||||||
|
browser_args=["--no-sandbox", "--disable-dev-shm-usage"]
|
||||||
|
)
|
||||||
|
print(">>> SUCCESS: Zendriver connected!")
|
||||||
await browser.stop()
|
await browser.stop()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Config 3 (arguments) Failed: {e}")
|
print(f"Zendriver test failed: {e}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
asyncio.run(test())
|
asyncio.run(test())
|
||||||
|
|||||||
Reference in New Issue
Block a user