# douyin-video-extractor **Repository Path**: pplus_open_source/douyin-video-extractor ## Basic Information - **Project Name**: douyin-video-extractor - **Description**: 抖音视频内容提取工具 — 无水印下载 + 语音识别转文案 直接调用抖音公开 API,无需第三方服务。脚本负责数据采集,AI agent 负责内容分析。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-14 - **Last Updated**: 2026-07-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🎬 douyin-video-extractor 抖音视频内容提取工具 — 无水印下载 + 语音识别转文案 直接调用抖音公开 API,无需第三方服务。脚本负责数据采集,AI agent 负责内容分析。 ## ✨ 功能 | 能力 | 实现方式 | |------|----------| | 📥 无水印视频下载 | 抖音 API + 链接替换 | | 🖼️ 封面提取 | ffmpeg 截取首帧 | | 🔊 音频提取 | ffmpeg 转 MP3 | | 🗣️ 语音识别转文案 | SiliconFlow / OpenAI 兼容接口 | | 💡 金句提取、内容讲解 | **由 AI agent 生成**(非脚本输出) | ## ⚡ 一键安装 直接告诉你的 AI 编程工具: > 帮我安装这个 skill:https://github.com/lenslp/douyin-video-extractor 各 Agent 操作: | Agent | 你说 | Agent 做什么 | |-------|------|-------------| | **OpenClaw** | 「帮我安装 skills https://github.com/lenslp/douyin-video-extractor」 | clone 到 `~/.openclaw/workspace/skills/`,通过 SKILL.md 自动识别 | | **Codex** | 「clone 这个仓库到 .agents/skills/douyin-video-extractor」 | clone 到项目级 `.agents/skills/`,自动识别 SKILL.md | | **Claude Code** | 「clone https://github.com/lenslp/douyin-video-extractor 到项目里」 | clone 到项目目录,对话中直接调用 | 安装后直接说「解析这个抖音链接:https://v.douyin.com/xxx」即可。 ### 手动安装 ```bash git clone https://github.com/lenslp/douyin-video-extractor.git cd douyin-video-extractor pip install -r requirements.txt brew install ffmpeg # macOS,或 sudo apt-get install ffmpeg ``` ## 📋 命令说明 | 命令 | 说明 | 需要 API Key | |------|------|:---:| | `info` | 获取视频基本信息和下载链接 | ❌ | | `download` | 下载无水印视频 | ❌ | | `extract` | 下载视频 + 提取音频/封面 + 语音识别转文案 | ✅ | ```bash # 获取视频信息 python scripts/douyin_extractor.py info "https://v.douyin.com/xxx" # 下载无水印视频 python scripts/douyin_extractor.py download "https://v.douyin.com/xxx" -o ./videos # 完整提取(需要配置 API Key) python scripts/douyin_extractor.py extract "https://v.douyin.com/xxx" -o ./output ``` ## 🔑 环境变量配置 `info` 和 `download` 命令无需配置。`extract` 命令需要配置语音识别 API: ```bash # 方案1:硅基流动(推荐,免费额度够用) export DOUYIN_TRANSCRIBE_PROVIDER="siliconflow" export DOUYIN_API_KEY="你的key" # 方案2:OpenAI 兼容接口 export DOUYIN_TRANSCRIBE_PROVIDER="openai-compatible" export DOUYIN_API_KEY="你的key" export DOUYIN_API_BASE_URL="https://api.openai.com/v1/audio/transcriptions" export DOUYIN_TRANSCRIBE_MODEL="whisper-1" # 方案3:禁用转写,仅解析/下载 export DOUYIN_TRANSCRIBE_PROVIDER="none" ``` 建议加到 `~/.zshrc` 或 `~/.bashrc` 中持久化。 ## 📄 输出示例 `extract` 命令返回 JSON 数据,AI agent 基于数据生成 Markdown 文档。 **脚本输出(JSON):** ```json { "video_info": { "video_id": "7342918392748299524", "title": "小个子女生如何逆袭第一眼大美女", "url": "https://sns-video-bd.xhscdn.com/xxx.mp4" }, "media_info": { "duration": 156.36, "size": 15728640 }, "text_content": "小个子女生真的不要再和别人卷身高上的天赋...", "cover_path": "./output/7342918392748299524/7342918392748299524.jpg" } ``` **Agent 生成的 Markdown 文档(示意):** ```markdown # 视频内容分析 ## 视频基本信息 - **标题**:小个子女生如何逆袭第一眼大美女 - **视频ID**:7342918392748299524 - **时长**:156.36秒 ## 视频金句 > 小个子女生真的不要再和别人卷身高上的天赋,这是天生注定的。 ## 原始文案 小个子女生真的不要再和别人卷身高上的天赋,这是天生注定的... ## 内容讲解 (由 AI 基于文案内容分析生成) ``` > ⚠️ 金句提取、内容讲解、数据说明等章节由 AI agent 生成,非脚本直接输出。 ## 🤖 OpenClaw 使用说明 本仓库是 OpenClaw 原生 Skill,包含 `SKILL.md` 文件。OpenClaw 通过读取 `SKILL.md` 自动识别工具能力和触发条件。 **安装后的工作流程:** 1. 用户说「解析这个抖音链接」 2. OpenClaw 匹配到 `douyin-video-extractor` skill 3. 读取 SKILL.md 获取使用方法 4. 调用 `scripts/douyin_extractor.py extract <链接>` 5. 基于返回的 JSON 数据生成 Markdown 分析文档 **SKILL.md 的作用:** `SKILL.md` 是给 AI agent 读的说明书,包含: - 技能描述和触发条件 - 前置准备(环境变量、依赖) - 操作步骤和参数说明 - 使用示例和注意事项 ## 🔧 技术实现 - **视频解析**:调用抖音 `aweme/v1/web/aweme/detail/` API - **无水印处理**:播放链接 `playwm` → `play` - **音频/封面**:ffmpeg 提取 - **语音识别**:默认 SiliconFlow SenseVoice,支持 OpenAI 兼容接口 ## 📊 与第三方服务对比 | 特性 | 本工具 | 第三方 API 服务 | |------|--------|----------------| | 外部依赖 | 无 | 依赖第三方 | | 视频质量 | 原画质 | 可能压缩 | | 水印 | 无 | 可能残留 | | 成本 | 仅语音识别费用 | 按次收费 | ## ⚠️ 免责声明 仅供学习和研究使用。请遵守抖音用户协议和相关法律法规,下载内容版权归原作者,请勿商用。 ## 📝 License [MIT](LICENSE)