重构douyin上传,增加douyin图文
修复douyin视频封面上传
This commit is contained in:
+153
@@ -0,0 +1,153 @@
|
||||
# 安装说明
|
||||
|
||||
这个文档分成两部分:
|
||||
|
||||
- `For Humans`:给正常使用仓库的开发者、创作者、CLI 用户看
|
||||
- `For AI Agents`:给 OpenClaw、Codex、Claude Code 一类 agent 看
|
||||
|
||||
## For Humans
|
||||
|
||||
### 1. 克隆项目
|
||||
|
||||
```bash
|
||||
git clone https://github.com/dreammis/social-auto-upload.git
|
||||
cd social-auto-upload
|
||||
```
|
||||
|
||||
### 2. 创建虚拟环境
|
||||
|
||||
推荐使用 `uv`:
|
||||
|
||||
Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
uv venv
|
||||
.venv\Scripts\activate
|
||||
```
|
||||
|
||||
Linux / macOS:
|
||||
|
||||
```bash
|
||||
uv venv
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
### 3. 安装主线依赖
|
||||
|
||||
当前主线依赖已经放到 `pyproject.toml`,推荐直接执行:
|
||||
|
||||
```bash
|
||||
uv pip install -e .
|
||||
```
|
||||
|
||||
安装完成后,会注册 `sau` 命令。
|
||||
|
||||
### 4. 安装 patchright Chromium
|
||||
|
||||
当前主线使用 `patchright` 驱动浏览器。
|
||||
|
||||
国内用户推荐先指定镜像,再安装 Chromium。
|
||||
|
||||
Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
$env:PLAYWRIGHT_DOWNLOAD_HOST="https://npmmirror.com/mirrors/playwright"; patchright install chromium
|
||||
```
|
||||
|
||||
Linux / macOS:
|
||||
|
||||
```bash
|
||||
PLAYWRIGHT_DOWNLOAD_HOST="https://npmmirror.com/mirrors/playwright" patchright install chromium
|
||||
```
|
||||
|
||||
### 5. 配置 conf.py
|
||||
|
||||
复制一份配置:
|
||||
|
||||
```bash
|
||||
cp conf.example.py conf.py
|
||||
```
|
||||
|
||||
Windows 也可以直接手动复制并重命名。
|
||||
|
||||
当前通常还会用到这些配置项:
|
||||
|
||||
- `LOCAL_CHROME_PATH`
|
||||
- `LOCAL_CHROME_HEADLESS`
|
||||
- `DEBUG_MODE`
|
||||
|
||||
`XHS_SERVER` 目前只和小红书旧流程相关。
|
||||
|
||||
### 6. 验证 CLI 是否可用
|
||||
|
||||
```bash
|
||||
sau --help
|
||||
sau douyin --help
|
||||
```
|
||||
|
||||
如果命令找不到,优先确认:
|
||||
|
||||
- 当前虚拟环境是否已激活
|
||||
- 是否执行过 `uv pip install -e .`
|
||||
|
||||
### 7. 抖音主线示例
|
||||
|
||||
```bash
|
||||
sau douyin login --account creator
|
||||
sau douyin check --account creator
|
||||
sau douyin upload-video --account creator --file videos/demo.mp4 --title "示例标题"
|
||||
```
|
||||
|
||||
## For AI Agents
|
||||
|
||||
如果你是一个可执行命令的 agent,请优先按下面顺序处理:
|
||||
|
||||
1. 先假设仓库根目录就是当前工作目录
|
||||
2. 优先使用 `uv` 管理环境,不要默认回退到旧的 `requirements.txt`
|
||||
3. 安装命令优先使用:
|
||||
|
||||
```bash
|
||||
uv pip install -e .
|
||||
```
|
||||
|
||||
4. 如需浏览器驱动,优先使用:
|
||||
|
||||
Windows PowerShell:
|
||||
|
||||
```powershell
|
||||
$env:PLAYWRIGHT_DOWNLOAD_HOST="https://npmmirror.com/mirrors/playwright"; patchright install chromium
|
||||
```
|
||||
|
||||
Linux / macOS:
|
||||
|
||||
```bash
|
||||
PLAYWRIGHT_DOWNLOAD_HOST="https://npmmirror.com/mirrors/playwright" patchright install chromium
|
||||
```
|
||||
|
||||
5. 安装完成后,优先检查:
|
||||
|
||||
```bash
|
||||
sau --help
|
||||
sau douyin --help
|
||||
```
|
||||
|
||||
6. 如果用户的目标是抖音登录、cookie 校验、视频上传、图文上传,优先走 CLI:
|
||||
|
||||
```bash
|
||||
sau douyin login
|
||||
sau douyin check
|
||||
sau douyin upload-video
|
||||
sau douyin upload-note
|
||||
```
|
||||
|
||||
7. 如果用户明确在使用 skill 系统,再引导其阅读:
|
||||
|
||||
- `skills/douyin-upload/SKILL.md`
|
||||
- `skills/douyin-upload/references/cli-contract.md`
|
||||
|
||||
### 对 agent 的额外说明
|
||||
|
||||
- `requirements.txt` 目前是历史兼容文件,不是主安装入口
|
||||
- `uploader/` 是核心实现目录
|
||||
- `sau_cli.py` 是当前 CLI 主入口
|
||||
- `docs/legacy-web.md` 是历史 Web 版本说明,不保证当前可用
|
||||
Reference in New Issue
Block a user