How xkiian/geekedtest works
Purpose and Entry Points
This is an unofficial Python solver for GeeTest v4 CAPTCHA flows, supporting slide, gobang, icon, and ai risk types. The public library entry point is Geeked, imported from geeked/__init__.py and implemented in geeked/geeked.py. main.py is a runnable example/application entry point. geeked/dddd_server.py appears to expose an alternate service-oriented execution mode.
Solver Orchestration
geeked/geeked.py coordinates the end-to-end CAPTCHA protocol: initialize from a caller-supplied captcha_id and risk type, obtain challenge data, select a risk-specific solver, and return the GeeTest verification fields (lot_number, pass_token, gen_time, captcha_output). It is the boundary between consumers and GeeTest’s remote challenge/verification APIs.
CAPTCHA-Type Solvers
Risk-specific image interpretation and answer generation are separated by challenge type:
• Slider gap/location solving: geeked/slide.py
• Gobang-style visual puzzle solving: geeked/gobang.py
• Icon-selection/recognition solving: geeked/icon.py
This division lets the orchestrator dispatch based on risk_type while keeping image/puzzle logic isolated from signing and transport behavior.
AI/Model Assets
The icon/AI path is backed by a packaged ONNX model and charset metadata:
• geeked/models/geetest_v4_icon.onnx
• geeked/models/charsets.json
• geeked/icon.py
The model asset is a material runtime dependency for local inference rather than a remotely hosted recognition service. Python dependencies are defined in requirements.txt.
Protocol Signing and Browser Emulation
geeked/sign.py implements client-side request construction/signing, including mutable reverse-engineered constants noted by the README. It forms a critical compatibility boundary with GeeTest protocol changes: stale mappings, obfuscation constants, or device identifiers can invalidate otherwise correct puzzle answers.
deobfuscate.py supports recovering or updating those protocol constants when GeeTest client code changes.
Reverse-Engineered JavaScript Reference
The reverse/ directory contains JavaScript implementations or extracted logic used to understand/reproduce browser-side GeeTest behavior:
• reverse/encrypt.js
• reverse/decode.js
• reverse/pow.js
These files represent the cryptographic/encoding and proof-of-work compatibility layer that informs Python signing behavior, rather than the primary consumer-facing API.
External Boundaries
The package depends on GeeTest v4 endpoints for challenge acquisition and final verification; callers must provide a valid captcha_id and chosen risk type. It runs primarily as Python, with optional/auxiliary JavaScript reverse-engineering artifacts and local ONNX inference. No persistent datastore, web frontend, or deployment infrastructure is represented in the repository.
Main entry points: geeked.py Geeked orchestrator · icon.py Icon solver · sign.py Protocol signing · __init__.py Geeked export
Components 15
Python solver
Public API, protocol flow, and puzzle solvers.
- Example entry point
main.py - Alternate service mode
geeked/dddd_server.py - Geeked export
geeked/__init__.py - Geeked orchestrator · Coordinates challenge, solver dispatch, and verification fields.
geeked/geeked.py - Protocol signing · Builds browser-like signed requests using mutable constants.
geeked/sign.py - Slider solver
geeked/slide.py - Gobang solver
geeked/gobang.py - Icon solver
geeked/icon.py
Local inference
Packaged assets used for icon recognition.
- Icon ONNX model · Local recognition model.
geeked/models/geetest_v4_icon.onnx - Charset metadata
geeked/models/charsets.json
Protocol research
Reverse-engineered references and constant recovery tools.
- Constant recovery · Updates reverse-engineered protocol constants.
deobfuscate.py - JavaScript protocol references · Encoding, encryption, and proof-of-work behavior.
reverse/encrypt.js
Other components
- Library caller · Supplies captcha_id and risk type.
- GeeTest v4 APIs · Provides challenges and accepts verification.
- Python dependencies · Defines runtime packages including inference dependencies.
requirements.txt
Connections 19
- Library caller → Geeked export: imports
- Example entry point → Geeked orchestrator: runs
- Alternate service mode → Geeked orchestrator: uses
- Geeked export → Geeked orchestrator: exports
- Geeked orchestrator → Protocol signing: constructs requests
- Protocol signing → GeeTest v4 APIs: signed protocol calls
- GeeTest v4 APIs → Geeked orchestrator: challenge data
- Geeked orchestrator → Slider solver: dispatches slide
- Geeked orchestrator → Gobang solver: dispatches gobang
- Geeked orchestrator → Icon solver: dispatches icon / AI
- Slider solver → Geeked orchestrator: answer
- Gobang solver → Geeked orchestrator: answer
- Icon solver → Geeked orchestrator: answer
- Icon solver → Icon ONNX model: loads
- Icon solver → Charset metadata: uses
- Geeked orchestrator → GeeTest v4 APIs: submits verification
- JavaScript protocol references → Protocol signing: informs protocol behavior
- Constant recovery → Protocol signing: updates constants
- Python dependencies → Icon solver: provides inference runtime