video-summarizer by liang121/video-summarizer
npx skills add https://github.com/liang121/video-summarizer --skill video-summarizer从任意平台下载视频并生成完整的资源包,包括:
支持 yt-dlp 支持的所有 1800+ 个网站。
当用户:
所有文件都保存在当前工作目录下的 downloads/<视频标题>/ 中:
./downloads/
└── <video-title>/
├── video.mp4 # 原始视频
├── audio.mp3 # 提取的音频
├── subtitle.vtt # 带时间戳的字幕
├── transcript.txt # 纯文本转录稿 (无时间戳)
└── summary.md # 结构化摘要
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
运行安装脚本以检查和安装所有依赖项:
bash "$SKILL_DIR/scripts/install_deps.sh"
这将安装:uv (Python 包管理器)、ffmpeg、yt-dlp,并检查 Python 版本。faster-whisper 将由 uv 自动管理。
# 获取视频标题 (为文件夹名称清理特殊字符)
TITLE=$(yt-dlp --print "%(title)s" "VIDEO_URL" | sed 's/[/:*?"<>|]/_/g' | cut -c1-80)
DURATION=$(yt-dlp --print "%(duration)s" "VIDEO_URL")
# 创建输出目录
OUTPUT_DIR=./downloads/"$TITLE"
mkdir -p "$OUTPUT_DIR"
# 下载视频 (mp4 格式,最高 1080p 的最佳质量)
yt-dlp -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best" \
--merge-output-format mp4 \
-o "$OUTPUT_DIR/video.%(ext)s" "VIDEO_URL"
# 提取音频 (mp3 格式)
yt-dlp -x --audio-format mp3 -o "$OUTPUT_DIR/audio.%(ext)s" "VIDEO_URL"
优先级顺序:
yt-dlp --write-subs --sub-lang zh,en,zh-Hans,zh-Hant --skip-download \
-o "$OUTPUT_DIR/subtitle" "VIDEO_URL"
2. 尝试下载自动生成的字幕
yt-dlp --write-auto-subs --sub-lang zh,en --skip-download \
-o "$OUTPUT_DIR/subtitle" "VIDEO_URL"
3. 当无字幕可用时,使用 faster-whisper 进行转录
uv run "$SKILL_DIR/scripts/parallel_transcribe.py" \
--input "$OUTPUT_DIR/audio.mp3" \
--output-dir "$OUTPUT_DIR" \
--model small \
--language auto
脚本自动执行:
subtitle.vtt 和 transcript.txt转录选项:
| 选项 | 默认值 | 描述 |
|---|---|---|
--model | small | tiny/base/small/medium/large-v3 |
--language | auto | 语言代码或 'auto' |
--workers | CPU/2 | 并行工作线程数 |
--min-segment | 60 | 启用分割的最小时长 (秒) |
如果下载了字幕 (非转录),则转换为纯文本:
if [[ ! -f "$OUTPUT_DIR/transcript.txt" ]]; then
SUBTITLE_FILE=$(ls "$OUTPUT_DIR"/*.vtt "$OUTPUT_DIR"/*.srt 2>/dev/null | head -1)
if [[ "$SUBTITLE_FILE" == *.vtt ]]; then
sed '/^[0-9]/d; /^$/d; /-->/d; /^WEBVTT/d; /^Kind:/d; /^Language:/d; /^NOTE/d' \
"$SUBTITLE_FILE" > "$OUTPUT_DIR/transcript.txt"
elif [[ "$SUBTITLE_FILE" == *.srt ]]; then
sed '/^[0-9]/d; /^$/d; /-->/d' "$SUBTITLE_FILE" > "$OUTPUT_DIR/transcript.txt"
fi
fi
$SKILL_DIR/reference/summary-prompt.md 读取提示模板{{TITLE}}、{{PLATFORM}}、{{URL}}、{{DURATION}}、{{LANGUAGE}}、{{DOWNLOAD_TIME}}、{{TRANSCRIPT}}$OUTPUT_DIR/summary.md# 优先中文字幕
yt-dlp --sub-lang zh-Hans,zh-Hant,zh ...
# 如果需要登录
yt-dlp --cookies-from-browser chrome "VIDEO_URL"
yt-dlp --cookies-from-browser chrome "VIDEO_URL"
# 或 firefox
yt-dlp --cookies-from-browser firefox "VIDEO_URL"
使用并行转录脚本 (步骤 4,选项 3)。
yt-dlp --list-extractors | grep -i "platform-name"
./downloads/每周安装量
231
代码仓库
GitHub 星标数
15
首次出现
2026年2月4日
安全审计
安装于
opencode230
gemini-cli229
codex228
cursor228
kimi-cli227
amp227
Download videos from any platform and generate a complete resource package including:
Supports all 1800+ websites supported by yt-dlp.
When the user:
All files are saved to downloads/<video-title>/ in the current working directory :
./downloads/
└── <video-title>/
├── video.mp4 # Original video
├── audio.mp3 # Extracted audio
├── subtitle.vtt # Subtitles with timestamps
├── transcript.txt # Plain text transcript (no timestamps)
└── summary.md # Structured summary
Run the install script to check and install all dependencies:
bash "$SKILL_DIR/scripts/install_deps.sh"
This installs: uv (Python package manager), ffmpeg, yt-dlp, and checks Python version. faster-whisper will be automatically managed by uv.
# Get video title (sanitize special characters for folder name)
TITLE=$(yt-dlp --print "%(title)s" "VIDEO_URL" | sed 's/[/:*?"<>|]/_/g' | cut -c1-80)
DURATION=$(yt-dlp --print "%(duration)s" "VIDEO_URL")
# Create output directory
OUTPUT_DIR=./downloads/"$TITLE"
mkdir -p "$OUTPUT_DIR"
# Download video (mp4 format, best quality up to 1080p)
yt-dlp -f "bestvideo[height<=1080][ext=mp4]+bestaudio[ext=m4a]/best[height<=1080][ext=mp4]/best" \
--merge-output-format mp4 \
-o "$OUTPUT_DIR/video.%(ext)s" "VIDEO_URL"
# Extract audio (mp3 format)
yt-dlp -x --audio-format mp3 -o "$OUTPUT_DIR/audio.%(ext)s" "VIDEO_URL"
Priority order:
yt-dlp --write-subs --sub-lang zh,en,zh-Hans,zh-Hant --skip-download \
-o "$OUTPUT_DIR/subtitle" "VIDEO_URL"
2. Try downloading auto-generated subtitles
yt-dlp --write-auto-subs --sub-lang zh,en --skip-download \
-o "$OUTPUT_DIR/subtitle" "VIDEO_URL"
3. Use faster-whisper transcription when no subtitles available
uv run "$SKILL_DIR/scripts/parallel_transcribe.py" \
--input "$OUTPUT_DIR/audio.mp3" \
--output-dir "$OUTPUT_DIR" \
--model small \
--language auto
The script automatically:
subtitle.vtt and transcript.txtTranscription Options :
| Option | Default | Description |
|---|---|---|
--model | small | tiny/base/small/medium/large-v3 |
--language | auto | Language code or 'auto' |
--workers | CPU/2 | Number of parallel workers |
--min-segment | 60 | Min duration (sec) to enable splitting |
If subtitles were downloaded (not transcribed), convert to plain text:
if [[ ! -f "$OUTPUT_DIR/transcript.txt" ]]; then
SUBTITLE_FILE=$(ls "$OUTPUT_DIR"/*.vtt "$OUTPUT_DIR"/*.srt 2>/dev/null | head -1)
if [[ "$SUBTITLE_FILE" == *.vtt ]]; then
sed '/^[0-9]/d; /^$/d; /-->/d; /^WEBVTT/d; /^Kind:/d; /^Language:/d; /^NOTE/d' \
"$SUBTITLE_FILE" > "$OUTPUT_DIR/transcript.txt"
elif [[ "$SUBTITLE_FILE" == *.srt ]]; then
sed '/^[0-9]/d; /^$/d; /-->/d' "$SUBTITLE_FILE" > "$OUTPUT_DIR/transcript.txt"
fi
fi
$SKILL_DIR/reference/summary-prompt.md{{TITLE}}, {{PLATFORM}}, {{URL}}, {{DURATION}}, {{LANGUAGE}}, {{DOWNLOAD_TIME}}, {{TRANSCRIPT}}$OUTPUT_DIR/summary.md# Prioritize Chinese subtitles
yt-dlp --sub-lang zh-Hans,zh-Hant,zh ...
# If login required
yt-dlp --cookies-from-browser chrome "VIDEO_URL"
yt-dlp --cookies-from-browser chrome "VIDEO_URL"
# or firefox
yt-dlp --cookies-from-browser firefox "VIDEO_URL"
Use the parallel transcription script (Step 4, option 3).
yt-dlp --list-extractors | grep -i "platform-name"
./downloads/ in current working directoryWeekly Installs
231
Repository
GitHub Stars
15
First Seen
Feb 4, 2026
Security Audits
Gen Agent Trust HubFailSocketWarnSnykWarn
Installed on
opencode230
gemini-cli229
codex228
cursor228
kimi-cli227
amp227
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
27,400 周安装
Azure AI 服务指南:AI Search、Speech、OpenAI 与 MCP 工具使用教程
103,700 周安装
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
107,800 周安装
Skill Creator 技能创建工具 - Anthropic Claude 技能开发指南
118,800 周安装
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
144,300 周安装
Remotion最佳实践指南:字幕处理、FFmpeg视频操作、音频可视化与音效使用
191,700 周安装
App Store Connect PPP定价工具:按地区定价与订阅价格批量管理
226 周安装