-
Notifications
You must be signed in to change notification settings - Fork 26
Python API Guide
akwin1234 edited this page Jun 20, 2026
·
1 revision
This guide details how to build highly parallel, stealth browser automation programs using Damru's Python API.
The WorkerPool class automates launching, configuring, and reusing Redroid containers.
from damru.pool import WorkerPool
# Launch a pool with 3 parallel workers
async with WorkerPool(capacity=3) as pool:
# Borrow a worker with specific requirements
async with pool.borrow_worker(gpu_brand="mali") as worker:
# Run automation tasks
passThe worker.stealth_session() method wraps Playwright's browser contexts, pre-configuring ADB, proxies, locales, and Chrome arguments.
async with worker.stealth_session(
proxy={"server": "http://12.34.56.78:8080", "username": "user", "password": "pwd"},
locale="en-US",
timezone="America/New_York",
webrtc_spoof=True
) as context:
page = await context.new_page()
await page.goto("https://browserleaks.com/webrtc")You can change device fingerprints on a warm worker without recreating the container:
# Apply a premium Galaxy S23 profile on-the-fly
await worker.apply_profile("galaxy-s23")
# Open a new clean context
async with worker.stealth_session() as context:
page = await context.new_page()
await page.goto("https://whoer.net")