Skip to content

AmethystDev-Labs/SentinelWebSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SentinelWebSolver

FastAPI server that extracts OpenAI Sentinel tokens using Camoufox (anti-detection Firefox browser).

How It Works

  1. On startup, launches a Context Pool of N Camoufox browser instances, each with a unique randomized fingerprint (OS, user-agent, canvas, WebGL, etc.)
  2. Pre-warms pages by navigating to the target URL in advance — when a request arrives, the page is already loaded and ready (~0.8s latency)
  3. Resource blocking — images, fonts, media, and analytics requests are aborted to reduce per-page memory (~760 MB idle with 1 browser, down from 2.2 GB without blocking)
  4. After serving a request, the pool immediately starts warming a replacement page in the background
  5. Round-robin browser rotation ensures consecutive requests produce unique Sentinel tokens

Requirements

  • Python 3.11+
  • uv

Setup

# Install dependencies
uv sync

# Download Camoufox browser binary
uv run python -m camoufox fetch

Usage

uv run python main.py

Environment Variables

Variable Default Description
HOST 0.0.0.0 Server bind address
PORT 8000 Server bind port
POOL_SIZE 1 Number of browser instances in pool
HEADLESS true Run browsers in headless mode
MAX_CONCURRENCY 5 Max concurrent token extractions
NAVIGATION_TIMEOUT 30000 Page navigation timeout (ms)
TOKEN_TIMEOUT 30000 SentinelSDK.token() timeout (ms)
PAGE_WAIT 2000 Wait after page load before injection (ms)

Example:

PORT=9000 POOL_SIZE=5 uv run python main.py

API

GET /token

Query Param Default Description
timeout TOKEN_TIMEOUT env value Override token timeout for this request (ms, 1000-120000)

Response (200):

{
  "p": "...",
  "t": "...",
  "c": "...",
  "id": "uuid"
}
Status Description
200 Token extracted successfully
502 Browser error
504 Timeout

API docs available at /docs.

License

AGPL-3.0

About

A based-web OpenAI Sentinel Solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages