Skip to main content

wulu-geetest-bypass

GitHub Actions Workflow Status Python License Geetest v4 downloads

纯 Python 实现的极验行为验证 v4 自动化通过库(无需 Node.js)。自动处理 ai / slide / match / winlinze / svg_seed / svg_icon / voice 七种风险类型,支持自定义重试、代理和 HTTP 客户端。

安装

推荐使用 uv(更快、更现代的 Python 包管理器):

uv add "wulu-geetest-bypass[all]"

也可用 pip

pip install "wulu-geetest-bypass[all]"

可选依赖:

# voice 语音验证
uv add "wulu-geetest-bypass[voice]"

# slide 滑块(需要 opencv)
uv add "wulu-geetest-bypass[slide]"

# svg SVG 图标选择 + slide
uv add "wulu-geetest-bypass[svg]"

# 全部安装
uv add "wulu-geetest-bypass[all]"

快速开始

import asyncio
from wulu_geetest_bypass import Geetest


async def main():
    g = Geetest(captcha_id='your_captcha_id', risk_type='slide')
    result = await g.resolve()
    print(result)
    # {
    #     "captcha_id": "xxx",
    #     "lot_number": "xxx",
    #     "pass_token": "xxx",
    #     "gen_time": "xxx",
    #     "captcha_output": "xxx"
    # }


asyncio.run(main())

每次验证会自动重试最多 3 次(可通过 retry 参数调整),失败时抛出 VerifyError

风险类型

类型 说明 依赖 支持
ai 无感验证
slide 滑块拼图 [slide]
match 3×3 连线 & 9宫格
winlinze 五子棋
svg_seed SVG 图片选择 [svg]
svg_icon SVG 图标选择 [svg]
voice 语音验证 [voice]
icon 图标点选
word 文字点选
nine 九宫格
phrase 短语识别
pencil 涂鸦
space 空间推理

API

Geetest(**options)

参数 类型 说明
captcha_id str 验证 ID(必填)
risk_type RiskType 风险类型,默认 'ai'
client_type ClientType 客户端类型,'web' / 'web_mobile' / 'android' / 'ios'
lang Lang 语言,'zho' / 'eng' / 'fra' / 'deu' 等 13 种
challenge str 自定义 challenge(不传则自动生成)
user_info Any 附加用户信息(预留)
voice bool 启用无障碍语音验证(需要 [voice] 依赖)
client_options wreq.ClientConfig HTTP 客户端配置(代理、headers、模拟等)
client wreq.Client | None 自定义 HTTP 客户端(优先级高于 client_options

方法

load() -> dict

获取验证初始化数据,返回值包含 captcha_typelot_numberpayloadprocess_tokenpow_detail 等字段,可直接传入 verify()

verify(data) -> VerifyResponse

提交验证并返回完整响应:

class VerifyResponse:
    status: str  # "success" / "fail" / "error"
    data: VerifyData  # 验证结果数据


class VerifyData:
    lot_number: str
    result: str  # "success" / "fail"
    fail_count: int
    seccode: Seccode
    score: str
    payload: str
    process_token: str
    payload_protocol: int

resolve(retry=3) -> Seccode

一键完成 load() + verify(),验证失败时自动重试,返回 Seccode

class Seccode:
    captcha_id: str
    lot_number: str
    pass_token: str
    gen_time: str
    captcha_output: str
参数 类型 说明
retry int 失败重试次数,默认 3

注册自定义 Solver

对于未内置支持的风险类型,可通过 register_solver 注入自定义求解器:

from wulu_geetest_bypass import Geetest


def solve_icon(imgs: bytes, ques: list[bytes]) -> list[list[int]]: ...


Geetest.register_solver('icon', solve_icon)

注册后 generate_w() 会自动调用,传入对应的 payload 字段:

类型 Solver 签名
icon / word / phrase (imgs: bytes, ques: list[bytes]) -> list[list[int]]
nine (imgs: bytes, ques: list[bytes], nine_nums: int) -> list[list[int]]
pencil (imgs: bytes) -> list
space 同 SVG,由内置 solver 兜底

内置 solver 也可被覆盖:

Geetest.register_solver('slide', my_custom_slide_solver)

异常

异常 说明
GeetestError 所有自定义异常的基类
VerifyError 验证失败(所有重试均未通过)

免责声明

本项目仅供学习和研究使用。使用者应遵守相关法律法规及平台服务条款, 禁止用于任何非法用途。作者不对因使用本项目产生的任何法律问题承担责任。

Download files

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

Source Distribution

wulu_geetest_bypass-0.2.0.tar.gz (111.8 kB view details)

Uploaded Source

Built Distribution

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

wulu_geetest_bypass-0.2.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file wulu_geetest_bypass-0.2.0.tar.gz.

File metadata

  • Download URL: wulu_geetest_bypass-0.2.0.tar.gz
  • Upload date:
  • Size: 111.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wulu_geetest_bypass-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ef37d5517c4af9e0bef268f9647574c5169e597f4e6aaa49d0e33e1a2c67d054
MD5 3d5b66643274b55c9e1b4633fe2793a5
BLAKE2b-256 d303035ce386c3664be61c4c2a28a9c79561b6173cf95e42e2221a01a69b981c

See more details on using hashes here.

File details

Details for the file wulu_geetest_bypass-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: wulu_geetest_bypass-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wulu_geetest_bypass-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d51a2d4bbc8e41276ff25c224cc5f4d4deb1234382df49480716647c86ca976
MD5 f883659d2a39a20fcfe67bf78a4542d5
BLAKE2b-256 4b730273ba578c3b71fa9ec6099165698d9c3aaeb2b834e3be4e3eb953bd0747

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.4

2 files

0.1.3

2 files

0.1.1

2 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