mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-10-05 22:04:27 +01:00
fix: disabled HEADLESS mode by default and updated dependencies
This commit is contained in:
+2
-1
@@ -30,7 +30,7 @@ VERSION = get_version_from_env() or "unknown"
|
||||
USE_XVFB = os.getenv("USE_XVFB") in ["true", "1"] if os.getenv("USE_XVFB") else None
|
||||
|
||||
USE_HEADLESS = (
|
||||
os.getenv("USE_HEADLESS") in ["true", "1"] if os.getenv("USE_HEADLESS") else None
|
||||
os.getenv("USE_HEADLESS") in ["true", "1"] if os.getenv("USE_HEADLESS") else False
|
||||
)
|
||||
|
||||
PROXY = os.getenv("PROXY")
|
||||
@@ -38,6 +38,7 @@ PROXY = os.getenv("PROXY")
|
||||
CHALLENGE_TITLES = [
|
||||
# Cloudflare
|
||||
"Just a moment...",
|
||||
"Verifying you are human",
|
||||
# DDoS-GUARD
|
||||
"DDoS-Guard",
|
||||
]
|
||||
|
||||
+13
-6
@@ -5,7 +5,7 @@ from fastapi import Header, HTTPException
|
||||
from httpx import codes
|
||||
from sbase import SB, BaseCase
|
||||
|
||||
from src.consts import LOG_LEVEL, PROXY, USE_HEADLESS
|
||||
from src.consts import LOG_LEVEL, PROXY, USE_HEADLESS, USE_XVFB
|
||||
|
||||
logger = logging.getLogger("uvicorn.error")
|
||||
logger.setLevel(LOG_LEVEL)
|
||||
@@ -27,12 +27,19 @@ def get_sb(
|
||||
detail="SOCKS5 proxy with authentication is not supported. Check README for more info.",
|
||||
)
|
||||
|
||||
kwargs = {
|
||||
"uc": True,
|
||||
"headless": USE_HEADLESS,
|
||||
"xvfb": USE_XVFB,
|
||||
"locale_code": "en",
|
||||
"ad_block": True,
|
||||
"proxy": proxy,
|
||||
}
|
||||
|
||||
logger.info("Creating SeleniumBase instance with parameters: %s", kwargs)
|
||||
|
||||
with SB(
|
||||
uc=True,
|
||||
headless=USE_HEADLESS,
|
||||
locale_code="en",
|
||||
ad_block=True,
|
||||
proxy=proxy,
|
||||
**kwargs,
|
||||
) as sb:
|
||||
yield sb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user