healthjoy /
async-firebase
The lightweight asynchronous client that makes interaction with Firebase Cloud Messaging oversimplified.
74/100 healthLoading repository data…
omegastrux / repository
A lightweight, asynchronous extension for nodriver and zendriver that detects and verifies Cloudflare Turnstile challenges.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A low-level, asynchronous Python extension designed to unify Cloudflare Turnstile challenge verification across both nodriver and zendriver runtimes.
The library is split into decoupled sub-components handling driver abstractions, execution logging, target analysis, and DOM interaction.
CFLibUtil)Due to type handling discrepancies and known upstream compilation faults (such as missing encoding declarations in nodriver.network), the library uses a fallback utility class. It dynamically imports available drivers at runtime, handles syntax exceptions, and binds Browser, Tab, and Element instances into global type unions.
CFUtil, CFLogger)To support concurrent multi-tab processing, each verification routine generates a contextual instance_id. This identifier tracks tasks using mutated slices of the unique Chrome DevTools Protocol (CDP) target_id combined with sanitized domain string extractions.
CFHelper)Standard framework node lookups (like find_all) suffer from high latency when executing inside complex single-page applications. This extension bypasses framework overhead by evaluating raw asynchronous JavaScript operations directly inside the runtime to map loaded script sources and instantly read volatile input states:
// Used for challenge discovery
[...document.querySelectorAll('script[src]')].map(script => script.src)
// Used for deterministic verification
[...document.querySelectorAll('input#cf-chl-widget-{unique_id}_response')].filter(element => element.value !== '').length == 1;
The native upstream nodriver implementation includes a built-in tab.cf_verify() routing. However, that mechanism relies on visual template matching powered by the opencv-python package to locate challenge coordinates on screen. This dependency introduces significant CPU overhead and forces the inclusion of heavy native binary compilation layers, which inflates deployment footprints inside minimal container runtimes.
This extension mitigates that overhead completely by operating strictly within the logical layer of the DOM. By substituting computer vision analysis with deterministic state checks and automated CDP coordinate lookups, the execution loop remains lightweight and eliminates the need for any image-processing binaries.
Selected from shared topics, language and repository description—not editorial ratings.
healthjoy /
The lightweight asynchronous client that makes interaction with Firebase Cloud Messaging oversimplified.
74/100 healthNya-Foundation /
🎨 A lightweight async Python API for NovelAI image generation and director tools.
81/100 healthCLICK_LOCK)To support parallel processing across multiple tabs or browser instances without race conditions, the engine utilizes a module-level asyncio.Lock() (CLICK_LOCK). All tabs can evaluate Cloudflare states concurrently in the background. The lock is acquired only for a fraction of a second when a tab needs to call tab.activate() and trigger the CDP mouse_click() event, guaranteeing that mouse interactions are sent to an active viewport without conflicting between parallel routines.
timeout=1), and executes deterministic token validation via DOM-isolated JavaScript queries.CLICK_LOCK), and explicit coordinate-based cursor emulation (mouse_click).pip install git+https://github.com/omegastrux/nodriver-cf-verify.git
When running multiple tabs concurrently or processing background verification tasks, Chromium may throttle JavaScript timers or suspend background tab rendering. Passing the following startup flags ensures maximum verification speed and eliminates coordinate resolution failures on background tabs:
RECOMMENDED_BROWSER_ARGS = [
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-component-update"
]
import nodriver
import asyncio
import time
from nodriver_cf_verify import CFVerify
async def main() -> None:
# Initialize the core browser context with performance args
browser: nodriver.Browser = await nodriver.start(
browser_args=[
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-component-update"
]
)
browser_tab: nodriver.Tab = await browser.get("https://nowsecure.nl")
start: float = time.perf_counter()
# Pass the active tab reference and execute verification sequence
cf_verify: CFVerify = CFVerify(_browser_tab=browser_tab, _debug=True)
success: bool = await cf_verify.verify(
_max_retries=15,
_interval_between_retries=1,
_reload_page_after_n_retries=5
)
duration: float = (time.perf_counter() - start)
if not success:
print(f"Verification failure. State unresolved after {duration:.2f} seconds")
return
print(f"Verification successful. Complete in {duration:.2f} seconds")
await browser.stop()
if __name__ == "__main__":
nodriver.loop().run_until_complete(main())
import zendriver
import asyncio
import time
from nodriver_cf_verify import CFVerify
async def main() -> None:
browser: zendriver.Browser = await zendriver.start(
browser_args=[
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-component-update"
]
)
browser_tab: zendriver.Tab = await browser.get("https://nowsecure.nl")
start: float = time.perf_counter()
cf_verify: CFVerify = CFVerify(_browser_tab=browser_tab, _debug=True)
success: bool = await cf_verify.verify(
_max_retries=15,
_interval_between_retries=1,
_reload_page_after_n_retries=0
)
duration: float = (time.perf_counter() - start)
if not success:
print(f"Verification failure. State unresolved after {duration:.2f} seconds")
return
print(f"Verification successful. Complete in {duration:.2f} seconds")
await browser.stop()
if __name__ == "__main__":
asyncio.run(main())
asyncio.gather)import zendriver
import asyncio
import time
from nodriver_cf_verify import CFVerify
async def verify_tab(tab: zendriver.Tab, tab_idx: int) -> bool:
print(f"[Tab {tab_idx}] Starting verification...")
return await CFVerify(tab, _debug=True).verify(
_max_retries=10,
_interval_between_retries=1
)
async def main() -> None:
urls = [
"https://nowsecure.nl",
"https://nowsecure.nl",
"https://nowsecure.nl",
"https://nowsecure.nl"
]
browser: zendriver.Browser = await zendriver.start(
browser_args=[
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-component-update"
]
)
tabs = []
for url in urls:
tabs.append(await browser.get(url, new_tab=True))
start = time.perf_counter()
# Execute parallel verification across all tabs
tasks = [verify_tab(tab, idx + 1) for idx, tab in enumerate(tabs)]
results = await asyncio.gather(*tasks)
duration = time.perf_counter() - start
success_count = sum(1 for res in results if res is True)
print(f"Verified {success_count}/{len(urls)} tabs in {duration:.2f} seconds")
await browser.stop()
if __name__ == "__main__":
asyncio.run(main())
The repository provides an automated deployment architecture via a Dockerfile based on the official python:3.12-slim image. To minimize the container footprint while bypassing native headless anti-bot flags, the image provisions system dependencies strictly with standard Debian chromium and Xvfb (X Virtual Framebuffer).
Headless environments or privacy-focused browsers using dynamic canvas noise (like Brave's Farbling) can cause Cloudflare Turnstile scripts to stall on initial loading checks. To resolve this inside headless server environments, the container executes standard Chromium in non-headless mode (headless=False) rendered inside an isolated Xvfb virtual display memory layer.
The following minimal script demonstrates how to initialize zendriver inside the containerized Xvfb environment:
import zendriver
import asyncio
import time
from nodriver_cf_verify import CFVerify
async def main() -> None:
# Explicitly bind to the containerized Chromium binary path inside Xvfb
browser: zendriver.Browser = await zendriver.start(
browser_executable_path="/usr/bin/chromium",
headless=False,
browser_args=[
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-component-update"
]
)
browser_tab: zendriver.Tab = await browser.get("https://nowsecure.nl")
start: float = time.perf_counter()
cf_verify: CFVerify = CFVerify(_browser_tab=browser_tab, _debug=True)
success: bool = await cf_verify.verify(
_max_retries=15,
_interval_between_retries=1,
_reload_page_after_n_retries=0
)
duration: float = (time.perf_counter() - start)
if not success:
print(f"Failed to verify Cloudflare. Elapsed time: {duration:.2f} seconds")
await browser.stop()
return
print(f"Cloudflare was successfully verified in {duration:.2f} seconds")
await browser.stop()
if __name__ == "__main__":
asyncio.run(main())
Build the local container image using the present directory context:
docker build -t nodriver-cf-verify .
Run the container in interactive mode with host IPC memory sharing:
docker run -it --rm --ipc=host nodriver-cf-verify
Deploy the container to run persistently in a detached background state:
docker run -d --name cf-verify --ipc=host nodriver-cf-verify
The verify() method runs an iterative control loop processing the following execution steps:
CFHelper.is_cloudflare_presented. If no challenge signature is identified, execution returns early with a success code.CFHelper.is_cloudflare_verified via direct JS evaluation against the target element input#cf-chl-widget-{unique_id}_response. If the value attribute is non-empty, the challenge is marked as resolved and execution terminates with a true status.CLICK_LOCK to safely bring the tacicekhayri /
Inspira is a lightweight framework for building asynchronous web applications.
thearchitector /
A friendly and lightweight wrapper for arq.
68/100 healthAntonio-Gabriel /
Starlette is a lightweight ASGI framework/toolkit, which is ideal for building async web services in Python.
31/100 healthFastestMolasses /
A lightweight, flexible task execution library for easily creating multithreaded and asynchronous code
39/100 health