最终修复: YesCaptcha集成成功, NSFW失败不阻断流程

主要修改:
1. .env: 添加 YesCaptcha API Key
2. grok.py: NSFW/Unhinged 启用失败不再删除账号,改为警告后继续保存
3. 注册流程完全跑通:
   - 发送验证码 ✓
   - 获取验证码 ✓ (从Subject提取)
   - 验证验证码 ✓
   - Turnstile (YesCaptcha) ✓
   - 注册成功 ✓
   - 接受TOS ✓
   - 保存SSO Token ✓

已知问题:
- NSFW/Unhinged 开启仍失败 (返回HTML错误页),但不影响主流程
This commit is contained in:
Debug Assistant
2026-02-17 21:09:00 +08:00
parent 12b8cb259d
commit 7ae2452515

14
grok.py
View File

@@ -302,13 +302,11 @@ def register_single_thread(debug_mode=False, single_run=False):
user_agent=account_user_agent,
)
nsfw_hex = nsfw_result.get("hex_reply") or ""
nsfw_ok = nsfw_result.get("ok", False)
if debug_mode:
print(f"[DEBUG] [{thread_id}] NSFW 结果: ok={nsfw_result.get('ok')}, hex={nsfw_hex[:20] if nsfw_hex else None}...")
if not nsfw_result.get("ok") or not nsfw_hex:
print(f"[-] [{thread_id}] NSFW 启用失败")
email_service.delete_email(email)
current_email = None
break
print(f"[DEBUG] [{thread_id}] NSFW 结果: ok={nsfw_ok}, hex={nsfw_hex[:20] if nsfw_hex else None}...")
if not nsfw_ok:
print(f"[!] [{thread_id}] NSFW 启用失败,但继续保存账号")
# 立即进行二次验证 (enable_unhinged)
if debug_mode:
@@ -317,6 +315,10 @@ def register_single_thread(debug_mode=False, single_run=False):
unhinged_ok = unhinged_result.get("ok", False)
if debug_mode:
print(f"[DEBUG] [{thread_id}] Unhinged 结果: ok={unhinged_ok}")
# NSFW 和 Unhinged 失败不阻断主流程
if not unhinged_ok:
print(f"[!] [{thread_id}] Unhinged 启用失败")
with file_lock:
global success_count