修复一个问题批量注册跳出的问题
This commit is contained in:
@@ -5,6 +5,8 @@ import logging
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
# PROXY_HOST = "h464.kdltpspro.com"
|
||||||
|
# PROXY_PORT = "15818"
|
||||||
PROXY_HOST = "h464.kdltpspro.com"
|
PROXY_HOST = "h464.kdltpspro.com"
|
||||||
PROXY_PORT = "15818"
|
PROXY_PORT = "15818"
|
||||||
PROXY_URL = f"http://{PROXY_HOST}:{PROXY_PORT}"
|
PROXY_URL = f"http://{PROXY_HOST}:{PROXY_PORT}"
|
||||||
|
|||||||
@@ -735,7 +735,12 @@ if __name__ == "__main__":
|
|||||||
timeout_accounts += 1
|
timeout_accounts += 1
|
||||||
continue
|
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):
|
if check_timeout(registration_start_time):
|
||||||
logging.warning("放弃当前注册,继续下一个账号")
|
logging.warning("放弃当前注册,继续下一个账号")
|
||||||
@@ -744,7 +749,10 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
logging.info("正在获取会话令牌...")
|
logging.info("正在获取会话令牌...")
|
||||||
token = get_cursor_session_token(tab, start_time=registration_start_time)
|
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):
|
if check_timeout(registration_start_time):
|
||||||
logging.warning("放弃当前注册,继续下一个账号")
|
logging.warning("放弃当前注册,继续下一个账号")
|
||||||
@@ -752,11 +760,8 @@ if __name__ == "__main__":
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
logging.info("更新认证信息...")
|
logging.info("更新认证信息...")
|
||||||
|
|
||||||
logging.info("重置机器码...")
|
logging.info("重置机器码...")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logging.info(f"API将使用相同代理: {proxy_host}:{proxy_port}")
|
logging.info(f"API将使用相同代理: {proxy_host}:{proxy_port}")
|
||||||
|
|
||||||
# 保存成功注册的账号信息
|
# 保存成功注册的账号信息
|
||||||
@@ -786,10 +791,6 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
logging.warning("账号同步到服务器失败")
|
logging.warning("账号同步到服务器失败")
|
||||||
|
|
||||||
|
|
||||||
else:
|
|
||||||
logging.error("获取会话令牌失败,注册流程未完成")
|
|
||||||
|
|
||||||
# 计算本次注册用时
|
# 计算本次注册用时
|
||||||
registration_elapsed = time.time() - registration_start_time
|
registration_elapsed = time.time() - registration_start_time
|
||||||
logging.info(f"本次注册用时: {registration_elapsed:.1f} 秒")
|
logging.info(f"本次注册用时: {registration_elapsed:.1f} 秒")
|
||||||
|
|||||||
Reference in New Issue
Block a user