Install
openclaw skills install @terryso/youtube-summarizerDownload YouTube video transcripts and generate structured summaries with key viewpoints, notable quotes, and topic analysis. Use when the user shares a YouTube URL and asks to summarize the video, extract transcripts, or get content insights. Supports any YouTube URL format (watch, youtu.be, shorts, embed, live).
openclaw skills install @terryso/youtube-summarizerDownload YouTube video transcripts/subtitles and generate structured content summaries with key viewpoints, notable quotes, and topic analysis.
Install dependencies (skip if already installed):
pip3 install youtube-transcript-api -q
# yt-dlp is needed for video metadata (title, channel, duration)
# Install if not present: brew install yt-dlp OR pip3 install yt-dlp
SKILL_DIR is the directory containing this SKILL.md file.
# JSON output with metadata
python3 SKILL_DIR/scripts/fetch_transcript.py "https://youtube.com/watch?v=VIDEO_ID"
# Plain text with timestamps (recommended for summarization)
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --text-only --timestamps
# Specific language with fallback chain
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --language en,zh --text-only --timestamps
The script accepts any standard YouTube URL format: watch?v=, youtu.be/, shorts/, embed/, live/, or a raw 11-character video ID.
Get title, channel, duration, and upload date for context:
yt-dlp --skip-download --print "%(title)s|%(channel)s|%(duration_string)s|%(upload_date)s" "URL"
For long videos (>30 min), the transcript output may be large. Read in sections:
# First half
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --text-only --timestamps | head -500
# Second half
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --text-only --timestamps | tail -400
Analyze the transcript and produce a structured summary. ALL content must be in the chosen language — including section labels, table headers, and metadata fields. Only the template structure (emojis, table format, blockquote format) stays fixed. The actual words are all localized.
Template structure (translate every label into the output language):
## [localized: "视频总结" / "Video Summary"]
**[localized label]:** (title)
**[localized label]:** (channel)
**[localized label]:** (guest, if identifiable)
**[localized label]:** (duration) | **[localized label]:** (date)
---
### [localized: one-line summary]
(1-2 sentence overview)
---
### [localized: "核心观点" / "Key Viewpoints"]
| [localized: 话题] | [localized: 观点] |
|-------|-----------|
| ... | ... |
---
### [localized: "金句" / "Notable Quotes"]
> "Original language quote" — Speaker
---
### [localized: "其他亮点" / "Other Highlights"]
- ...
---
### [localized: "注意/偏见" / "Notes / Bias"]
- ...
The summary language is determined by this priority:
| Error | Solution |
|---|---|
youtube-transcript-api not installed | Run pip3 install youtube-transcript-api |
Transcripts are disabled | Tell user subtitles are disabled for this video |
No transcript found | Retry without --language flag, then note actual language |
| Empty output | Video may not have auto-generated subtitles; inform user |
yt-dlp: command not found | Install with pip3 install yt-dlp or brew install yt-dlp |
See references/example-output.md for a real summary (GLM-5.2 interview video, Chinese output). Use it as the quality bar for structure, conciseness, and depth.