feat(auth): print a scannable ASCII QR in the terminal

WSL and --no-browser never showed the PNG, and placeholder Chinese cookies crashed urllib latin-1 headers before the code was issued.
This commit is contained in:
kairee committed 2026-11-02 10:35:56 +08:00
1 parent 12732f6316
commit 2641ba6f87
5 files changed
+183 -11

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@ def _build_parser() -> argparse.ArgumentParser:
auth = sub.add_parser("auth", parents=[common], help="扫码授权并更新指定账号 Cookie")
auth.add_argument("--account", choices=("read", "write"), default="read",
help="要授权的账号角色(默认 read)")
auth.add_argument("--no-browser", action="store_true", help="不自动打开二维码图片")
auth.add_argument("--no-browser", action="store_true", help="不自动打开二维码图片(仍在终端打印 ASCII 二维码)")
auth.add_argument("--timeout", type=int, default=180, metavar="SEC",
help="等待扫码的超时时间(默认 180 秒)")
auth_check = sub.add_parser("auth-check", parents=[common], help="检查账号登录态")