update
This commit is contained in:
14
run.py
14
run.py
@@ -48,7 +48,7 @@ try:
|
||||
except ImportError:
|
||||
# 如果没有 bot_notifier,使用空函数
|
||||
def progress_start(team_name, total): pass
|
||||
def progress_update(account=None, step=None): pass
|
||||
def progress_update(account=None, phase=None, step=None, role=None): pass
|
||||
def progress_account_done(email, success): pass
|
||||
def progress_finish(): pass
|
||||
def notify_team_completed_sync(team_name, results): pass
|
||||
@@ -319,7 +319,7 @@ def process_accounts(accounts: list, team_name: str, team_index: int = 0,
|
||||
log.separator("#", 50)
|
||||
|
||||
# 更新进度: 当前账号
|
||||
progress_update(account=email, step="Starting...", role=role)
|
||||
progress_update(account=email, phase="准备", step="开始处理...", role=role)
|
||||
|
||||
result = {
|
||||
"team": team_name,
|
||||
@@ -370,13 +370,13 @@ def process_accounts(accounts: list, team_name: str, team_index: int = 0,
|
||||
if is_team_owner_otp:
|
||||
# 旧格式 Team Owner: 使用 OTP 登录授权
|
||||
log.info("Team Owner 账号 (旧格式),使用一次性验证码登录...", icon="auth")
|
||||
progress_update(step="OTP Login...")
|
||||
progress_update(phase="授权", step="OTP 登录...")
|
||||
auth_success, codex_data = login_and_authorize_with_otp(email)
|
||||
register_success = auth_success
|
||||
elif need_crs_only:
|
||||
# 已授权但未入库: 跳过授权,直接尝试入库
|
||||
log.info(f"已授权账号 (状态: {account_status}),跳过授权,直接入库...", icon="auth")
|
||||
progress_update(step="Adding to CRS...")
|
||||
progress_update(phase="入库", step="添加到 CRS...")
|
||||
register_success = True
|
||||
codex_data = None # CPA/S2A 模式不需要 codex_data
|
||||
# CRS 模式下,由于没有 codex_data,无法入库,需要重新授权
|
||||
@@ -387,12 +387,12 @@ def process_accounts(accounts: list, team_name: str, team_index: int = 0,
|
||||
elif need_auth_only:
|
||||
# 已注册账号 (包括新格式 Owner): 使用密码登录授权
|
||||
log.info(f"已注册账号 (状态: {account_status}, 角色: {account_role}),使用密码登录授权...", icon="auth")
|
||||
progress_update(step="Authorizing...")
|
||||
progress_update(phase="授权", step="密码登录授权...")
|
||||
auth_success, codex_data = authorize_only(email, password)
|
||||
register_success = True
|
||||
else:
|
||||
# 新账号: 注册 + Codex 授权
|
||||
progress_update(step="Registering...")
|
||||
progress_update(phase="注册", step="注册 OpenAI...")
|
||||
register_success, codex_data = register_and_authorize(email, password)
|
||||
|
||||
# 检查是否是域名黑名单错误
|
||||
@@ -436,7 +436,7 @@ def process_accounts(accounts: list, team_name: str, team_index: int = 0,
|
||||
|
||||
# 验证账号是否成功入库
|
||||
log.step("正在验证 S2A 账号入库状态...")
|
||||
progress_update(step="验证入库...")
|
||||
progress_update(phase="验证", step="检查入库状态...")
|
||||
verified, account_data = s2a_verify_account_in_pool(email)
|
||||
|
||||
if verified:
|
||||
|
||||
Reference in New Issue
Block a user