Warning
Solver used is outdated! Please switch to a HCaptcha solver and adjust the code as required!
A Poketwo captcha verifier aided with a Next.js Dashboard and a Discord bot. Integrated API key system with SellAuth integration.
Requirements: Node 20+, Yarn, MongoDB
- Install dependencies:
yarn install- Set environment variables (or use defaults in
lib/mongodb.ts):
| Variable | Purpose |
|---|---|
MONGODB_URI |
MongoDB connection |
MONGODB_DB |
Database name |
-
Configure credentials in
lib/solver.config.ts(see below). -
Build and run:
yarn build
node runner.jsrunner.js starts the Discord bot and the Next.js server (next start). For local development, use yarn dev instead (bot must be started separately if needed).
Docker: docker build -t solver . then run with env vars set. Production deploys via GitHub Actions → GHCR → CapRover (see .github/workflows/deploy.yml).
All external service credentials live here:
nextCaptcha— reCAPTCHA solving (NextCaptcha)scrapey— browser/cookie generation (Scrappey)proxy— HTTP proxy used for verify.poketwo.net requestsbotToken— Discord bot for/stats,/redeem, etc.webhook— Discord webhook for solve notifications
Update these before running in a new environment.
The solve pipeline lives in lib/solver.ts in the P2Solver class:
- Cookie —
genCookie()uses Scrappey to fetch a session cookie from the captcha page. Cookies are cached in MongoDB (cookiescollection). - reCAPTCHA —
getRecaptchaToken()/genRecaptcha()submit to NextCaptcha using the sitekey and verify URL. - Submit & authorize —
rawSolve()posts the captcha response; the Discord selfbot logs in and completes OAuth viaauthorizeURL+exchangeIDs().
Common customization points:
| What to change | Where |
|---|---|
| reCAPTCHA sitekey / target URL | getRecaptchaToken(), genRecaptcha() in lib/solver.ts |
| Default user-agent | P2Solver.userAgent constructor default |
| Cookie generation URL | genCookie() Scrappey request URL |
| HTTP headers / endpoints | checkCookie(), rawSolve(), exchangeIDs() |
| Solve notifications | captchaLog() webhook URL in lib/solver.ts |
| API rate limits / validation | pages/api/solve.ts |
| Subscription keys | lib/security.ts (hash list) + MongoDB subscriptions collection |
To test the solver in isolation, uncomment the IIFE at the bottom of lib/solver.ts and provide a token/uid.
| Endpoint | Method | Description |
|---|---|---|
/api/solve |
POST | { token, key, id } — start a solve |
/api/check/[id] |
GET | Poll solve status for a user |
/api/stats |
GET | Aggregate solve statistics |
/api/health |
GET | Captcha service balances |
lib/solver.ts — core P2Solver + Database
lib/solver.config.ts — credentials & proxy
lib/security.ts — subscription key validation
bot.ts — Discord bot (slash commands)
runner.ts — starts bot + Next.js
pages/api/ — HTTP API routes
pages/index.tsx — stats landing page