diff --git a/grok_register_ttk.py b/grok_register_ttk.py index 85fc3df..c892c24 100755 --- a/grok_register_ttk.py +++ b/grok_register_ttk.py @@ -874,7 +874,7 @@ def http_post(url, **kwargs): def raise_if_cancelled(cancel_callback=None): if cancel_callback and cancel_callback(): - raise RegistrationCancelled("鐢ㄦ埛鍋滄娉ㄥ唽") + raise RegistrationCancelled("用户停止注册") def sleep_with_cancel(seconds, cancel_callback=None): @@ -1063,7 +1063,7 @@ def yyds_create_account(address=None, domain=None, api_key=None, jwt=None): data = resp.json() if data.get("success"): return data.get("data", {}) - raise Exception(f"YYDS 鍒涘缓閭澶辫触: {data}") + raise Exception(f"YYDS 创建邮箱失败: {data}") def yyds_get_token(address, api_key=None, jwt=None): @@ -1081,7 +1081,7 @@ def yyds_get_token(address, api_key=None, jwt=None): data = resp.json() if data.get("success"): return data.get("data", {}).get("token") - raise Exception(f"YYDS 鑾峰彇token澶辫触: {data}") + raise Exception(f"YYDS 获取token失败: {data}") def yyds_get_messages(address, token=None, api_key=None, jwt=None): @@ -1117,7 +1117,7 @@ def yyds_get_message_detail(message_id, token=None, api_key=None, jwt=None): data = resp.json() if data.get("success"): return data.get("data", {}) - raise Exception(f"YYDS 鑾峰彇閭欢璇︽儏澶辫触: {data}") + raise Exception(f"YYDS 获取邮件详情失败: {data}") def yyds_generate_username(length=10): @@ -1128,7 +1128,7 @@ def yyds_generate_username(length=10): def yyds_pick_domain(api_key=None, jwt=None): domains = yyds_get_domains(api_key=api_key, jwt=jwt) if not domains: - raise Exception("YYDS 娌℃湁杩斿洖浠讳綍鍙敤鍩熷悕") + raise Exception("YYDS 没有返回任何可用域名") private = [d for d in domains if d.get("isVerified") and not d.get("isPublic")] if private: return private[0]["domain"] @@ -1138,7 +1138,7 @@ def yyds_pick_domain(api_key=None, jwt=None): verified = [d for d in domains if d.get("isVerified")] if verified: return verified[0]["domain"] - raise Exception("YYDS 鏃犲凡楠岃瘉鍩熷悕鍙敤") + raise Exception("YYDS 无已验证域名可用") def yyds_get_email_and_token(api_key=None, jwt=None): @@ -1156,8 +1156,8 @@ def yyds_get_email_and_token(api_key=None, jwt=None): if not temp_token: temp_token = yyds_get_token(address, api_key=key, jwt=token) if not temp_token: - raise Exception("鑾峰彇 YYDS token 澶辫触") - print(f"[*] 宸插垱寤?YYDS 閭: {address}") + raise Exception("获取 YYDS token 失败") + print(f"[*] 已创建 YYDS 邮箱: {address}") return address, temp_token @@ -1178,7 +1178,7 @@ def yyds_get_oai_code( messages = yyds_get_messages(address, token=token, jwt=jwt) except Exception as exc: if log_callback: - log_callback(f"[Debug] YYDS 鎷夊彇閭欢鍒楄〃澶辫触: {exc}") + log_callback(f"[Debug] YYDS 拉取邮件列表失败: {exc}") sleep_with_cancel(poll_interval, cancel_callback) continue for msg in messages: @@ -1193,7 +1193,7 @@ def yyds_get_oai_code( detail = yyds_get_message_detail(msg_id, token=token, jwt=jwt) except Exception as exc: if log_callback: - log_callback(f"[Debug] YYDS 鑾峰彇閭欢璇︽儏澶辫触: {exc}") + log_callback(f"[Debug] YYDS 获取邮件详情失败: {exc}") continue parts = [] text_body = detail.get("text") or "" @@ -1205,11 +1205,11 @@ def yyds_get_oai_code( combined = "\n".join(parts) subject = detail.get("subject", "") if log_callback: - log_callback(f"[Debug] YYDS 鏀跺埌閭欢: {subject}") + log_callback(f"[Debug] YYDS 收到邮件: {subject}") code = extract_verification_code(combined, subject) if code: if log_callback: - log_callback(f"[*] YYDS 浠庨偖浠朵腑鎻愬彇鍒伴獙璇佺爜: {code}") + log_callback(f"[*] YYDS 从邮件中提取到验证码: {code}") return code sleep_with_cancel(poll_interval, cancel_callback) raise Exception(f"YYDS 在 {timeout}s 内未收到验证码邮件") @@ -1223,7 +1223,7 @@ def generate_username(length=10): def pick_domain(api_key=None): domains = get_domains(api_key=api_key) if not domains: - raise Exception("DuckMail 娌℃湁杩斿洖浠讳綍鍙敤鍩熷悕") + raise Exception("DuckMail 没有返回任何可用域名") private = [d for d in domains if d.get("ownerId")] verified_private = [d for d in private if d.get("isVerified")] if verified_private: @@ -1231,7 +1231,7 @@ def pick_domain(api_key=None): public = [d for d in domains if d.get("isVerified")] if public: return public[0]["domain"] - raise Exception("DuckMail 鏃犲凡楠岃瘉鍩熷悕鍙敤") + raise Exception("DuckMail 无已验证域名可用") def get_email_provider(): @@ -1280,7 +1280,7 @@ def get_email_and_token(api_key=None): create_account(address, password, api_key=key, expires_in=0) token = get_token(address, password) if not token: - raise Exception("鑾峰彇 DuckMail token 澶辫触") + raise Exception("获取 DuckMail token 失败") return address, token @@ -1445,7 +1445,7 @@ def duckmail_get_oai_code( messages = get_messages(dev_token) except Exception as exc: if log_callback: - log_callback(f"[Debug] 鎷夊彇閭欢鍒楄〃澶辫触: {exc}") + log_callback(f"[Debug] 拉取邮件列表失败: {exc}") sleep_with_cancel(poll_interval, cancel_callback) continue for msg in messages: @@ -1460,7 +1460,7 @@ def duckmail_get_oai_code( detail = get_message_detail(dev_token, msg_id) except Exception as exc: if log_callback: - log_callback(f"[Debug] 鑾峰彇閭欢璇︽儏澶辫触: {exc}") + log_callback(f"[Debug] 获取邮件详情失败: {exc}") continue parts = [] text_body = detail.get("text") or "" @@ -1472,11 +1472,11 @@ def duckmail_get_oai_code( combined = "\n".join(parts) subject = detail.get("subject", "") if log_callback: - log_callback(f"[Debug] 鏀跺埌閭欢: {subject}") + log_callback(f"[Debug] 收到邮件: {subject}") code = extract_verification_code(combined, subject) if code: if log_callback: - log_callback(f"[*] 浠庨偖浠朵腑鎻愬彇鍒伴獙璇佺爜: {code}") + log_callback(f"[*] 从邮件中提取到验证码: {code}") return code sleep_with_cancel(poll_interval, cancel_callback) raise Exception(f"在 {timeout}s 内未收到验证码邮件")