jianying-video-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese剪映 AI 视频生成器
Jianying AI Video Generator
通过 Playwright 自动化操作剪映(xyq.jianying.com),使用 Seedance 2.0 模型生成 AI 视频。
Automate operations on Jianying (xyq.jianying.com) via Playwright to generate AI videos using the Seedance 2.0 model.
前置条件
Prerequisites
- Python 3.9+ + 已安装
playwright - Chromium 已通过 安装
playwright install chromium - cookies.json — 剪映登录凭证(从浏览器导出),放在脚本同目录下
bash
pip install playwright && playwright install chromium- Python 3.9+ and installed
playwright - Chromium installed via
playwright install chromium - cookies.json — Jianying login credential (exported from browser), placed in the same directory as the script
bash
pip install playwright && playwright install chromium核心脚本
Core Script
scripts/jianying_worker.pyscripts/jianying_worker.py使用方式
Usage
文生视频 (T2V)
Text to Video (T2V)
bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--prompt "赛博朋克风格的长安城,飞行汽车穿梭在霓虹灯笼之间" \
--duration 10s \
--model "Seedance 2.0"bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--prompt "赛博朋克风格的长安城,飞行汽车穿梭在霓虹灯笼之间" \
--duration 10s \
--model "Seedance 2.0"图生视频 (I2V)
Image to Video (I2V)
bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--ref-image /path/to/image.png \
--prompt "将这张图片变成动画,镜头从左向右缓慢平移" \
--duration 10s \
--model "Seedance 2.0 Fast"bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--ref-image /path/to/image.png \
--prompt "将这张图片变成动画,镜头从左向右缓慢平移" \
--duration 10s \
--model "Seedance 2.0 Fast"参考视频生成 (V2V)
Reference Video to Video (V2V)
bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--ref-video /path/to/reference.mp4 \
--prompt "画风改成宫崎骏风格,其他不变" \
--duration 10s \
--model "Seedance 2.0"bash
python3 scripts/jianying_worker.py \
--cookies /path/to/cookies.json \
--output-dir /path/to/output \
--ref-video /path/to/reference.mp4 \
--prompt "画风改成宫崎骏风格,其他不变" \
--duration 10s \
--model "Seedance 2.0"Dry-Run 模式(调试用)
Dry-Run Mode (for debugging)
bash
python3 scripts/jianying_worker.py --cookies /path/to/cookies.json --prompt "测试" --dry-run只填写表单不提交,生成截图供检查。step_*.png
bash
python3 scripts/jianying_worker.py --cookies /path/to/cookies.json --prompt "测试" --dry-runOnly fill the form without submission, generatescreenshots for inspection.step_*.png
参数说明
Parameter Description
| 参数 | 默认值 | 可选值 | 说明 |
|---|---|---|---|
| "一个美女在跳舞" | 任意文本 | 视频描述 |
| | | 视频时长 |
| | | 画面比例 |
| | | 模型选择 |
| 无 | 本地图片路径 | I2V 模式的参考图片 |
| 无 | 本地视频路径 | V2V 模式的参考视频 |
| | 文件路径 | 剪映登录凭证路径 |
| | 目录路径 | 输出视频保存目录 |
| false | - | 只填表不提交 |
| Parameter | Default Value | Optional Values | Description |
|---|---|---|---|
| "A beautiful woman is dancing" | Any text | Video description |
| | | Video duration |
| | | Aspect ratio |
| | | Model selection |
| None | Local image path | Reference image for I2V mode |
| None | Local video path | Reference video for V2V mode |
| | File path | Jianying login credential path |
| | Directory path | Output video saving directory |
| false | - | Only fill form without submission |
模型与积分
Model and Points
| 模型 | 积分/秒 | 5s | 10s | 15s | 特点 |
|---|---|---|---|---|---|
| Seedance 2.0 Fast | 3 | 15 | 30 | 45 | 快速,适合测试 |
| Seedance 2.0 | 5 | 25 | 50 | 75 | 高质量,正式出片 |
| Model | Points per second | 5s | 10s | 15s | Features |
|---|---|---|---|---|---|
| Seedance 2.0 Fast | 3 | 15 | 30 | 45 | Fast, suitable for testing |
| Seedance 2.0 | 5 | 25 | 50 | 75 | High quality, for formal production |
自动化流程
Automation Process
登录(cookies) → 新建 → 沉浸式短片 → 选模型 → [上传参考视频] → 选时长 → 输入Prompt → 提交
→ 拦截 thread_id → 导航详情页 → 轮询视频 → curl 下载 MP4Login(cookies) → New project → Immersive short film → Select model → [Upload reference video] → Select duration → Enter Prompt → Submit
→ Intercept thread_id → Navigate to detail page → Poll for video → curl download MP4提示词编写指南
Prompt Writing Guide
详细的提示词示例和编写技巧参见 。
references/prompt-guide.mdFor detailed prompt examples and writing tips, refer to .
references/prompt-guide.md常见问题
FAQ
Q: cookies 过期了怎么办?
在浏览器登录 xyq.jianying.com,使用 EditThisCookie 等扩展导出 cookies.json。
Q: 下载 403?
脚本使用 thread_id 详情页 + curl 下载,CDN 链接无需 cookie。如仍失败检查网络。
Q: 上传参考视频很慢?
正常,8MB 视频约需 60-90 秒。脚本会自动等待最多 5 分钟。
Q: What to do if cookies expire?
Log in to xyq.jianying.com in your browser, export cookies.json using extensions like EditThisCookie.
Q: Encounter 403 error when downloading?
The script uses thread_id detail page + curl for downloading, CDN links do not require cookies. If it still fails, check your network.
Q: Is uploading reference video very slow?
It is normal, an 8MB video takes about 60-90 seconds. The script will automatically wait for up to 5 minutes.