devez-vibe 1.9.33
postinstall hook, stealth scraping
“Stable terminal UI for Codex and Claude Agent SDK”
Skill tool installs packages via pip at runtimeBinary has a high-entropy 64 KiB region
SHA-25664dad8516f8a20bbbe9304dd4b98a22fd0b2d66a28b4261c1659c95d06c592a1
Evidence
1"""Capability-matched executor for fallback attempts.
2
3The fetch_chain's probe/grid phase uses curl_cffi directly. When curl can't
4punch through (JS challenge, real-TLS detection), this module routes to the
5right browser executor based on the profile's `capabilities_needed` tags:
6
7 needs_real_tls_stack + needs_js_exec → playwright_real_chrome.js
8 needs_js_exec only → Playwright MCP (if available)
9 needs_mobile_context (+ real_tls) → playwright_mobile_chrome.js
10
11The JS templates live in `engine/templates/` and accept only generic
12parameters ({{url}}, {{waitSelector}}, {{profileDir}}, {{device}}). No
13site-specific logic.
14
⋯4 lines
19from __future__ import annotations
20
21import importlib.util
22import json
23import os
24import shutil
25import subprocess
26import sys
27import tempfile
28import time
29from typing import Optional
30
31from .validators import Verdict, validate
32from .waf_detector import load_profile
33from .fetch_chain import Attempt
34
35
⋯5 lines
51:30… rs so emulation state never bleeds across.
52 """
53 import hashlib
54 from urllib.parse import urlsplit
55 host = (urlsplit(url).hostname or "unknown").lower()
56 host_hash = hashlib.sha1(host.encode("utf-8", "ignore")).hexdigest()[:16]
57 device = "mobile" if "mobile" in choice else "desktop"
58 return os.path.join(tempfile.gettempdir(), ".insane_pw", host_hash, device)
59
60
61def _node_available() -> bool:
62 return shutil.which("node") is not None
63
64
65# Node deps live OUTSIDE the plugin tree. `templates/node_modules` is gitignored,
66# so a marketplace install (or any fresh clone) ships the JS templates with no
67# `playwright` module — every browser fallback then died …
69:14… nce and reused across plugin upgrades.
70NODE_DEPS_DIR = os.path.expanduser("~/.insane-search/node")
71_NODE_DEPS_CACHE: Optional[str] = None
72
73
74def _has_playwright_module(root: str) -> bool:
75 return os.path.isdir(os.path.join(root, "node_modules", "playwright"))
76
77
78def _npm_install(dest: str) -> bool:
79 """Install the template deps in …
81:16… hich("npm") is None:
82 return False
83 os.makedirs(dest, exist_ok=True)
84 src_pkg = os.path.join(TEMPLATES_DIR, "package.json")
85 if os.path.isfile(src_pkg):
86 shutil.copyfile(src_pkg, os.path.join(dest, "package.json"))
87 env = dict(os.environ)
88 env["PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD"] = "1"
89 env["PATCHRIGHT_SKIP_BROWSER_DOWNLOAD"] = "1"
90 lock = os.path.join( …
153:12… nstall(pkg: str, module: Optional[str] = None) -> bool:
154 if os.environ.get("INSANE_AUTO_INSTALL", "").strip().lower() not in ("1", "true", "yes"):
155 return False
156 try:
157 subprocess.run([sys.executable, "-m", "pip", "install", pkg, "-q"],
158 capture_output=True, timeout=180, check=False)
159 except Exception:
160 return Fals …
Showing the top 5 files — 7 more files (126 regions) not shown.
No evidence locations were recorded for this file. Raw result