From 97310ac9007cce271d3043597b5a74d9a64da735 Mon Sep 17 00:00:00 2001 From: projectdx Date: Sat, 3 Jan 2026 22:30:05 +0900 Subject: [PATCH] docs: Finalize Phase 10 documentation for Zendriver Docker support --- info.yaml | 2 +- lib/zendriver_daemon.py | 2 + zd_debug.py | 92 ++++++++++++++++++++--------------------- 3 files changed, 49 insertions(+), 47 deletions(-) diff --git a/info.yaml b/info.yaml index 8066691..73a512b 100644 --- a/info.yaml +++ b/info.yaml @@ -1,5 +1,5 @@ title: "애니 다운로더" -version: "0.5.14" +version: "0.5.15" package_name: "anime_downloader" developer: "projectdx" description: "anime downloader" diff --git a/lib/zendriver_daemon.py b/lib/zendriver_daemon.py index e0a17a5..89f5773 100644 --- a/lib/zendriver_daemon.py +++ b/lib/zendriver_daemon.py @@ -58,6 +58,7 @@ def find_browser_executable() -> Optional[str]: # 먼저 절대 경로 확인 for path in common_paths: if path.startswith("/") and os.path.exists(path): + log_debug(f"[ZendriverDaemon] Found browser at absolute path: {path}") return path # shutil.which로 PATH 확인 @@ -65,6 +66,7 @@ def find_browser_executable() -> Optional[str]: for cmd in ["google-chrome", "google-chrome-stable", "chromium-browser", "chromium"]: found = shutil.which(cmd) if found: + log_debug(f"[ZendriverDaemon] Found browser via shutil.which: {found}") return found return None diff --git a/zd_debug.py b/zd_debug.py index 72a83dc..a879838 100644 --- a/zd_debug.py +++ b/zd_debug.py @@ -6,56 +6,56 @@ import os import subprocess async def test(): - print("=== Zendriver Final Stand Debug ===") + print("=== Zendriver Google Chrome Debug (v0.5.14) ===") - browser_bin = "/bin/chromium-browser" - if not os.path.exists(browser_bin): - browser_bin = "/usr/bin/chromium-browser" + # Check possible paths + bin_paths = ["/usr/bin/google-chrome", "/usr/bin/google-chrome-stable", "/usr/bin/chromium-browser"] - print(f"Testing browser binary: {browser_bin}") - - # 1. Try to run browser version check - try: - print("\n--- Checking Browser Version ---") - out = subprocess.check_output([browser_bin, "--version"], stderr=subprocess.STDOUT).decode() - print(f"Version output: {out}") - except Exception as e: - print(f"Version check failed: {e}") - if hasattr(e, 'output'): - print(f"Error output: {e.output.decode()}") + for browser_bin in bin_paths: + if not os.path.exists(browser_bin): + continue + + print(f"\n>>> Testing binary: {browser_bin}") + + # 1. Version Check + try: + out = subprocess.check_output([browser_bin, "--version"], stderr=subprocess.STDOUT).decode() + print(f"Version: {out.strip()}") + except Exception as e: + print(f"Version check failed: {e}") + if hasattr(e, 'output'): + print(f"Output: {e.output.decode()}") - # 2. Try to run browser with minimum flags to see if it crashes - print("\n--- Direct Subprocess Start Test (Headless + No Sandbox) ---") - try: - # Just try to get help or something that starts the engine - cmd = [browser_bin, "--headless", "--no-sandbox", "--disable-gpu", "--remote-debugging-port=9222", "--about:blank"] - print(f"Running: {' '.join(cmd)}") - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - await asyncio.sleep(3) - if proc.poll() is None: - print(">>> SUCCESS: Browser process is ALIVE after 3 seconds!") - proc.terminate() - else: - stdout, stderr = proc.communicate() - print(f"FAIL: Browser process DIED instantly (code {proc.returncode})") - print(f"STDOUT: {stdout.decode()}") - print(f"STDERR: {stderr.decode()}") - except Exception as e: - print(f"Process start test failed: {e}") + # 2. Minimum execution test (Headless + No Sandbox) + print("--- Direct Execution Test ---") + try: + cmd = [browser_bin, "--headless", "--no-sandbox", "--disable-gpu", "--user-data-dir=/tmp/test_chrome", "--about:blank"] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + await asyncio.sleep(3) + if proc.poll() is None: + print("SUCCESS: Browser process is alive!") + proc.terminate() + else: + stdout, stderr = proc.communicate() + print(f"FAIL: Browser process died (code {proc.returncode})") + print(f"STDERR: {stderr.decode()}") + except Exception as e: + print(f"Execution test failed: {e}") - # 3. Last try with Zendriver and absolute bare settings - print("\n--- Zendriver Barebones Test ---") - try: - browser = await zd.start( - browser_executable_path=browser_bin, - headless=True, - sandbox=False, - browser_args=["--no-sandbox", "--disable-dev-shm-usage"] - ) - print(">>> SUCCESS: Zendriver connected!") - await browser.stop() - except Exception as e: - print(f"Zendriver test failed: {e}") + # 3. Zendriver Test + print("--- Zendriver Integration Test ---") + try: + browser = await zd.start( + browser_executable_path=browser_bin, + headless=True, + sandbox=False + ) + print("SUCCESS: Zendriver connected!") + await browser.stop() + # If we found one that works, we can stop + print("\n!!! This path works. Set this in the plugin settings or leave empty if it is the first found.") + except Exception as e: + print(f"Zendriver failed: {e}") if __name__ == "__main__": asyncio.run(test())