mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-09-24 14:20:08 +01:00
Nothing waited for the destination once the interstitial let go: page_html stayed unset and the networkidle wait only ran on the branch that never saw a challenge, so a challenge clearing on its own returned whatever had loaded by then. Wait for it on both branches. An exhausted budget produced timeout=0, which Playwright reads as no timeout at all, turning every remaining wait unbounded exactly when it should fail fast. Floor it instead. Scroll the widget into view before measuring it, since bounding_box reports viewport coordinates and an off-screen widget was clicked at a point that hit nothing, and reject containers taller than a checkbox row so a full-page wrapper cannot pass for one - both reported success while clicking blank space. Drop max_attempts, which nothing reads now that the solver is gone, and refresh AGENTS.md, which still described camoufox and a solver in the dependency. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
import logging
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
log_level: str = "INFO"
|
|
version: str = "unknown"
|
|
|
|
proxy_server: str | None = None
|
|
proxy_username: str | None = None
|
|
proxy_password: str | None = None
|
|
|
|
host: str = "0.0.0.0" # noqa: S104
|
|
port: int = 8191
|
|
|
|
block_media: bool = False
|
|
return_only_cookies: bool = False
|
|
owui_api_key: str | None = None
|
|
browser_locale: str | None = None
|
|
|
|
|
|
settings = Settings()
|
|
|
|
LOG_LEVEL = logging.getLevelNamesMapping()[settings.log_level.upper()]
|
|
VERSION = settings.version.removeprefix("v")
|
|
|
|
PROXY_SERVER = settings.proxy_server
|
|
PROXY_USERNAME = settings.proxy_username
|
|
PROXY_PASSWORD = settings.proxy_password
|
|
|
|
HOST = settings.host
|
|
PORT = settings.port
|
|
|
|
BLOCK_MEDIA = settings.block_media
|
|
RETURN_ONLY_COOKIES = settings.return_only_cookies
|
|
|
|
OWUI_API_KEY = settings.owui_api_key
|
|
BROWSER_LOCALE = settings.browser_locale
|