Skip to content

Repository files navigation

Poketwo Captcha Solver

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.

Setup

Requirements: Node 20+, Yarn, MongoDB

  1. Install dependencies:
yarn install
  1. Set environment variables (or use defaults in lib/mongodb.ts):
Variable Purpose
MONGODB_URI MongoDB connection
MONGODB_DB Database name
  1. Configure credentials in lib/solver.config.ts (see below).

  2. Build and run:

yarn build
node runner.js

runner.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).

Configuration (lib/solver.config.ts)

All external service credentials live here:

  • nextCaptcha — reCAPTCHA solving (NextCaptcha)
  • scrapey — browser/cookie generation (Scrappey)
  • proxy — HTTP proxy used for verify.poketwo.net requests
  • botToken — Discord bot for /stats, /redeem, etc.
  • webhook — Discord webhook for solve notifications

Update these before running in a new environment.

Changing core solver behavior

The solve pipeline lives in lib/solver.ts in the P2Solver class:

  1. Cookie — genCookie() uses Scrappey to fetch a session cookie from the captcha page. Cookies are cached in MongoDB (cookies collection).
  2. reCAPTCHA — getRecaptchaToken() / genRecaptcha() submit to NextCaptcha using the sitekey and verify URL.
  3. Submit & authorize — rawSolve() posts the captcha response; the Discord selfbot logs in and completes OAuth via authorizeURL + 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.

API

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

Project layout

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

About

A Poketwo captcha verifier aided integrated API key system to host it as your own service!

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages