mcpField
D
douyin-video-summary

douyin-video-summary

github.com/liu-wei-ai生产力21.8k 次安装37 周前更新
代码仓库

关于 douyin-video-summary

这项工作流技能通过提取音频、使用 whisper.cpp 本地转录并生成结构化摘要来整理抖音视频,适合需要视频文字概要的人;配置 Feishu 后还可同步文档。

主要功能

  1. 01通过浏览器提取音频网址
  2. 02使用 ffmpeg 转换为 WAV
  3. 03使用 whisper.cpp 本地转录
  4. 04生成结构化视频摘要
  5. 05可选将摘要追加到 Feishu

适用场景

  1. 01为抖音视频生成文字概要
  2. 02本地转录中文视频音频
  3. 03将视频摘要追加到 Feishu 文档

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/liu-wei-ai/douyin-video-summary --skill douyin-video-summary

安装后在 Claude Code 中输入/douyin-video-summary确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
feishu-sync.md
scripts/
transcribe.sh
download_audio.sh

详细介绍

抖音视频摘要

总结抖音视频:提取音频 → 本地转录 → AI 摘要。

前置条件

安装以下工具(以 macOS 为例):

brew install whisper-cpp ffmpeg
# Download whisper.cpp GGML model (small recommended for speed/quality balance)
curl -L -o models/ggml-small.bin "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin"

工作流

收到抖音链接时:

步骤 1:提取视频 ID

解析抖音 URL,获取视频 ID。抖音分享链接有两种格式:

  • 短链接:https://v.douyin.com/xxxxx/ → 跟随重定向获取视频 ID
  • 直接链接:https://www.douyin.com/video/7604713801732365681
# Follow redirect to get final URL, extract numeric video ID
curl -sL -o /dev/null -w '%{url_effective}' 'https://v.douyin.com/xxxxx/' | grep -oE '[0-9]{15,}'
步骤 2:通过浏览器获取音频

抖音会阻止直接下载(yt-dlp、aria2c 都会收到 403)。使用浏览器拦截音频 URL:

  1. 在浏览器中打开抖音视频页面
  2. 在导航前注入 JS,拦截网络请求:
window.__audioUrls = [];
const origOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function(method, url) {
  if (url && (url.includes('.mp3') || url.includes('.m4a') || url.includes('mime_type=audio'))) {
    window.__audioUrls.push(url);
  }
  return origOpen.apply(this, arguments);
};
  1. 导航到视频页面,点击播放以触发音频加载
  2. 获取拦截到的 URL:window.__audioUrls
  3. 使用 curl 下载(需要 Referer 标头):
curl -H "Referer: https://www.douyin.com/" -o audio.mp4 "<audio_url>"

重要: aria2c 下载抖音 CDN URL 时会收到 403。务必使用带有 Referer 标头的 curl。

步骤 3:转换为 WAV
ffmpeg -i audio.mp4 -ar 16000 -ac 1 -c:a pcm_s16le audio.wav
步骤 4:使用 whisper.cpp 转录
whisper-cli -m /path/to/ggml-small.bin -l zh -f audio.wav -otxt -of output
  • 中文内容使用 -l zh(不确定时自动检测)
  • Apple Silicon GPU 加速会自动启用(Metal)
  • 性能:在 M4 上转录 5 分钟音频约需 20 秒
步骤 5:生成摘要

阅读转录文本并生成结构化摘要:

📹 **[Video Title] | [Author]**
时长:X分X秒 | 发布:YYYY-MM-DD

🎯 **核心观点:[one-line core message]**

**1. [Point 1 title]**
• [detail]
• [detail]

**2. [Point 2 title]**
• [detail]

💬 **一句话总结:[concise takeaway]**
步骤 6(可选):同步到飞书文档

如果已配置飞书集成,使用飞书开放平台 API 将摘要追加到飞书文档。API 详情请参阅 references/feishu-sync.md。

提示

  • 对于较短的视频(<1min),摘要可能非常简短,这是正常的
  • 如果浏览器拦截失败,再试一次;抖音页面有时需要重新加载一次
  • 处理完成后清理下载的音频/WAV 文件,以节省磁盘空间
  • whisper.cpp small 模型在速度和质量之间最为均衡;medium 模型在 8GB 设备上可能会因内存不足而失败

评论

支持 Markdown