修复一个问题批量注册跳出的问题

This commit is contained in:
huangzhenpc
2025-03-11 19:09:29 +08:00
parent 89c5fd4cf9
commit 58d1937231
2 changed files with 54 additions and 51 deletions

View File

@@ -5,6 +5,8 @@ import logging
from dotenv import load_dotenv
load_dotenv()
# PROXY_HOST = "h464.kdltpspro.com"
# PROXY_PORT = "15818"
PROXY_HOST = "h464.kdltpspro.com"
PROXY_PORT = "15818"
PROXY_URL = f"http://{PROXY_HOST}:{PROXY_PORT}"

View File

@@ -735,7 +735,12 @@ if __name__ == "__main__":
timeout_accounts += 1
continue
if sign_up_account(browser, tab, registration_start_time):
# 执行注册流程
registration_result = sign_up_account(browser, tab, registration_start_time)
if not registration_result:
logging.warning("注册过程失败或超时,跳过当前账号,继续下一个...")
continue
# 检查是否超时
if check_timeout(registration_start_time):
logging.warning("放弃当前注册,继续下一个账号")
@@ -744,7 +749,10 @@ if __name__ == "__main__":
logging.info("正在获取会话令牌...")
token = get_cursor_session_token(tab, start_time=registration_start_time)
if token:
if not token:
logging.error("获取会话令牌失败,跳过当前注册,继续下一个账号...")
continue
# 检查是否超时
if check_timeout(registration_start_time):
logging.warning("放弃当前注册,继续下一个账号")
@@ -752,11 +760,8 @@ if __name__ == "__main__":
continue
logging.info("更新认证信息...")
logging.info("重置机器码...")
logging.info(f"API将使用相同代理: {proxy_host}:{proxy_port}")
# 保存成功注册的账号信息
@@ -786,10 +791,6 @@ if __name__ == "__main__":
else:
logging.warning("账号同步到服务器失败")
else:
logging.error("获取会话令牌失败,注册流程未完成")
# 计算本次注册用时
registration_elapsed = time.time() - registration_start_time
logging.info(f"本次注册用时: {registration_elapsed:.1f}")