youtube-content
npx skills add https://github.com/fairchild/dotclaude --skill youtube-content
Agent 安装分布
Skill 文档
YouTube Content
Extract transcripts and metadata from YouTube videos for analysis.
Workflow
- Extract video ID from URL
- Run fetch script from skill directory
- Present metadata summary to user
- Apply requested analysis mode to transcript
- Save analysis and raw transcript to knowledge base (auto, use
--no-saveto skip)
Fetch Script
Run from the skill directory (~/.claude/skills/youtube-content/):
uv run ~/.claude/skills/youtube-content/scripts/fetch_youtube.py "https://youtube.com/watch?v=VIDEO_ID"
Options:
--metadata-only– Skip transcript extraction--transcript-only– Skip metadata extraction--with-segments– Include timestamped segments (for quote extraction)
Output: JSON with {video_id, metadata, transcript, errors}
By default, transcript contains only text and language. Use --with-segments when timestamps are needed (e.g., Quotes mode).
Supported URL Formats
youtube.com/watch?v=VIDEO_IDyoutu.be/VIDEO_IDyoutube.com/embed/VIDEO_IDyoutube.com/v/VIDEO_ID- Bare video ID (11 characters)
Analysis Modes
Select based on user request:
| User Says | Mode | Action |
|---|---|---|
| “extract wisdom”, “key insights” | Wisdom | See analysis-modes.md |
| “summarize”, “TLDR”, “overview” | Summary | See analysis-modes.md |
| “questions”, “Q&A”, “discussion” | Q&A | See analysis-modes.md |
| “quotes”, “notable statements” | Quotes | Use --with-segments, see analysis-modes.md |
| Other specific requests | Custom | Apply user’s instructions directly |
Error Handling
The script returns partial results when possible:
- Transcripts disabled: Returns metadata only, notes error
- Private video: Clear error message with video ID
- No transcript found: Returns metadata, suggests alternatives
- Rate limiting: Retry after 30-60 seconds
Check the errors array in output for any issues.
Background Analysis (Subagent)
For video analysis that shouldn’t block the main conversation, spawn a background subagent:
Task(
subagent_type: "general-purpose",
prompt: "Read ~/.claude/skills/youtube-content/SKILL.md and follow the workflow.
Analyze this YouTube video: {url}
Mode: {wisdom|summary|qa|quotes}
Save to knowledge base: {yes|no}"
)
Knowledge Persistence
Analyses and raw transcripts are automatically saved to a knowledge base for future reference.
Configuration
Set CLAUDE_KNOWLEDGE_DIR to customize storage location (default: ~/.claude/knowledge).
Save Analysis
Saves both the analysis (markdown) and raw transcript (JSON):
echo '{"video_id": "...", "metadata": {...}, "transcript": {...}, "analysis": "..."}' | \
uv run scripts/save_analysis.py --mode wisdom --tags "ai,coding"
Output: {"saved": true, "analysis_path": "...", "transcript_path": "..."}
Search Knowledge
uv run scripts/search_knowledge.py --list # List recent
uv run scripts/search_knowledge.py "react" # Search keyword
uv run scripts/search_knowledge.py --tag ai # Filter by tag
File Structure
$CLAUDE_KNOWLEDGE_DIR/youtube/
âââ .gitignore # Ignores transcripts/
âââ index.md # Quick reference
âââ analyses/
â âââ 2025-12-30_VIDEO_ID.md # Formatted analysis with frontmatter
âââ transcripts/ # Raw data (gitignored)
âââ 2025-12-30_VIDEO_ID.json # Full fetch output with transcript
Note: Raw transcripts are gitignored by default as they can be large and re-fetched from YouTube if needed.