From 89a583eeaae51426175804de6de9ad55dfff6295 Mon Sep 17 00:00:00 2001
From: mikumifa <1055069518@qq.com>
Date: Wed, 12 Jun 2024 16:48:46 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=8B=E5=8A=A8=E9=AA=8C=E8=AF=81?=
=?UTF-8?q?=E7=A0=81=E5=92=8CGeetest=E5=B9=B6=E8=A1=8C=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
geetest/CapSolverValidator.py | 3 ++-
tab/go.py | 10 ++++++++++
tab/train.py | 25 +++++++++++++++----------
3 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/geetest/CapSolverValidator.py b/geetest/CapSolverValidator.py
index 747c8c8..6a25dbb 100644
--- a/geetest/CapSolverValidator.py
+++ b/geetest/CapSolverValidator.py
@@ -41,9 +41,10 @@ def validate(self, appkey, gt, challenge, referer="http://127.0.0.1:7860/") -> s
resp = res.json()
status = resp.get("status")
if status == "ready":
- loguru.logger.info(resp.get("solution"))
+ loguru.logger.info(resp)
return resp.get("solution")['validate']
if status == "failed" or resp.get("errorId"):
+ loguru.logger.info(resp)
raise ValueError("Solve failed! response: " + res.text)
if status == "processing":
continue
diff --git a/tab/go.py b/tab/go.py
index 42175cc..41824cf 100644
--- a/tab/go.py
+++ b/tab/go.py
@@ -160,6 +160,16 @@ def start_go(tickets_info_str, time_start, interval, mode, total_attempts, api_k
gr.update(value="hello"),
]
try:
+ if select_way != 2:
+ yield [
+ gr.update(value=withTimeString("进行验证码验证"), visible=True),
+ gr.update(visible=True),
+ gr.update(),
+ gr.update(visible=True),
+ gr.update(value=gt),
+ gr.update(value=challenge),
+ gr.update(value="hello"),
+ ]
if select_way != 0:
# https://passport.bilibili.com/x/passport-login/captcha?source=main_web
def run_validation():
diff --git a/tab/train.py b/tab/train.py
index e68a2ad..1ad4d5b 100644
--- a/tab/train.py
+++ b/tab/train.py
@@ -23,11 +23,13 @@ def train_tab():
gr.Markdown("""
+
+
| 过码方式 | 使用说明 |
| ------------------ | ------------------------------------------------------------ |
| 手动 | 自己过,速度取决于自己,过程看项目的readme.md的GIF |
-| 使用接码网站 rrocr | rrocr 提供的 http://www.rrocr.com
能过验证码,但是抢票没有测试,慎用
需要购买对应的key,速度比手动快,价格 一次大概一分钱
|
-| 使用接码网站 CapSolve | CapSolver的过码方式
https://www.capsolver.com/zh
https://docs.capsolver.com/guide/captcha/Geetest.html|
+| 使用接码网站 rrocr | **支持**手动和人工同时使用
rrocr 提供的 http://www.rrocr.com
能过验证码,但是抢票没有测试,慎用
需要购买对应的key,速度比手动快,价格 一次大概一分钱
|
+| 使用接码网站 CapSolve | **不支持**手动和人工同时使用
CapSolver的过码方式
https://www.capsolver.com/zh
https://docs.capsolver.com/guide/captcha/Geetest.html|
| ..... | 欢迎Discussion补充 |
""")
@@ -87,15 +89,18 @@ def test_get_challenge(api_key):
test_csrf = _request.cookieManager.get_cookies_value("bili_jct")
test_geetest_validate = ""
test_geetest_seccode = ""
- yield [
- gr.update(value=test_gt), # test_gt_ui
- gr.update(value=test_challenge), # test_challenge_ui
- gr.update(visible=True), # test_gt_row
- gr.update(value="重新生成"), # test_get_challenge_btn
- gr.update(),
- gr.update(value="hello")
- ]
+
try:
+ # Capture 不支持同时
+ if select_way != 2:
+ yield [
+ gr.update(value=test_gt), # test_gt_ui
+ gr.update(value=test_challenge), # test_challenge_ui
+ gr.update(visible=True), # test_gt_row
+ gr.update(value="重新生成"), # test_get_challenge_btn
+ gr.update(),
+ gr.update(value="hello")
+ ]
if select_way != 0:
def run_validation():
global test_geetest_validate, test_geetest_seccode