Update core logic, Telegram bot, browser automation, and email services.

This commit is contained in:
2026-01-18 05:57:52 +08:00
parent 7e92e12c79
commit 83a9e38aa7
4 changed files with 60 additions and 4 deletions

View File

@@ -148,10 +148,20 @@ class GPTMailService:
def _get_headers(self, api_key: str = None) -> dict:
"""获取请求头 (支持指定 Key 或轮询)"""
key = api_key or self._fixed_key or get_next_gptmail_key()
self._current_key = key # 保存当前使用的 key
return {
"X-API-Key": key,
"Content-Type": "application/json"
}
def _get_key_display(self) -> str:
"""获取当前 key 的脱敏显示"""
key = getattr(self, '_current_key', None)
if not key:
return "未知"
if len(key) > 10:
return f"{key[:4]}...{key[-4:]}"
return key[:4] + "..."
def generate_email(self, prefix: str = None, domain: str = None, api_key: str = None) -> tuple[str, str]:
"""生成临时邮箱地址
@@ -337,7 +347,7 @@ class GPTMailService:
Returns:
tuple: (code, error, email_time) - 验证码、错误信息、邮件时间
"""
log.info(f"GPTMail 等待验证码邮件: {email}", icon="email")
log.info(f"GPTMail 等待验证码: {email} (Key: {self._get_key_display()})", icon="email")
# 用于存储邮件时间的闭包变量
email_time_holder = [None]