Update core logic, Telegram bot, browser automation, and email services.
This commit is contained in:
@@ -359,7 +359,7 @@ def init_browser(max_retries: int = BROWSER_MAX_RETRIES) -> ChromiumPage:
|
||||
fingerprint = None
|
||||
if BROWSER_RANDOM_FINGERPRINT:
|
||||
fingerprint = get_random_fingerprint()
|
||||
log.step(f"随机指纹: {fingerprint['webgl_renderer'][:40]}...")
|
||||
log.info(f"指纹: {fingerprint['webgl_renderer'][:45]}... | {fingerprint['screen']['width']}x{fingerprint['screen']['height']}", icon="config")
|
||||
else:
|
||||
# 使用默认指纹
|
||||
fingerprint = {
|
||||
@@ -369,7 +369,7 @@ def init_browser(max_retries: int = BROWSER_MAX_RETRIES) -> ChromiumPage:
|
||||
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce RTX 3060 Direct3D11 vs_5_0 ps_5_0)",
|
||||
"screen": {"width": 1920, "height": 1080}
|
||||
}
|
||||
log.step("使用默认指纹")
|
||||
log.info("指纹: 默认 (RTX 3060, 1920x1080)", icon="config")
|
||||
|
||||
last_error = None
|
||||
is_linux = platform.system() == "Linux"
|
||||
|
||||
@@ -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]
|
||||
|
||||
38
run.py
38
run.py
@@ -531,13 +531,49 @@ def process_accounts(accounts: list, team_name: str, team_index: int = 0,
|
||||
return results
|
||||
|
||||
|
||||
def _print_system_config():
|
||||
"""打印当前系统配置"""
|
||||
from config import (
|
||||
EMAIL_PROVIDER, AUTH_PROVIDER, ACCOUNTS_PER_TEAM,
|
||||
INCLUDE_TEAM_OWNERS, BROWSER_RANDOM_FINGERPRINT,
|
||||
S2A_API_BASE, CPA_API_BASE, CRS_API_BASE,
|
||||
PROXY_ENABLED, PROXIES
|
||||
)
|
||||
|
||||
log.section("系统配置")
|
||||
log.info(f"邮箱服务: {EMAIL_PROVIDER}", icon="email")
|
||||
|
||||
# 授权服务
|
||||
if AUTH_PROVIDER == "s2a":
|
||||
auth_url = S2A_API_BASE or "未配置"
|
||||
elif AUTH_PROVIDER == "cpa":
|
||||
auth_url = CPA_API_BASE or "未配置"
|
||||
else:
|
||||
auth_url = CRS_API_BASE or "未配置"
|
||||
log.info(f"授权服务: {AUTH_PROVIDER.upper()} ({auth_url})", icon="auth")
|
||||
|
||||
log.info(f"每 Team 账号: {ACCOUNTS_PER_TEAM}", icon="account")
|
||||
log.info(f"Owner 入库: {'✓ 开启' if INCLUDE_TEAM_OWNERS else '✗ 关闭'}", icon="config")
|
||||
log.info(f"随机指纹: {'✓ 开启' if BROWSER_RANDOM_FINGERPRINT else '✗ 关闭'}", icon="config")
|
||||
|
||||
if PROXY_ENABLED and PROXIES:
|
||||
log.info(f"代理: 已启用 ({len(PROXIES)} 个)", icon="proxy")
|
||||
else:
|
||||
log.info("代理: 未启用", icon="proxy")
|
||||
|
||||
log.separator()
|
||||
|
||||
|
||||
def run_all_teams():
|
||||
"""主函数: 遍历所有 Team"""
|
||||
global _tracker, _current_results, _shutdown_requested
|
||||
|
||||
log.header("ChatGPT Team 批量注册自动化")
|
||||
|
||||
# 打印系统配置
|
||||
_print_system_config()
|
||||
|
||||
log.info(f"共 {len(TEAMS)} 个 Team 待处理", icon="team")
|
||||
log.info(f"每个 Team 邀请 {ACCOUNTS_PER_TEAM} 个账号", icon="account")
|
||||
log.info(f"统一密码: {DEFAULT_PASSWORD}", icon="code")
|
||||
log.info("按 Ctrl+C 可安全退出并保存进度")
|
||||
log.separator()
|
||||
|
||||
@@ -43,6 +43,7 @@ from config import (
|
||||
S2A_GROUP_NAMES,
|
||||
S2A_GROUP_IDS,
|
||||
S2A_ADMIN_KEY,
|
||||
BROWSER_RANDOM_FINGERPRINT,
|
||||
)
|
||||
from utils import load_team_tracker, get_all_incomplete_accounts
|
||||
from bot_notifier import BotNotifier, set_notifier, progress_finish
|
||||
@@ -365,6 +366,9 @@ class ProvisionerBot:
|
||||
|
||||
# Owner 入库状态
|
||||
include_owners_status = "✅ 已开启" if INCLUDE_TEAM_OWNERS else "❌ 未开启"
|
||||
|
||||
# 随机指纹状态
|
||||
fingerprint_status = "✅ 已开启" if BROWSER_RANDOM_FINGERPRINT else "❌ 未开启"
|
||||
|
||||
lines = [
|
||||
"<b>⚙️ 系统配置</b>",
|
||||
@@ -377,6 +381,9 @@ class ProvisionerBot:
|
||||
f" 地址: {auth_url}",
|
||||
f" Owner 入库: {include_owners_status}",
|
||||
"",
|
||||
"<b>🌐 浏览器</b>",
|
||||
f" 随机指纹: {fingerprint_status}",
|
||||
"",
|
||||
"<b>👥 账号设置</b>",
|
||||
f" 每 Team 账号数: {ACCOUNTS_PER_TEAM}",
|
||||
f" team.json 账号: {len(TEAMS)}",
|
||||
@@ -385,6 +392,7 @@ class ProvisionerBot:
|
||||
f" 状态: {proxy_info}",
|
||||
"",
|
||||
"<b>💡 提示:</b>",
|
||||
"/fingerprint - 切换随机指纹",
|
||||
"/include_owners - 切换 Owner 入库",
|
||||
"/s2a_config - 配置 S2A 参数",
|
||||
]
|
||||
@@ -500,6 +508,7 @@ class ProvisionerBot:
|
||||
AUTH_PROVIDER as new_auth_provider,
|
||||
INCLUDE_TEAM_OWNERS as new_include_owners,
|
||||
ACCOUNTS_PER_TEAM as new_accounts_per_team,
|
||||
BROWSER_RANDOM_FINGERPRINT as new_random_fingerprint,
|
||||
)
|
||||
|
||||
lines = [
|
||||
@@ -512,6 +521,7 @@ class ProvisionerBot:
|
||||
f" 邮箱服务: {new_email_provider}",
|
||||
f" 授权服务: {new_auth_provider}",
|
||||
f" Owner 入库: {'✅' if new_include_owners else '❌'}",
|
||||
f" 随机指纹: {'✅' if new_random_fingerprint else '❌'}",
|
||||
f" 每 Team 账号: {new_accounts_per_team}",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user