Skip to main content

No project description provided

Project description

BiliTicker-gt-python

极验验证模块的python语言绑定

使用方式

  1. pip install bili_ticket_gt_python
  2. import bili_ticket_gt_python
  3. slide = bili_ticket_gt_python.SlidePy()
  4. click = bili_ticket_gt_python.ClickPy()
  5. 通过slide和click调用相关函数

绑定的函数见py.rs文件

demo

执行测试

import bili_ticket_gt_python
slide = bili_ticket_gt_python.SlidePy()
click = bili_ticket_gt_python.ClickPy()

try:
    #改为注册滑块challenge和gt的url
    validate = slide.test("http://127.0.0.1:5000/pc-geetest/register")
    print(validate)
except Exception as e:
    print("识别失败")
    print(e)

try:
    #改为注册点选challenge和gt的url
    validate = click.test("https://passport.bilibili.com/x/passport-login/captcha?source=main_web")
    print(validate)
except Exception as e:
    print("识别失败")
    print(e)

通过gt和challenge调用 仅支持点选验证码

import bili_ticket_gt_python
click = bili_ticket_gt_python.ClickPy()
try:
    (gt, challenge) = click.register_test("https://passport.bilibili.com/x/passport-login/captcha?source=main_web")
    validate = click.simple_match(gt, challenge)
    print(validate)
except Exception as e:
    print("识别失败")
    print(e)

通过gt和challenge调用(自动重试) 仅支持点选验证码

import bili_ticket_gt_python
click = bili_ticket_gt_python.ClickPy()

try:
    (gt, challenge) = click.register_test("https://passport.bilibili.com/x/passport-login/captcha?source=main_web")
    validate = click.simple_match_retry(gt, challenge)
    print(validate)
except Exception as e:
    #验证码失效有两种可能性
    # 1. 验证码生成过后过了太久,时间导致的失效
    # 2. 验证码重试次数过多,需要unset,unset接口请自己扒下来封装吧,我真的懒得封装了
    print("自动重试仍然有极小概率报错(超时时间即为验证码失效时间)")
    print(e)
#不要100%依赖于demo!!!动动脑子

分步调用

import bili_ticket_gt_python
slide = bili_ticket_gt_python.SlidePy()

try:
    (gt, challenge) = slide.register_test("http://127.0.0.1:5000/pc-geetest/register")
    (_, _) = slide.get_c_s(gt, challenge)
    _type = slide.get_type(gt, challenge)
    if _type != "slide":
        raise Exception("验证码类型错误")
    (c, s, args) = slide.get_new_c_s_args(gt, challenge)
    #注意滑块验证码这里要刷新challenge
    challenge = args[0]
    key = slide.calculate_key(args)
    #rt固定即可
    #此函数是使用项目目录下的slide.exe生成w参数,如果文件不存在会报错,你也可以自己接入生成w的逻辑函数
    w = slide.generate_w(key, gt, challenge, str(c), s, "abcdefghijklmnop")
    (msg, validate) = slide.verify(gt, challenge, w)
    print(validate)
except Exception as e:
    print("识别失败")
    print(e)
import bili_ticket_gt_python
import time
click = bili_ticket_gt_python.ClickPy()

try:
    (gt, challenge) = click.register_test("https://passport.bilibili.com/x/passport-login/captcha?source=main_web")
    (_, _) = click.get_c_s(gt, challenge)
    _type = click.get_type(gt, challenge)
    if _type != "click":
        raise Exception("验证码类型错误")
    (c, s, args) = click.get_new_c_s_args(gt, challenge)
    before_calculate_key = time.time()
    key = click.calculate_key(args)
    #rt固定即可
    #此函数是使用项目目录下的click.exe生成w参数,如果文件不存在会报错,你也可以自己接入生成w的逻辑函数
    w = click.generate_w(key, gt, challenge, str(c), s, "abcdefghijklmnop")
    #点选验证码生成w后需要等待2秒提交
    w_use_time = time.time() - before_calculate_key
    print("w生成时间:", w_use_time)
    if w_use_time < 2:
        time.sleep(2 - w_use_time)
    (msg, validate) = click.verify(gt, challenge, w)
    print(validate)
except Exception as e:
    print("识别失败")
    print(e)

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

bili_ticket_gt_python-0.2.5.tar.gz (261.7 kB view details)

Uploaded Source

Built Distributions

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

bili_ticket_gt_python-0.2.5-cp312-none-win_amd64.whl (85.5 MB view details)

Uploaded CPython 3.12Windows x86-64

bili_ticket_gt_python-0.2.5-cp312-cp312-manylinux_2_31_x86_64.whl (92.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_11_0_arm64.whl (86.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl (87.5 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

bili_ticket_gt_python-0.2.5-cp311-none-win_amd64.whl (85.5 MB view details)

Uploaded CPython 3.11Windows x86-64

bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_11_0_arm64.whl (86.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl (87.5 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

bili_ticket_gt_python-0.2.5-cp310-none-win_amd64.whl (85.5 MB view details)

Uploaded CPython 3.10Windows x86-64

bili_ticket_gt_python-0.2.5-cp310-cp310-macosx_11_0_arm64.whl (86.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bili_ticket_gt_python-0.2.5-cp39-none-win_amd64.whl (85.5 MB view details)

Uploaded CPython 3.9Windows x86-64

bili_ticket_gt_python-0.2.5-cp39-cp39-macosx_11_0_arm64.whl (86.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

bili_ticket_gt_python-0.2.5-cp38-none-win_amd64.whl (85.5 MB view details)

Uploaded CPython 3.8Windows x86-64

bili_ticket_gt_python-0.2.5-cp38-cp38-manylinux_2_31_x86_64.whl (92.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.31+ x86-64

File details

Details for the file bili_ticket_gt_python-0.2.5.tar.gz.

File metadata

  • Download URL: bili_ticket_gt_python-0.2.5.tar.gz
  • Upload date:
  • Size: 261.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.6.0

File hashes

Hashes for bili_ticket_gt_python-0.2.5.tar.gz
Algorithm Hash digest
SHA256 898728609e73973bccb4f2d9bfa96da2e9f1340fed909a27ed711e884a31f278
MD5 1e6b99c09e75ff260c00648a1ff02457
BLAKE2b-256 9c27020d8aad3c43c7beebda1b450c96e1a96775e2284b7a315f63cf425bc356

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 de947c72c1e2644f8a7cfb859cd6efc82b3f539536c5aec0a426c1f2dc743e3c
MD5 d44d6fe702e111f982803b1bc65147ab
BLAKE2b-256 25f2d2f547382d1c50af26d59c2d6313c0eb6b0e3bfea0e627156829a79d69b3

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ff872d64c85cff8b787c62620c24f3f2f128717846173f1bf1232a2ca2eaa0ca
MD5 7b1d5939eea7d1ae8b5c5e4bf1e98020
BLAKE2b-256 86058e617657e03447446094ea3abe66db0c07d299eb28291316fa004dac4c4f

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a14300d1edbe459e8e4263633a9bc9e896fc081a913a2188484f51d3f2ef7fd
MD5 db1cbc9bd4ec3c26f18f4918211f9627
BLAKE2b-256 80c01b36c5d52ebcb822b44f74662d2e1fb68e71171ad115b8b13d4129204238

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 55fd2095894f5844a98db40371d8f5fd85e2f49369f88422d6043042c222955b
MD5 e85371b135abceaadc5725ce5825b701
BLAKE2b-256 8a99c03e80c8701ef626195dbd9b2af6c95926fcd4926f20d07d5038df15ba9b

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 55c08d9305e59a19b22838804e81388e110053b71a99009736c4ad3cc97c2104
MD5 1554f4a12c5c38b622caddc2354da7a7
BLAKE2b-256 8d221a4af0322ab73748b13d0a28d8973c0961276de837c5fe5b83686c284257

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bd7cd6b9204e3047380d0a00a866e7b98ba1ebd3510ae3b15917f80b0fbd74b
MD5 e4b3db8544624e18e994696b1033cdbf
BLAKE2b-256 c0feded4b92201176fff1c4e0ac12dd8c1d3a1579bd082963e5d4531a202d89c

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6f657e812ea957c0ef8872b75c9c636afe61cb623b8c3fd81248cd293cb976d1
MD5 9a5da69743ce92b3e3a93632345b2ab2
BLAKE2b-256 9df7980b9d0cd302c51113d5b08b6a0da7674fe12de0e568841b27e2f06b0147

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 cc4aa1a614219dd0fd287938eb5de0e52158677a31e70076c5da54eb1b5345eb
MD5 66a34667020c80f66cc83078fcbc324a
BLAKE2b-256 417af8ccaa34f699e33bfbccb916a8d5492313cae69bdaeaa83c6a5d4a0e2766

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b9dd33fe79d2fd558b86507b75ebd8d1a14e540de10e96f3efd5d7900a6b29f
MD5 f5e6acca18b87a6dbebf3211e92c9431
BLAKE2b-256 bb5b8ae53ed655d0da6d74e19e14e464c4709a45b423c557399f53cd852c8689

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 5ac8a7d9d41c32de5ed2bad51d0b483063f13c84ab1b53c027968451add7d691
MD5 f29b114d24d0e0be37d6be879e6bf0f1
BLAKE2b-256 87792a0554bc74b30108ede82f9735b937fe56db849952c289eb226ed3b2be93

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41a0fef9c4e0a9be37997e9d0420168f655bab1fdcc328cdd26386f223037d61
MD5 49c5eb87d2d15ef54ce1cca73739cbe1
BLAKE2b-256 9aafa7f14bde206d2dff2aef31a157d76d29d6673f02943fe7cdc551ebe8827f

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 044f23236e7eeed2c50f7931890ce526fd19a4afa9c8ac85f245f74a6c8f2c47
MD5 69f962bcf6f8e9b3bc0eb20e5c27b6ba
BLAKE2b-256 dce040284bd633ed0fc24cd29c8dc2521ad7eb1ae6ce5b7bc866f1b9a6cdb1f3

See more details on using hashes here.

File details

Details for the file bili_ticket_gt_python-0.2.5-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for bili_ticket_gt_python-0.2.5-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b1ab5123223ef94eeeaf1393473d2239ff91667738c89f464f1213749cea51ec
MD5 c171db134e70a7cbb83cbde9bff46dd1
BLAKE2b-256 1ece0d03d3b7800440ed38c9d97ea860701c9bf1111b816007ad9972a93f81c2

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