feat(browser): migrate to CloakBrowser for browser emulation and streamline dependency management

- Replace Playwright-based browser emulation with CloakBrowser as default
- Update config to support CloakBrowser options and humanization presets
- Refactor browser helper to use CloakBrowser context and remove cf_clearance dependency
- Update Dockerfile, entrypoint, and update scripts to install CloakBrowser runtime
- Ensure CloakBrowser kernel is pre-installed during local setup and dependency updates
- Add tests for CloakBrowser integration and legacy compatibility
This commit is contained in:
jxxghp
2026-05-16 20:51:38 +08:00
parent 9069dccb2a
commit 0ee9fec1d2
10 changed files with 293 additions and 140 deletions

View File

@@ -2653,9 +2653,18 @@ def install_deps(*, python_bin: str, venv_dir: Path, recreate: bool) -> Path:
print_step("安装项目依赖")
run([str(venv_pip), "install", "-r", str(ROOT / "requirements.txt")])
install_browser_runtime(venv_python)
return venv_python
def install_browser_runtime(venv_python: Path) -> None:
"""
预下载 CloakBrowser 浏览器内核,避免首次仿真登录时才拉取大文件。
"""
print_step("安装 CloakBrowser 浏览器内核")
run([str(venv_python), "-m", "cloakbrowser", "install"])
def _startup_platform_name() -> str:
system = platform.system()
if system == "Darwin":