Skip to main content

GeeTest v4 ICON CAPTCHA solver using YOLO + template matching

Project description

GeeTest Solver

Python library for solving GeeTest v4 captchas (ICON and MATCH/IconCrush types).

Installation

pip install geetest-solver

Usage

Synchronous

from geetest_solver import solve_captcha

# Icon captcha (default)
seccode = solve_captcha(captcha_id="<CAPTCHA_ID>", captcha_type="icon")

# Match/IconCrush captcha
seccode = solve_captcha(captcha_id="<CAPTCHA_ID>", captcha_type="match")

# With proxy
proxies = {
    'http': 'http://user:pass@proxy.example.com:8080',
    'https': 'http://user:pass@proxy.example.com:8080'
}
seccode = solve_captcha(
    captcha_id="<CAPTCHA_ID>", 
    captcha_type="icon",
    proxies=proxies
)

Async (FastAPI, aiohttp, etc.)

from geetest_solver.async_wrapper import solve_captcha_async

# Icon captcha
seccode = await solve_captcha_async(captcha_id="<CAPTCHA_ID>", captcha_type="icon")

# Match captcha
seccode = await solve_captcha_async(captcha_id="<CAPTCHA_ID>", captcha_type="match")

# With proxy
proxies = {
    'http': 'http://user:pass@proxy.example.com:8080',
    'https': 'http://user:pass@proxy.example.com:8080'
}
seccode = await solve_captcha_async(
    captcha_id="<CAPTCHA_ID>",
    captcha_type="icon",
    proxies=proxies
)

FastAPI Example

from fastapi import FastAPI
from geetest_solver.async_wrapper import solve_captcha_async

app = FastAPI()

@app.post("/solve")
async def solve_captcha_endpoint(captcha_id: str):
    result = await solve_captcha_async(captcha_id=captcha_id)
    return {"seccode": result}

Model Reuse (for multiple solves)

from geetest_solver.solver import get_model, solve_captcha

# Load model once
model = get_model()

# Solve 100 captchas with same model (saves CPU/memory)
for i in range(100):
    result = solve_captcha(
        captcha_id="<CAPTCHA_ID>",
        model=model  # Reuse model
    )

Async with Model Reuse

from geetest_solver.solver import get_model
from geetest_solver.async_wrapper import solve_captcha_async

# Load model once
model = get_model()

# Solve multiple captchas
for i in range(100):
    result = await solve_captcha_async(
        captcha_id="<CAPTCHA_ID>",
        model=model
    )

Features

  • Icon captcha: YOLO-based object detection + template matching
  • Match captcha: Grid-based puzzle solver (swap to match 3)
  • Async support: Non-blocking execution for FastAPI/async frameworks
  • Thread-safe: No matplotlib global lock issues
  • Automatic retry on failure
  • Proxy support
  • High success rate

Captcha Types

  • icon: Click icons in sequence (uses YOLO model)
  • match: Swap grid items to match 3 in a row (IconCrush)

Configuration

Model Management

The YOLO model is cached in memory after first load. To manually free memory:

from geetest_solver.solver import get_model, unload_model

# Load model
model = get_model()

# Use model for solving...

# Free memory when done
unload_model()

Note: In FastAPI/long-running servers, the model stays loaded for the entire process lifetime (recommended for performance).

Disable Matplotlib (default)

Matplotlib is disabled by default to avoid global lock issues in multi-threaded environments. To enable for debugging:

export ENABLE_MATPLOTLIB=1

Disable YOLO Verbose Output

import os
os.environ['YOLO_VERBOSE'] = 'False'

Requirements

  • Python 3.8+
  • CUDA (optional, for GPU acceleration)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geetest_solver-1.0.9.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geetest_solver-1.0.9-py3-none-any.whl (13.3 MB view details)

Uploaded Python 3

File details

Details for the file geetest_solver-1.0.9.tar.gz.

File metadata

  • Download URL: geetest_solver-1.0.9.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for geetest_solver-1.0.9.tar.gz
Algorithm Hash digest
SHA256 f63f3271a54a43823be240330791071ec7addcc5ac8859d18f8a5ad2176ec892
MD5 cdfdf1b862e61ad774eae4ed009e6143
BLAKE2b-256 dcc1c5ad7aa28dd88df4e0409624f99c58c9a5b5b9744bc58fe30a994de929c6

See more details on using hashes here.

File details

Details for the file geetest_solver-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: geetest_solver-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for geetest_solver-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 72db5e87356df7c6936706661eb9632d5d50f80fe54945afbee5e2a39ae52168
MD5 cc37fc43fd3712b5385a1af4ffd7ff08
BLAKE2b-256 4eae922d432108f405281b8934579306c7ac3eaa02f20a9ac49b03bf0f7adacb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page