Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks
Add this skill
npx mdskills install sickn33/youtube-summarizerComprehensive YouTube summarization skill with clear instructions, dependency management, and structured output
1---2name: youtube-summarizer3description: "Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks"4version: 1.2.15author: Eric Andrade6created: 2025-02-017updated: 2026-02-048platforms: [github-copilot-cli, claude-code, codex]9category: content10tags: [video, summarization, transcription, youtube, content-analysis]11risk: safe12---1314# youtube-summarizer1516## Purpose1718This 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.1920The skill is designed for users who need thorough content analysis and reference documentation from educational videos, lectures, tutorials, or informational content.2122## When to Use This Skill2324This skill should be used when:2526- User provides a YouTube video URL and wants a detailed summary27- User needs to document video content for reference without rewatching28- User wants to extract insights, key points, and arguments from educational content29- User needs transcripts from YouTube videos for analysis30- User asks to "summarize", "resume", or "extract content" from YouTube videos31- User wants comprehensive documentation prioritizing completeness over brevity3233## Step 0: Discovery & Setup3435Before processing videos, validate the environment and dependencies:3637```bash38# Check if youtube-transcript-api is installed39python3 -c "import youtube_transcript_api" 2>/dev/null40if [ $? -ne 0 ]; then41 echo "⚠️ youtube-transcript-api not found"42 # Offer to install43fi4445# Check Python availability46if ! command -v python3 &>/dev/null; then47 echo "❌ Python 3 is required but not installed"48 exit 149fi50```5152**Ask the user if dependency is missing:**5354```55youtube-transcript-api is required but not installed.5657Would you like to install it now?58- [ ] Yes - Install with pip (pip install youtube-transcript-api)59- [ ] No - I'll install it manually60```6162**If user selects "Yes":**6364```bash65pip install youtube-transcript-api66```6768**Verify installation:**6970```bash71python3 -c "import youtube_transcript_api; print('✅ youtube-transcript-api installed successfully')"72```7374## Main Workflow7576### Progress Tracking Guidelines7778Throughout the workflow, display a visual progress gauge before each step to keep the user informed. The gauge format is:7980```bash81echo "[████░░░░░░░░░░░░░░░░] 20% - Step 1/5: Validating URL"82```8384**Format specifications:**85- 20 characters wide (use █ for filled, ░ for empty)86- Percentage increments: Step 1=20%, Step 2=40%, Step 3=60%, Step 4=80%, Step 5=100%87- Step counter showing current/total (e.g., "Step 3/5")88- Brief description of current phase8990**Display the initial status box before Step 1:**9192```93╔══════════════════════════════════════════════════════════════╗94║ 📹 YOUTUBE SUMMARIZER - Processing Video ║95╠══════════════════════════════════════════════════════════════╣96║ → Step 1: Validating URL [IN PROGRESS] ║97║ ○ Step 2: Checking Availability ║98║ ○ Step 3: Extracting Transcript ║99║ ○ Step 4: Generating Summary ║100║ ○ Step 5: Formatting Output ║101╠══════════════════════════════════════════════════════════════╣102║ Progress: ██████░░░░░░░░░░░░░░░░░░░░░░░░ 20% ║103╚══════════════════════════════════════════════════════════════╝104```105106### Step 1: Validate YouTube URL107108**Objective:** Extract video ID and validate URL format.109110**Supported URL Formats:**111- `https://www.youtube.com/watch?v=VIDEO_ID`112- `https://youtube.com/watch?v=VIDEO_ID`113- `https://youtu.be/VIDEO_ID`114- `https://m.youtube.com/watch?v=VIDEO_ID`115116**Actions:**117118```bash119# Extract video ID using regex or URL parsing120URL="$USER_PROVIDED_URL"121122# Pattern 1: youtube.com/watch?v=VIDEO_ID123if echo "$URL" | grep -qE 'youtube\.com/watch\?v='; then124 VIDEO_ID=$(echo "$URL" | sed -E 's/.*[?&]v=([^&]+).*/\1/')125# Pattern 2: youtu.be/VIDEO_ID126elif echo "$URL" | grep -qE 'youtu\.be/'; then127 VIDEO_ID=$(echo "$URL" | sed -E 's/.*youtu\.be\/([^?]+).*/\1/')128else129 echo "❌ Invalid YouTube URL format"130 exit 1131fi132133echo "📹 Video ID extracted: $VIDEO_ID"134```135136**If URL is invalid:**137138```139❌ Invalid YouTube URL140141Please provide a valid YouTube URL in one of these formats:142- https://www.youtube.com/watch?v=VIDEO_ID143- https://youtu.be/VIDEO_ID144145Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ146```147148### Step 2: Check Video & Transcript Availability149150**Progress:**151```bash152echo "[████████░░░░░░░░░░░░] 40% - Step 2/5: Checking Availability"153```154155**Objective:** Verify video exists and transcript is accessible.156157**Actions:**158159```python160from youtube_transcript_api import YouTubeTranscriptApi, TranscriptsDisabled, NoTranscriptFound161import sys162163video_id = sys.argv[1]164165try:166 # Get list of available transcripts167 transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)168169 print(f"✅ Video accessible: {video_id}")170 print("📝 Available transcripts:")171172 for transcript in transcript_list:173 print(f" - {transcript.language} ({transcript.language_code})")174 if transcript.is_generated:175 print(" [Auto-generated]")176177except TranscriptsDisabled:178 print(f"❌ Transcripts are disabled for video {video_id}")179 sys.exit(1)180181except NoTranscriptFound:182 print(f"❌ No transcript found for video {video_id}")183 sys.exit(1)184185except Exception as e:186 print(f"❌ Error accessing video: {e}")187 sys.exit(1)188```189190**Error Handling:**191192| Error | Message | Action |193|-------|---------|--------|194| Video not found | "❌ Video does not exist or is private" | Ask user to verify URL |195| Transcripts disabled | "❌ Transcripts are disabled for this video" | Cannot proceed |196| No transcript available | "❌ No transcript found (not auto-generated or manually added)" | Cannot proceed |197| Private/restricted video | "❌ Video is private or restricted" | Ask for public video |198199### Step 3: Extract Transcript200201**Progress:**202```bash203echo "[████████████░░░░░░░░] 60% - Step 3/5: Extracting Transcript"204```205206**Objective:** Retrieve transcript in preferred language.207208**Actions:**209210```python211from youtube_transcript_api import YouTubeTranscriptApi212213video_id = "VIDEO_ID"214215try:216 # Try to get transcript in user's preferred language first217 # Fall back to English if not available218 transcript = YouTubeTranscriptApi.get_transcript(219 video_id,220 languages=['pt', 'en'] # Prefer Portuguese, fallback to English221 )222223 # Combine transcript segments into full text224 full_text = " ".join([entry['text'] for entry in transcript])225226 # Get video metadata227 from youtube_transcript_api import YouTubeTranscriptApi228 transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)229230 print("✅ Transcript extracted successfully")231 print(f"📊 Transcript length: {len(full_text)} characters")232233 # Save to temporary file for processing234 with open(f"/tmp/transcript_{video_id}.txt", "w") as f:235 f.write(full_text)236237except Exception as e:238 print(f"❌ Error extracting transcript: {e}")239 exit(1)240```241242**Transcript Processing:**243244- Combine all transcript segments into coherent text245- Preserve punctuation and formatting where available246- Remove duplicate or overlapping segments (if auto-generated artifacts)247- Store in temporary file for analysis248249### Step 4: Generate Comprehensive Summary250251**Progress:**252```bash253echo "[████████████████░░░░] 80% - Step 4/5: Generating Summary"254```255256**Objective:** Apply enhanced STAR + R-I-S-E prompt to create detailed summary.257258**Prompt Applied:**259260Use the enhanced prompt from Phase 2 (STAR + R-I-S-E framework) with the extracted transcript as input.261262**Actions:**2632641. Load the full transcript text2652. Apply the comprehensive summarization prompt2663. Use AI model (Claude/GPT) to generate structured summary2674. Ensure output follows the defined structure:268 - Header with video metadata269 - Executive synthesis270 - Detailed section-by-section breakdown271 - Key insights and conclusions272 - Concepts and terminology273 - Resources and references274275**Implementation:**276277```bash278# Use the transcript file as input to the AI prompt279TRANSCRIPT_FILE="/tmp/transcript_${VIDEO_ID}.txt"280281# The AI agent will:282# 1. Read the transcript283# 2. Apply the STAR + R-I-S-E summarization framework284# 3. Generate comprehensive Markdown output285# 4. Structure with headers, lists, and highlights286287Read "$TRANSCRIPT_FILE" # Read transcript into context288```289290Then apply the full summarization prompt (from enhanced version in Phase 2).291292### Step 5: Format and Present Output293294**Progress:**295```bash296echo "[████████████████████] 100% - Step 5/5: Formatting Output"297```298299**Objective:** Deliver the summary in clean, well-structured Markdown.300301**Output Structure:**302303```markdown304# [Video Title]305306**Canal:** [Channel Name]307**Duração:** [Duration]308**URL:** [https://youtube.com/watch?v=VIDEO_ID]309**Data de Publicação:** [Date if available]310311312## 📝 Detailed Summary313314### [Topic 1]315316[Comprehensive explanation with examples, data, quotes...]317318#### [Subtopic 1.1]319320[Detailed breakdown...]321322### [Topic 2]323324[Continued detailed analysis...]325326327## 📚 Concepts and Terminology328329- **[Term 1]:** [Definition and context]330- **[Term 2]:** [Definition and context]331332333## 📌 Conclusion334335[Final synthesis and takeaways]336337338### **Example 2: Missing Dependency**339340**User Input:**341```342claude> summarize this youtube video https://youtu.be/abc123343```344345**Skill Response:**346347```348⚠️ youtube-transcript-api not installed349350This skill requires the Python library 'youtube-transcript-api'.351352Would you like me to install it now?353- [ ] Yes - Install with pip354- [ ] No - I'll install manually355```356357**User selects "Yes":**358359```bash360$ pip install youtube-transcript-api361Successfully installed youtube-transcript-api-0.6.1362363✅ Installation complete! Proceeding with video summary...364```365366367### **Example 4: Invalid URL**368369**User Input:**370```371claude> summarize youtube video www.youtube.com/some-video372```373374**Skill Response:**375376```377❌ Invalid YouTube URL format378379Expected format examples:380- https://www.youtube.com/watch?v=VIDEO_ID381- https://youtu.be/VIDEO_ID382383Please provide a valid YouTube video URL.384```385386387## 📊 Executive Summary388389This 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.390391[... continued detailed summary ...]392```393394**Save Options:**395396```397What would you like to save?398→ Summary + raw transcript399400✅ File saved: resumo-exemplo123-2026-02-01.md (includes raw transcript)401[████████████████████] 100% - ✓ Processing complete!402```403404405Welcome to this comprehensive tutorial on machine learning fundamentals. In today's video, we'll explore the core concepts that power modern AI systems...406```407408409**Version:** 1.2.0410**Last Updated:** 2026-02-02411**Maintained By:** Eric Andrade412
Full transparency — inspect the skill content before installing.