auto-douyin

抖音视频自动发布技能。当用户需要发布视频到抖音时使用这个技能。技能包含:获取登录Cookie、上传视频、设置标题话题、定时发布等功能。

154 stars

Best use case

auto-douyin is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

抖音视频自动发布技能。当用户需要发布视频到抖音时使用这个技能。技能包含:获取登录Cookie、上传视频、设置标题话题、定时发布等功能。

Teams using auto-douyin should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/auto-douyin/SKILL.md --create-dirs "https://raw.githubusercontent.com/zrt-ai-lab/opencode-skills/main/auto-douyin/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/auto-douyin/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How auto-douyin Compares

Feature / Agentauto-douyinStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

抖音视频自动发布技能。当用户需要发布视频到抖音时使用这个技能。技能包含:获取登录Cookie、上传视频、设置标题话题、定时发布等功能。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 抖音视频自动发布技能

这个技能用于自动化发布视频到抖音创作者中心。

## 使用场景

- 用户需要发布视频到抖音时
- 用户说"发抖音"、"上传抖音"、"发布到抖音"时
- 用户有视频文件需要分发到抖音平台时

## 技术原理

基于 Playwright 浏览器自动化,模拟真实用户操作抖音创作者中心(https://creator.douyin.com):
1. 首次使用需扫码登录,保存 Cookie
2. 后续使用 Cookie 自动登录
3. 自动化填充标题、话题、封面等信息
4. 支持定时发布

## 前置条件

### 1. 安装依赖

```bash
pip install playwright
playwright install chromium
```

### 2. 首次登录获取 Cookie

```bash
python .opencode/skills/auto-douyin/scripts/get_cookie.py
```

执行后会打开浏览器,使用抖音 APP 扫码登录,登录成功后 Cookie 会自动保存。

## 工作流程

### 第一步:确认登录状态

检查 Cookie 是否存在且有效:

```bash
python .opencode/skills/auto-douyin/scripts/check_cookie.py
```

如果 Cookie 失效,需要重新获取:

```bash
python .opencode/skills/auto-douyin/scripts/get_cookie.py
```

### 第二步:准备视频文件

视频文件要求:
- 格式:`.mp4`(推荐)
- 分辨率:建议 1080x1920(竖版 9:16)
- 文件大小:建议不超过 4GB

可选:准备同名的封面图片(`.png` 或 `.jpg`)

### 第三步:发布视频

```bash
python .opencode/skills/auto-douyin/scripts/publish.py \
    --video "视频文件路径" \
    --title "视频标题" \
    --tags "话题1,话题2,话题3" \
    [--cover "封面图片路径"] \
    [--schedule "2025-01-31 18:00"]
```

#### 参数说明

| 参数 | 简写 | 说明 | 必填 |
|------|------|------|------|
| `--video` | `-v` | 视频文件路径 | ✅ |
| `--title` | `-t` | 视频标题(最多30字) | ✅ |
| `--tags` | `-g` | 话题标签,逗号分隔 | ❌ |
| `--cover` | `-c` | 封面图片路径 | ❌ |
| `--schedule` | `-s` | 定时发布时间(格式:YYYY-MM-DD HH:MM) | ❌ |
| `--headless` | | 无头模式运行(不显示浏览器) | ❌ |

#### 使用示例

```bash
# 立即发布,自动生成封面
python .opencode/skills/auto-douyin/scripts/publish.py \
    -v ~/Videos/demo.mp4 \
    -t "今天学到一个超实用的技巧" \
    -g "干货分享,效率提升,学习"

# 定时发布,指定封面
python .opencode/skills/auto-douyin/scripts/publish.py \
    -v ~/Videos/demo.mp4 \
    -t "周末vlog|一个人的惬意时光" \
    -g "vlog,周末日常,生活记录" \
    -c ~/Videos/demo_cover.png \
    -s "2025-02-01 18:00"

# 无头模式(后台运行)
python .opencode/skills/auto-douyin/scripts/publish.py \
    -v ~/Videos/demo.mp4 \
    -t "测试视频" \
    --headless
```

## 目录结构

```
.opencode/skills/auto-douyin/
├── skill.md              # 技能说明文档
├── scripts/
│   ├── get_cookie.py     # 获取登录 Cookie
│   ├── check_cookie.py   # 检查 Cookie 有效性
│   └── publish.py        # 发布视频主脚本
└── cookies/
    └── douyin.json       # Cookie 存储文件(自动生成)
```

## 注意事项

1. **Cookie 有效期**:Cookie 通常有效期较长,但如果长时间未使用或平台更新,可能需要重新登录
2. **发布频率**:建议控制发布频率,避免被平台识别为异常行为
3. **标题限制**:抖音标题最多30字,超出会自动截断
4. **话题数量**:建议添加3-5个相关话题,提高曝光
5. **封面选择**:如不指定封面,系统会自动从视频中选取推荐封面
6. **定时发布**:定时发布时间需在当前时间之后,且在平台允许的时间范围内

## 常见问题

### Q: Cookie 失效怎么办?
A: 重新运行 `get_cookie.py` 扫码登录即可。

### Q: 上传失败怎么办?
A: 检查网络连接,确认视频文件格式正确,查看脚本输出的错误信息。

### Q: 如何批量发布?
A: 可以编写循环脚本,依次调用 `publish.py`,建议每次发布间隔几分钟。

## 参考项目

本技能参考了 [social-auto-upload](https://github.com/dreammis/social-auto-upload) 项目的实现。

Related Skills

videocut-subtitle

154
from zrt-ai-lab/opencode-skills

字幕生成与烧录。转录→词典纠错→审核→烧录。触发词:加字幕、生成字幕、字幕

videocut-self-update

154
from zrt-ai-lab/opencode-skills

自更新 skills。记录用户反馈,更新方法论和规则。触发词:更新规则、记录反馈、改进skill

videocut-install

154
from zrt-ai-lab/opencode-skills

环境准备。安装依赖、下载模型、验证环境。触发词:安装、环境准备、初始化

videocut-clip

154
from zrt-ai-lab/opencode-skills

执行视频剪辑。根据确认的删除任务执行FFmpeg剪辑,循环直到零口误,生成字幕。触发词:执行剪辑、开始剪、确认剪辑

videocut-clip-oral

154
from zrt-ai-lab/opencode-skills

口播视频转录和口误识别。生成审查稿和删除任务清单。触发词:剪口播、处理视频、识别口误

video-subtitle-remover

154
from zrt-ai-lab/opencode-skills

视频硬字幕/水印去除技能。自动配置基于 YaoFANGUK/video-subtitle-remover 的环境并执行去字幕。当用户要求"去除视频字幕"、"去水印"、"把这个视频的字幕干掉"时触发此技能。

video-stickfigure

154
from zrt-ai-lab/opencode-skills

火柴人图片生成技能。使用AI生成粉笔画风格火柴人,并用HSV统一背景色。当需要生成火柴人视频素材时触发。

video-creator

154
from zrt-ai-lab/opencode-skills

视频创作技能。图片+音频合成视频,支持TTS配音、淡入淡出转场、字幕、片尾、BGM。当用户提到「生成视频」「做视频」「教学视频」「图文转视频」「做视频号」「配音视频」「图文结合视频」「古诗视频」「故事视频」时触发。内含生图→配音→合成全流程,无需单独调用image-service。

video-copywriting

154
from zrt-ai-lab/opencode-skills

短视频文案创作技能。包含爆款公式、黄金结构、三关校验。当需要撰写短视频文案时触发。

uni-agent

154
from zrt-ai-lab/opencode-skills

统一智能体协议适配层。一套 API 调用所有 Agent 协议(ANP/MCP/A2A/AITP 等)。当用户需要调用 Agent、跨协议通信、连接工具时触发此技能。

story-to-scenes

154
from zrt-ai-lab/opencode-skills

长文本拆镜批量生图引擎。将故事、课程、连环画脚本智能拆分场景,批量生成风格统一、角色一致的配图。当用户提到「拆镜生图」「故事配图」「批量场景图」「连环画生成」「绘本生成」时使用此技能。

smart-query

154
from zrt-ai-lab/opencode-skills

智能数据库查询技能。通过SSH隧道连接线上数据库,支持自然语言转SQL、执行查询、表结构探索。当用户需要查询数据库、问数据、看表结构时使用此技能。