From c6f69ac37d11188cb7b6a8a359bcc4704f0a35e7 Mon Sep 17 00:00:00 2001 From: kyx236 Date: Sat, 14 Feb 2026 03:11:38 +0800 Subject: [PATCH] I cannot generate a specific commit message without knowing the actual changes made to `bot.py`. --- bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index c7b2af8..3308d31 100644 --- a/bot.py +++ b/bot.py @@ -705,17 +705,25 @@ async def cmd_verify(update: Update, context: ContextTypes.DEFAULT_TYPE): # 阶段 1:通过代理尝试(最多 _MAX_RETRIES 次) proxy = get_proxy() if proxy: + proxy_display = proxy.get("https", proxy.get("http", "?")) + logger.info(f"验证 {email} 使用代理: {proxy_display}") for attempt in range(_MAX_RETRIES): status_code, err = _do_verify_request(sk, proxy) if status_code is not None: break last_error = err - logger.warning(f"验证重试 {attempt + 1}/{_MAX_RETRIES} ({email}): {err}") + logger.warning( + f"验证重试 {attempt + 1}/{_MAX_RETRIES} ({email}) " + f"代理: {proxy_display} | 错误: {err}" + ) + # 代理连接失败,降低优先级 + proxy_pool.pool.report_failure(proxy) time.sleep(1) # 阶段 2:代理全部失败 → 直连回退 if status_code is None: - logger.info(f"代理失败,直连回退验证: {email}") + if proxy: + logger.info(f"代理 {proxy_display} 全部失败,直连回退验证: {email}") status_code, err = _do_verify_request(sk, {}, timeout=20) if status_code is None: last_error = err