jackwener / jackwener/xiaohongshu-cli
QR login in headless/remote env is hard to scan (need image output / longer TTL)
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 272
- PR merge metrics
- No merged PRs in 30d
Description
你好,感谢项目!我在远程 Linux 服务器(无 GUI / 无 XServer)使用 `python -m xhs_cli login --qrcode` 时遇到一个实际问题:
1) 默认会优先走 browser-assisted(camoufox/playwright headed),在无 DISPLAY 的环境直接失败;
2) 即使切到纯 HTTP flow(终端字符二维码),远程扫码也很难:字符画二维码在聊天工具里容易压缩/换行,手机端识别率低,而且有效期只有约 4 分钟,经常来不及确认。
能否考虑增加几个能力来更适配 headless/remote:
- `--qrcode-image /path/to.png`:把二维码保存成 PNG(或输出 base64),方便远程传输扫码
- `--prefer-http` 或 `--no-browser`:明确禁用 browser-assisted(避免在 server 上拉 700MB 浏览器依赖)
- `--timeout` 可配置(默认 4 分钟太短)
- 或者在输出里同时打印 `QR URL`(方便转成图片/在其他设备打开)
如果需要我可以提供报错堆栈和环境信息。
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with `python -m xhs_cli login --qrcode` and inspect the login command's browser-assisted and HTTP flows. The issue names no files or tests, and its several alternative requests need scope clarified before implementation. Done should include a reliable headless/remote QR-login path with the selected image, browser, timeout, or URL behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- playwright, python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100