Skip to main content

Captcha AI Solver

Python library that solves reCAPTCHA v2 by replicating the challenge locally and using Wit.ai for audio transcription. Windows-only, requires admin privileges.

Features

  • Replicates reCAPTCHA v2 by spoofing domains in hosts file
  • Solves standard reCAPTCHA v2
  • Uses Wit.ai API for audio challenge transcription
  • Returns solution tokens for form submission

Installation

pip install captcha-ai-solver

Important Note

Windows Only - Requires Admin privileges (modifies hosts file when it needs to replicate the captcha environment and spoof the original website domain).

This library inputs captcha parameters and outputs solution tokens. For extracting parameters or applying tokens, see: this guide

Quick Start

from captcha_solver import solve_captcha

# Define captcha parameters
captcha_params = {
    "website_url": "https://www.google.com/recaptcha/api2/demo",
    "website_key": "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-"
}

# solver configuration
solver_config = {
    "wit_api_key": "YOUR_WIT_API_KEY",  # NEEDED for recaptcha audio challenges
}

# Solve the captcha
result = solve_captcha(
    captcha_type="recaptcha_v2",
    captcha_params=captcha_params,
    solver_config=solver_config
)

if result["success"]:
    print(f"Captcha solved! Token: {result['token'][:30]}...")
    # Use the token in your application
else:
    print(f"Failed to solve captcha: {result['error']}")

Detailed Usage

Supported Captcha Types

Currently, the library supports:

  • RecaptchaV2: Standard reCAPTCHA v2

Captcha Parameters

For RecaptchaV2:

Parameter Type Required Description
website_url string Yes URL of the website with the captcha
website_key string Yes reCAPTCHA site key

Solver Configuration

Option Type Description
wit_api_key string API key for Wit.ai speech recognition (required for audio challenges)
download_dir string Directory for temporary files (default: "tmp")

Return Value

The solve_captcha function returns a result object with the following properties:

Property Type Description
success boolean Whether the solving was successful
token string or null The solved captcha token if successful, null otherwise
error string or null Error message if unsuccessful, null otherwise

Example Script

The library includes an example script that demonstrates how to use it:

python example.py --website "https://example.com" --key "your-recaptcha-key"

How It Works

The library uses a combination of browser automation and AI-powered audio transcription to solve reCAPTCHA challenges:

  1. It replicates the reCAPTCHA challenge in a controlled environment
  2. For audio challenges, it uses AI to transcribe the audio
  3. It submits the answer and retrieves the verification token
  4. The token can then be used to bypass the captcha on the target website

Requirements

  • Python 3.7+
  • SeleniumBase
  • Requests
  • Python-dotenv
  • Wit.ai API key (for audio challenges)

Disclaimer

This library is intended for legitimate testing, development, and automation purposes only. Please use responsibly and in accordance with the target website's terms of service.

Development Setup

If you want to contribute or modify the library, follow these steps to set up a development environment:

  1. Clone the repository:
git clone https://github.com/njraladdin/captcha-ai-solver.git
cd captcha-ai-solver
  1. Create and activate a virtual environment:

On Windows:

python -m venv venv
venv\Scripts\activate

On macOS/Linux:

python -m venv venv
source venv/bin/activate
  1. Install the dependencies in development mode:
python -m pip install -e .
  1. Install development dependencies (optional):
pip install -e ".[dev]"
  1. Create a .env file with your WIT.ai API key for audio challenges:
WIT_API_KEY=your_key_here

Metadata

Release files for captcha-ai-solver 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for captcha-ai-solver 0.2.0
File Size Uploaded
captcha_ai_solver-0.2.0.tar.gz 35.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for captcha-ai-solver 0.2.0
File Interpreter ABI Platform
captcha_ai_solver-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.1 kB

Release files / captcha_ai_solver-0.2.0.tar.gz

Download URL captcha_ai_solver-0.2.0.tar.gz
Size 35.3 kB
Tags Source
SHA-256 checksum
How to use checksums
664c88abfee02bd34bd5262313c781160be82b776db48dea62ef341119178942
BLAKE2b-256 checksum
How to use checksums
d9ede27e67d9838b25bdc7883e320ba6b3a7d2135c22fd4e5ad9e4ea20eaf468
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Release files / captcha_ai_solver-0.2.0-py3-none-any.whl

Download URL captcha_ai_solver-0.2.0-py3-none-any.whl
Size 37.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68b8362b39b05f42848f826f452002cd818bf45a6df4756223f19a0bd5766617
BLAKE2b-256 checksum
How to use checksums
b462fcc2d88b5a3dd9265c72a1e72ea400232f218e5f328014efcf76bc92bfec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page