Skip to content

Commit

Permalink
fix: #125
Browse files Browse the repository at this point in the history
  • Loading branch information
mikumifa committed Jun 17, 2024
1 parent 601fd98 commit 7adccce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
26 changes: 5 additions & 21 deletions geetest/AmorterValidator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import bili_ticket_gt_python
import loguru
import threading

from config import cookies_config_path
from geetest.Validator import Validator
Expand Down Expand Up @@ -33,23 +32,8 @@ def validate(self, appkey, gt, challenge, referer="http://127.0.0.1:7860/") -> s
if __name__ == "__main__":
# 使用示例
appkey = "xxxxxxxxxxxxxxxxxxx"
_request = BiliRequest(cookies_config_path=cookies_config_path)
test_res = _request.get(
"https://passport.bilibili.com/x/passport-login/captcha?source=main_web"
).json()
challenge = test_res["data"]["geetest"]["challenge"]
gt = test_res["data"]["geetest"]["gt"]

try:
def validate_task():
validator = AmorterValidator()
validate_string = validator.validate(appkey, gt, challenge)
print(f"Validation result: {validate_string}")

# 创建一个线程来运行验证函数
validation_thread = threading.Thread(target=validate_task)
# 启动线程
validation_thread.start()
validation_thread.join()
except Exception as e:
print(f"Error: {e}")
validator = AmorterValidator()
gt, challenge = validator.click.register_test(
"https://passport.bilibili.com/x/passport-login/captcha?source=main_web")
validate_string = validator.validate(appkey, gt, challenge)
print(f"Validation result: {validate_string}")
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ gradio~=4.29.0
qrcode~=7.4.2
loguru~=0.7.2
webdriver-manager~=4.0.1
ddddocr~=1.4.11
Pillow~=10.3.0
retry~=0.9.2
bili-ticket-gt-python~=0.2.3
Expand Down

0 comments on commit 7adccce

Please sign in to comment.