youtube-summarizer by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill youtube-summarizer此技能从 YouTube 视频中提取字幕,并使用 STAR + R-I-S-E 框架生成全面、详细的摘要。它验证视频可用性,使用 youtube-transcript-api Python 库提取字幕,并生成捕获所有见解、论点和关键点的详细文档。
该技能专为需要从教育视频、讲座、教程或信息内容中进行深入内容分析和参考文档的用户而设计。
在以下情况下应使用此技能:
在处理视频之前,验证环境和依赖项:
# Check if youtube-transcript-api is installed
python3 -c "import youtube_transcript_api" 2>/dev/null
if [ $? -ne 0 ]; then
echo "⚠️ youtube-transcript-api not found"
# Offer to install
fi
# Check Python availability
if ! command -v python3 &>/dev/null; then
echo "❌ Python 3 is required but not installed"
exit 1
fi
如果缺少依赖项,询问用户:
youtube-transcript-api is required but not installed.
Would you like to install it now?
- [ ] Yes - Install with pip (pip install youtube-transcript-api)
- [ ] No - I'll install it manually
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
如果用户选择“是”:
pip install youtube-transcript-api
验证安装:
python3 -c "import youtube_transcript_api; print('✅ youtube-transcript-api installed successfully')"
在整个工作流程中,在每个步骤之前显示一个可视化的进度条,以使用户了解进度。进度条格式为:
echo "[████░░░░░░░░░░░░░░░░] 20% - Step 1/5: Validating URL"
格式规范:
在步骤 1 之前显示初始状态框:
╔══════════════════════════════════════════════════════════════╗
║ 📹 YOUTUBE SUMMARIZER - Processing Video ║
╠══════════════════════════════════════════════════════════════╣
║ → Step 1: Validating URL [IN PROGRESS] ║
║ ○ Step 2: Checking Availability ║
║ ○ Step 3: Extracting Transcript ║
║ ○ Step 4: Generating Summary ║
║ ○ Step 5: Formatting Output ║
╠══════════════════════════════════════════════════════════════╣
║ Progress: ██████░░░░░░░░░░░░░░░░░░░░░░░░ 20% ║
╚══════════════════════════════════════════════════════════════╝
目标: 提取视频 ID 并验证 URL 格式。
支持的 URL 格式:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://m.youtube.com/watch?v=VIDEO_ID操作:
# Extract video ID using regex or URL parsing
URL="$USER_PROVIDED_URL"
# Pattern 1: youtube.com/watch?v=VIDEO_ID
if echo "$URL" | grep -qE 'youtube\.com/watch\?v='; then
VIDEO_ID=$(echo "$URL" | sed -E 's/.*[?&]v=([^&]+).*/\1/')
# Pattern 2: youtu.be/VIDEO_ID
elif echo "$URL" | grep -qE 'youtu\.be/'; then
VIDEO_ID=$(echo "$URL" | sed -E 's/.*youtu\.be\/([^?]+).*/\1/')
else
echo "❌ Invalid YouTube URL format"
exit 1
fi
echo "📹 Video ID extracted: $VIDEO_ID"
如果 URL 无效:
❌ Invalid YouTube URL
Please provide a valid YouTube URL in one of these formats:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID
Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ
进度:
echo "[████████░░░░░░░░░░░░] 40% - Step 2/5: Checking Availability"
目标: 验证视频存在且字幕可访问。
操作:
from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound
import sys
video_id = sys.argv[1]
try:
# Get list of available transcripts
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
print(f"✅ Video accessible: {video_id}")
print("📝 Available transcripts:")
for transcript in transcript_list:
print(f" - {transcript.language} ({transcript.language_code})")
if transcript.is_generated:
print(" [Auto-generated]")
except TranscriptsDisabled:
print(f"❌ Transcripts are disabled for video {video_id}")
sys.exit(1)
except NoTranscriptFound:
print(f"❌ No transcript found for video {video_id}")
sys.exit(1)
except Exception as e:
print(f"❌ Error accessing video: {e}")
sys.exit(1)
错误处理:
| 错误 | 消息 | 操作 |
|---|---|---|
| 视频未找到 | "❌ Video does not exist or is private" | 请用户验证 URL |
| 字幕已禁用 | "❌ Transcripts are disabled for this video" | 无法继续 |
| 无可用字幕 | "❌ No transcript found (not auto-generated or manually added)" | 无法继续 |
| 私有/受限视频 | "❌ Video is private or restricted" | 请求公开视频 |
进度:
echo "[████████████░░░░░░░░] 60% - Step 3/5: Extracting Transcript"
目标: 以首选语言检索字幕。
操作:
from youtube_transcript_api import YouTubeTranscriptApi
video_id = "VIDEO_ID"
try:
# Try to get transcript in user's preferred language first
# Fall back to English if not available
transcript = YouTubeTranscriptApi.get_transcript(
video_id,
languages=['pt', 'en'] # Prefer Portuguese, fallback to English
)
# Combine transcript segments into full text
full_text = " ".join([entry['text'] for entry in transcript])
# Get video metadata
from youtube_transcript_api import YouTubeTranscriptApi
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
print("✅ Transcript extracted successfully")
print(f"📊 Transcript length: {len(full_text)} characters")
# Save to temporary file for processing
with open(f"/tmp/transcript_{video_id}.txt", "w") as f:
f.write(full_text)
except Exception as e:
print(f"❌ Error extracting transcript: {e}")
exit(1)
字幕处理:
进度:
echo "[████████████████░░░░] 80% - Step 4/5: Generating Summary"
目标: 应用增强的 STAR + R-I-S-E 提示来创建详细摘要。
应用的提示:
使用第 2 阶段的增强提示(STAR + R-I-S-E 框架),并将提取的字幕作为输入。
操作:
实现:
# Use the transcript file as input to the AI prompt
TRANSCRIPT_FILE="/tmp/transcript_${VIDEO_ID}.txt"
# The AI agent will:
# 1. Read the transcript
# 2. Apply the STAR + R-I-S-E summarization framework
# 3. Generate comprehensive Markdown output
# 4. Structure with headers, lists, and highlights
Read "$TRANSCRIPT_FILE" # Read transcript into context
然后应用完整的摘要提示(来自第 2 阶段的增强版本)。
进度:
echo "[████████████████████] 100% - Step 5/5: Formatting Output"
目标: 以干净、结构良好的 Markdown 格式交付摘要。
输出结构:
# [Video Title]
**Canal:** [Channel Name]
**Duração:** [Duration]
**URL:** [https://youtube.com/watch?v=VIDEO_ID]
**Data de Publicação:** [Date if available]
## 📝 Detailed Summary
### [Topic 1]
[Comprehensive explanation with examples, data, quotes...]
#### [Subtopic 1.1]
[Detailed breakdown...]
### [Topic 2]
[Continued detailed analysis...]
## 📚 Concepts and Terminology
- **[Term 1]:** [Definition and context]
- **[Term 2]:** [Definition and context]
## 📌 Conclusion
[Final synthesis and takeaways]
用户输入:
claude> summarize this youtube video https://youtu.be/abc123
**技能响应:**
⚠️ youtube-transcript-api not installed
This skill requires the Python library 'youtube-transcript-api'.
Would you like me to install it now?
**用户选择“是”:**
```bash
$ pip install youtube-transcript-api
Successfully installed youtube-transcript-api-0.6.1
✅ Installation complete! Proceeding with video summary...
用户输入:
claude> summarize youtube video www.youtube.com/some-video
技能响应:
❌ Invalid YouTube URL format
Expected format examples:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID
Please provide a valid YouTube video URL.
本视频全面介绍了人工智能(AI)的基本概念,专为希望了解现代 AI 技术基础和实践应用的初学者和专业人士设计。讲师涵盖了从基本定义到机器学习算法的所有内容,并使用实际示例和可视化来促进理解。
[... 继续详细摘要 ...]
**保存选项:**
What would you like to save? → Summary + raw transcript
✅ File saved: resumo-exemplo123-2026-02-01.md (includes raw transcript) [████████████████████] 100% - ✓ Processing complete!
Welcome to this comprehensive tutorial on machine learning fundamentals. In today's video, we'll explore the core concepts that power modern AI systems...
版本: 1.2.0 最后更新: 2026-02-02 维护者: Eric Andrade
每周安装数
707
仓库
GitHub 星标
27.4K
首次出现
Feb 5, 2026
安全审计
安装于
gemini-cli678
opencode677
codex673
github-copilot663
kimi-cli659
amp658
This skill extracts transcripts from YouTube videos and generates comprehensive, verbose summaries using the STAR + R-I-S-E framework. It validates video availability, extracts transcripts using the youtube-transcript-api Python library, and produces detailed documentation capturing all insights, arguments, and key points.
The skill is designed for users who need thorough content analysis and reference documentation from educational videos, lectures, tutorials, or informational content.
This skill should be used when:
Before processing videos, validate the environment and dependencies:
# Check if youtube-transcript-api is installed
python3 -c "import youtube_transcript_api" 2>/dev/null
if [ $? -ne 0 ]; then
echo "⚠️ youtube-transcript-api not found"
# Offer to install
fi
# Check Python availability
if ! command -v python3 &>/dev/null; then
echo "❌ Python 3 is required but not installed"
exit 1
fi
Ask the user if dependency is missing:
youtube-transcript-api is required but not installed.
Would you like to install it now?
- [ ] Yes - Install with pip (pip install youtube-transcript-api)
- [ ] No - I'll install it manually
If user selects "Yes":
pip install youtube-transcript-api
Verify installation:
python3 -c "import youtube_transcript_api; print('✅ youtube-transcript-api installed successfully')"
Throughout the workflow, display a visual progress gauge before each step to keep the user informed. The gauge format is:
echo "[████░░░░░░░░░░░░░░░░] 20% - Step 1/5: Validating URL"
Format specifications:
Display the initial status box before Step 1:
╔══════════════════════════════════════════════════════════════╗
║ 📹 YOUTUBE SUMMARIZER - Processing Video ║
╠══════════════════════════════════════════════════════════════╣
║ → Step 1: Validating URL [IN PROGRESS] ║
║ ○ Step 2: Checking Availability ║
║ ○ Step 3: Extracting Transcript ║
║ ○ Step 4: Generating Summary ║
║ ○ Step 5: Formatting Output ║
╠══════════════════════════════════════════════════════════════╣
║ Progress: ██████░░░░░░░░░░░░░░░░░░░░░░░░ 20% ║
╚══════════════════════════════════════════════════════════════╝
Objective: Extract video ID and validate URL format.
Supported URL Formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://m.youtube.com/watch?v=VIDEO_IDActions:
# Extract video ID using regex or URL parsing
URL="$USER_PROVIDED_URL"
# Pattern 1: youtube.com/watch?v=VIDEO_ID
if echo "$URL" | grep -qE 'youtube\.com/watch\?v='; then
VIDEO_ID=$(echo "$URL" | sed -E 's/.*[?&]v=([^&]+).*/\1/')
# Pattern 2: youtu.be/VIDEO_ID
elif echo "$URL" | grep -qE 'youtu\.be/'; then
VIDEO_ID=$(echo "$URL" | sed -E 's/.*youtu\.be\/([^?]+).*/\1/')
else
echo "❌ Invalid YouTube URL format"
exit 1
fi
echo "📹 Video ID extracted: $VIDEO_ID"
If URL is invalid:
❌ Invalid YouTube URL
Please provide a valid YouTube URL in one of these formats:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID
Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Progress:
echo "[████████░░░░░░░░░░░░] 40% - Step 2/5: Checking Availability"
Objective: Verify video exists and transcript is accessible.
Actions:
from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound
import sys
video_id = sys.argv[1]
try:
# Get list of available transcripts
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
print(f"✅ Video accessible: {video_id}")
print("📝 Available transcripts:")
for transcript in transcript_list:
print(f" - {transcript.language} ({transcript.language_code})")
if transcript.is_generated:
print(" [Auto-generated]")
except TranscriptsDisabled:
print(f"❌ Transcripts are disabled for video {video_id}")
sys.exit(1)
except NoTranscriptFound:
print(f"❌ No transcript found for video {video_id}")
sys.exit(1)
except Exception as e:
print(f"❌ Error accessing video: {e}")
sys.exit(1)
Error Handling:
| Error | Message | Action |
|---|---|---|
| Video not found | "❌ Video does not exist or is private" | Ask user to verify URL |
| Transcripts disabled | "❌ Transcripts are disabled for this video" | Cannot proceed |
| No transcript available | "❌ No transcript found (not auto-generated or manually added)" | Cannot proceed |
| Private/restricted video | "❌ Video is private or restricted" | Ask for public video |
Progress:
echo "[████████████░░░░░░░░] 60% - Step 3/5: Extracting Transcript"
Objective: Retrieve transcript in preferred language.
Actions:
from youtube_transcript_api import YouTubeTranscriptApi
video_id = "VIDEO_ID"
try:
# Try to get transcript in user's preferred language first
# Fall back to English if not available
transcript = YouTubeTranscriptApi.get_transcript(
video_id,
languages=['pt', 'en'] # Prefer Portuguese, fallback to English
)
# Combine transcript segments into full text
full_text = " ".join([entry['text'] for entry in transcript])
# Get video metadata
from youtube_transcript_api import YouTubeTranscriptApi
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
print("✅ Transcript extracted successfully")
print(f"📊 Transcript length: {len(full_text)} characters")
# Save to temporary file for processing
with open(f"/tmp/transcript_{video_id}.txt", "w") as f:
f.write(full_text)
except Exception as e:
print(f"❌ Error extracting transcript: {e}")
exit(1)
Transcript Processing:
Progress:
echo "[████████████████░░░░] 80% - Step 4/5: Generating Summary"
Objective: Apply enhanced STAR + R-I-S-E prompt to create detailed summary.
Prompt Applied:
Use the enhanced prompt from Phase 2 (STAR + R-I-S-E framework) with the extracted transcript as input.
Actions:
Implementation:
# Use the transcript file as input to the AI prompt
TRANSCRIPT_FILE="/tmp/transcript_${VIDEO_ID}.txt"
# The AI agent will:
# 1. Read the transcript
# 2. Apply the STAR + R-I-S-E summarization framework
# 3. Generate comprehensive Markdown output
# 4. Structure with headers, lists, and highlights
Read "$TRANSCRIPT_FILE" # Read transcript into context
Then apply the full summarization prompt (from enhanced version in Phase 2).
Progress:
echo "[████████████████████] 100% - Step 5/5: Formatting Output"
Objective: Deliver the summary in clean, well-structured Markdown.
Output Structure:
# [Video Title]
**Canal:** [Channel Name]
**Duração:** [Duration]
**URL:** [https://youtube.com/watch?v=VIDEO_ID]
**Data de Publicação:** [Date if available]
## 📝 Detailed Summary
### [Topic 1]
[Comprehensive explanation with examples, data, quotes...]
#### [Subtopic 1.1]
[Detailed breakdown...]
### [Topic 2]
[Continued detailed analysis...]
## 📚 Concepts and Terminology
- **[Term 1]:** [Definition and context]
- **[Term 2]:** [Definition and context]
## 📌 Conclusion
[Final synthesis and takeaways]
### **Example 2: Missing Dependency**
**User Input:**
claude> summarize this youtube video https://youtu.be/abc123
**Skill Response:**
⚠️ youtube-transcript-api not installed
This skill requires the Python library 'youtube-transcript-api'.
Would you like me to install it now?
Yes - Install with pip
No - I'll install manually
User selects "Yes":
$ pip install youtube-transcript-api
Successfully installed youtube-transcript-api-0.6.1
✅ Installation complete! Proceeding with video summary...
User Input:
claude> summarize youtube video www.youtube.com/some-video
Skill Response:
❌ Invalid YouTube URL format
Expected format examples:
- https://www.youtube.com/watch?v=VIDEO_ID
- https://youtu.be/VIDEO_ID
Please provide a valid YouTube video URL.
This video provides a comprehensive introduction to the fundamental concepts of Artificial Intelligence (AI), designed for beginners and professionals who want to understand the technical foundations and practical applications of modern AI. The instructor covers everything from basic definitions to machine learning algorithms, using practical examples and visualizations to facilitate understanding.
[... continued detailed summary ...]
**Save Options:**
What would you like to save? → Summary + raw transcript
✅ File saved: resumo-exemplo123-2026-02-01.md (includes raw transcript) [████████████████████] 100% - ✓ Processing complete!
Welcome to this comprehensive tutorial on machine learning fundamentals. In today's video, we'll explore the core concepts that power modern AI systems...
Version: 1.2.0 Last Updated: 2026-02-02 Maintained By: Eric Andrade
Weekly Installs
707
Repository
GitHub Stars
27.4K
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli678
opencode677
codex673
github-copilot663
kimi-cli659
amp658
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
37,500 周安装