Files
ai_xhs/readme.md
2025-12-08 15:27:00 +08:00

31 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1. 安装依赖
pip install -r requirements.txt
2. 安装 Playwright 浏览器驱动
playwright install chromium
3. 文件结构说明
├── main.py # 主入口,选择登录模式
├── scan_qrcode.py # 扫码登录并自动发文,首次登录/刷新 cookie 用
├── use_cookie.py # 使用已保存 cookie 自动发文
├── util.py # cookie 保存与加载 工具
├── requirements.txt # 依赖包列表
├── test/ # 发文内容文件夹
│ ├── title.txt # 标题
│ ├── desc.txt # 正文
│ └── *.jpg/png/... # 图片(支持多图)
4. 使用方法
- 首次登录或 cookie 失效时,运行 main.py选择【1 扫码登录】,扫码后自动保存 cookie 并发文。
- 后续可直接选择【2 使用已保存 cookie 自动发文】,无需再次扫码。
- 发文内容请放在 test 文件夹,支持多张图片。
5. 常见问题
- cookies.json 文件丢失或无效时,必须重新扫码登录。
- Playwright 导入失败请检查依赖安装。
6. 运行示例
python main.py