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 连线
winlinze 五子棋
svg_seed SVG 3x3 图片选择 [svg]
svg_icon SVG 2x2 图标选择 [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)

无障碍模式

极验 v4 的部分站点在服务端开启了语音验证通道(无障碍模式)。当站点支持时,无论原始风险类型是什么,都可以通过 voice=True 强制切换到语音验证,从而绕过原本的滑块、点选等行为验证。

# 原本是滑块验证,但站点支持无障碍模式
g = Geetest(captcha_id='your_captcha_id', risk_type='slide', voice=True)
result = await g.resolve()

切换后流程变为:加载语音验证码 → 下载音频 → 离线识别数字 → 提交验证。全程无需浏览器环境,不需处理图片识别。

注意:并非所有站点都开启了无障碍通道。如果站点不支持,load() 返回的 show_voice 字段为 false,此时设置 voice=True 不会生效,仍按原 risk_type 处理。

异常

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

支持与更新

  • 本项目会持续跟踪极验 v4 的行为验证变化,及时更新绕过逻辑与 solver。
  • 遇到问题欢迎提交 Issue,也欢迎通过 PR 贡献代码。
  • 如果本项目对你有所帮助,欢迎点个 ⭐ Star 鼓励作者持续更新。

免责声明

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

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.1.tar.gz (113.5 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.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wulu_geetest_bypass-0.2.1.tar.gz
  • Upload date:
  • Size: 113.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.1.tar.gz
Algorithm Hash digest
SHA256 8dcc1d395780945f95578ef501cd11dc4e1f72aefdef9740414f6e917b655ee0
MD5 89149605114351d34fc5857aa5ba2fa5
BLAKE2b-256 c006663e99c86bf16dceaa9e914eb6650a45011712cc1fbf018a6a8df2545f39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wulu_geetest_bypass-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5e3c6238c5008755120c84147c1c6bde8cc566f098f7d3f7990c3a7bfadb32d
MD5 fe77ecbad69c4cc3ab4dc7ce1aaa1d13
BLAKE2b-256 a9cc14ac21296078da6d5fdbfd59ae2771482565d8b4ed3cb63d444e7d3a7e7f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

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