fix: 修复 Windows GBK 编码下 emoji 显示乱码问题

- 将 Unicode 符号替换为 ASCII 字符,避免 Windows GBK 编码错误
- api/tasks.py: ✓✗↷■ → [OK][FAIL][SKIP][STOP]
- api_solver.py: 📢💬📁 → [Channel][Chat][GitHub]
This commit is contained in:
xrilang
2026-04-03 13:19:48 +08:00
parent 8ee42fc2dc
commit 10a8b8827f
2 changed files with 10 additions and 10 deletions

View File

@@ -152,7 +152,7 @@ def _auto_upload_integrations(task_id: str, account):
name = result.get("name", "Auto Upload")
ok = bool(result.get("ok"))
msg = result.get("msg", "")
_log(task_id, f" [{name}] {' ' + msg if ok else ' ' + msg}")
_log(task_id, f" [{name}] {'[OK] ' + msg if ok else '[FAIL] ' + msg}")
except Exception as e:
_log(task_id, f" [Auto Upload] 自动导入异常: {e}")
@@ -292,7 +292,7 @@ def _run_register(task_id: str, req: RegisterTaskRequest):
saved_account = save_account(account)
if _proxy:
proxy_pool.report_success(_proxy)
_log(task_id, f" 注册成功: {account.email}")
_log(task_id, f"[OK] 注册成功: {account.email}")
_save_task_log(req.platform, account.email, "success")
_auto_upload_integrations(task_id, saved_account or account)
cashier_url = (account.extra or {}).get("cashier_url", "")
@@ -301,7 +301,7 @@ def _run_register(task_id: str, req: RegisterTaskRequest):
_task_store.add_cashier_url(task_id, cashier_url)
return AttemptResult.success()
except SkipCurrentAttemptRequested as e:
_log(task_id, f" 已跳过当前账号: {e}")
_log(task_id, f"[SKIP] 已跳过当前账号: {e}")
_save_task_log(
req.platform,
current_email,
@@ -310,12 +310,12 @@ def _run_register(task_id: str, req: RegisterTaskRequest):
)
return AttemptResult.skipped(str(e))
except StopTaskRequested as e:
_log(task_id, f" {e}")
_log(task_id, f"[STOP] {e}")
return AttemptResult.stopped(str(e))
except Exception as e:
if _proxy and proxy_pool is not None:
proxy_pool.report_fail(_proxy)
_log(task_id, f" 注册失败: {e}")
_log(task_id, f"[FAIL] 注册失败: {e}")
_save_task_log(
req.platform,
current_email,
@@ -338,7 +338,7 @@ def _run_register(task_id: str, req: RegisterTaskRequest):
except CancelledError:
continue
except Exception as e:
_log(task_id, f" 任务线程异常: {e}")
_log(task_id, f"[ERROR] 任务线程异常: {e}")
errors.append(str(e))
continue
if result.outcome == AttemptOutcome.SUCCESS:

View File

@@ -114,13 +114,13 @@ class TurnstileAPIServer:
self.console.clear()
combined_text = Text()
combined_text.append("\n📢 Channel: ", style="bold white")
combined_text.append("\n[Channel] ", style="bold white")
combined_text.append("https://t.me/D3_vin", style="cyan")
combined_text.append("\n💬 Chat: ", style="bold white")
combined_text.append("\n[Chat] ", style="bold white")
combined_text.append("https://t.me/D3vin_chat", style="cyan")
combined_text.append("\n📁 GitHub: ", style="bold white")
combined_text.append("\n[GitHub] ", style="bold white")
combined_text.append("https://github.com/D3-vin", style="cyan")
combined_text.append("\n📁 Version: ", style="bold white")
combined_text.append("\n[Version] ", style="bold white")
combined_text.append("1.2a", style="green")
combined_text.append("\n")