auto-captcha
Universal captcha solver for Playwright browser automation. Detects hCaptcha and reCAPTCHA v2, solves them via the NopeCHA API, and injects tokens — so your scripts never get stuck.
Your script → page loads → captcha detected → NopeCHA API → token injected → continue
Install
pip install auto-captcha-solver
python -m playwright install chromium
Quick Start
from auto_captcha_solver import smart_page
with smart_page(api_key="your-key") as page:
page.goto("https://protected-site.com")
page.fill("#email", "user@example.com")
page.click("#submit") # captcha auto-solved
Three Ways to Use
1. smart_page() — Context Manager (easiest)
from auto_captcha_solver import smart_page
with smart_page(api_key="your-key") as page:
page.goto("https://example.com")
page.fill("#email", "user@test.com")
page.click("#submit")
print(page.captcha_log) # [{'type': 'hcaptcha', 'status': 'solved'}]
2. SmartPage — Wrap Existing Browser
from auto_captcha_solver import SmartPage
from playwright.sync_api import sync_playwright
pw = sync_playwright().start()
browser = pw.chromium.launch(headless=True)
page = SmartPage(browser.new_page(), api_key="your-key")
page.goto("https://example.com")
page.fill("#input", "value")
3. CaptchaSolver — Full Control
from auto_captcha_solver import CaptchaSolver
solver = CaptchaSolver(api_key="your-key")
captchas = solver.detect(page) # [{'type': 'hcaptcha', 'sitekey': '...'}]
result = solver.solve("hcaptcha", sitekey, url) # CaptchaResult(success=True, token='...')
solver.inject(page, "hcaptcha", result.token)
results = solver.auto_solve(page) # detect + solve + inject
CLI
auto-captcha-solver credits --key YOUR_KEY # Check NopeCHA balance
auto-captcha-solver detect --url https://example.com # Detect captchas
auto-captcha-solver solve --url https://example.com # Solve captchas
MCP Server
Works with Claude Code, OpenClaw, Cursor, and any MCP-compatible agent.
claude mcp add auto-captcha -- python -m auto_captcha_solver.mcp_server
Or in your MCP config:
{
"mcpServers": {
"auto-captcha": {
"command": "python",
"args": ["-m", "auto_captcha_solver.mcp_server"],
"env": {"NOPECHA_API_KEY": "your-key"}
}
}
}
Tools provided:
captcha_detect— detect captchas on a URLcaptcha_solve— detect and solve all captchascaptcha_credits— check NopeCHA credit balance
Hermes Skill
Copy the hermes-skill/ directory to ~/.hermes/skills/auto-captcha-solver/ and set NOPECHA_API_KEY in your .env.
Supported Captcha Types
| Type | Detection | Speed | Reliability |
|---|---|---|---|
| hCaptcha (checkbox) | iframe + DOM | 10-40s | High |
| hCaptcha (enterprise) | iframe + DOM | 10-40s | High |
| reCAPTCHA v2 | iframe + DOM | 60-120s+ | Medium (queue) |
Coming soon: reCAPTCHA v3, Cloudflare Turnstile, FunCAPTCHA — track progress
Pitfalls
- reCAPTCHA queues are slow — can take 60-120+ seconds during peak
- Each solve costs 1 credit — check with
solver.get_credits() - Headless detection — some sites block headless; use
headless=False - Lazy-loaded captchas — add
time.sleep()after actions that might trigger them
Get an API Key
Get free credits at nopecha.com. Set as environment variable:
export NOPECHA_API_KEY="your-key"
License
MIT
Metadata
Release files for auto-captcha-solver 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| auto_captcha_solver-0.1.3.tar.gz | 13.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_captcha_solver-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.0 kB
Release files / auto_captcha_solver-0.1.3.tar.gz
| Download URL | auto_captcha_solver-0.1.3.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37477901b04cce425f541dc7c4f4ecd90a7bc9fbe82f1cbee3ba4abb99f443c8
|
|
BLAKE2b-256 checksum How to use checksums |
c135dc6d8a4459d805b4a681200d8297907ec9f3c85acd51fc5100c4d2089c5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / auto_captcha_solver-0.1.3-py3-none-any.whl
| Download URL | auto_captcha_solver-0.1.3-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a33befc690fb239b8dd81da2102107b1915caf0a7cd99bc6f16351a1bfd6a067
|
|
BLAKE2b-256 checksum How to use checksums |
c0c922325440dce001024524597f5d0a539a15866c91ed0a15b5e1969721b040
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for auto-captcha-solver 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.