pm7y-youtube-transcript
Download YouTube video transcripts and create structured summaries when user provides a YouTube URL or asks to download/get/fetch a transcript from YouTube. Also use when user wants to transcribe or get captions/subtitles from a YouTube video.
What this skill does
# YouTube Transcript Summary Generator
This skill downloads transcripts from YouTube videos and creates a structured `TRANSCRIPT.md` summary with key points (including time codes) and a detailed description. It does NOT include the full transcript text.
**Cross-platform:** Works on Windows, macOS, and Linux using Python.
## When to Use This Skill
Activate this skill when the user:
- Provides a YouTube URL and wants the transcript
- Asks to "download transcript from YouTube"
- Wants to "get captions" or "get subtitles" from a video
- Asks to "transcribe a YouTube video"
- Needs text content from a YouTube video
## Output Format
The skill produces a `TRANSCRIPT.md` file containing:
1. **Video metadata** - title, URL
2. **Summary** - brief overview of the video content
3. **Key Points** - main takeaways with time codes (e.g., `[02:34]`)
4. **Detailed Description** - expanded explanation of the content
**Note:** The full transcript text is NOT included in the output.
## How It Works
### Priority Order:
1. **Check if youtube-transcript-api is installed** - install if needed
2. **Extract video ID** from the YouTube URL
3. **Fetch transcript with timestamps** using the API
4. **Get video title** from YouTube
5. **Save timestamped transcript** to temporary file
6. **Analyze and summarize** - identify key points and generate summary
7. **Write TRANSCRIPT.md** - create structured markdown file
8. **Clean up** temporary files
## Installation Check
**IMPORTANT**: Always check if youtube-transcript-api is installed first:
```bash
python -c "import youtube_transcript_api" 2>/dev/null || python3 -c "import youtube_transcript_api" 2>/dev/null
```
### If Not Installed
Install the package (works on all platforms):
```bash
pip install youtube-transcript-api
```
Or with python3:
```bash
pip3 install youtube-transcript-api
```
## Extract Video ID
YouTube URLs come in various formats. Extract the video ID:
| URL Format | Video ID |
|------------|----------|
| `https://www.youtube.com/watch?v=ABC123` | `ABC123` |
| `https://youtu.be/ABC123` | `ABC123` |
| `https://www.youtube.com/embed/ABC123` | `ABC123` |
## Fetch Transcript with Timestamps
Use this Python script to fetch the transcript. It works cross-platform (Windows/macOS/Linux):
```python
import sys
import json
import re
import urllib.request
from youtube_transcript_api import YouTubeTranscriptApi
def get_video_id(url):
"""Extract video ID from various YouTube URL formats."""
patterns = [
r'(?:v=|/v/|youtu\.be/|/embed/)([a-zA-Z0-9_-]{11})',
r'^([a-zA-Z0-9_-]{11})$' # Just the ID
]
for pattern in patterns:
match = re.search(pattern, url)
if match:
return match.group(1)
return None
def get_video_title(video_id):
"""Fetch video title from YouTube page."""
try:
url = f"https://www.youtube.com/watch?v={video_id}"
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
with urllib.request.urlopen(req, timeout=10) as response:
html = response.read().decode('utf-8')
match = re.search(r'<title>([^<]+)</title>', html)
if match:
title = match.group(1).replace(' - YouTube', '').strip()
return title
except:
pass
return f"YouTube Video {video_id}"
def format_timestamp(seconds):
"""Convert seconds to MM:SS or HH:MM:SS format."""
seconds = int(seconds)
if seconds >= 3600:
hours = seconds // 3600
minutes = (seconds % 3600) // 60
secs = seconds % 60
return f"{hours}:{minutes:02d}:{secs:02d}"
else:
minutes = seconds // 60
secs = seconds % 60
return f"{minutes:02d}:{secs:02d}"
def main(url_or_id):
video_id = get_video_id(url_or_id)
if not video_id:
print(f"Error: Could not extract video ID from: {url_or_id}", file=sys.stderr)
sys.exit(1)
# Get video title
title = get_video_title(video_id)
print(f"TITLE: {title}")
print(f"URL: https://www.youtube.com/watch?v={video_id}")
print("---TRANSCRIPT---")
# Fetch transcript (API v1.2+ requires instance)
api = YouTubeTranscriptApi()
try:
transcript = api.fetch(video_id)
except Exception as e:
# Try with auto-generated
try:
transcript_list = api.list(video_id)
transcript = transcript_list.find_generated_transcript(['en']).fetch()
except Exception as e2:
print(f"Error: Could not fetch transcript: {e2}", file=sys.stderr)
sys.exit(1)
# Output timestamped transcript (entries are objects with .start/.text attributes)
for entry in transcript:
timestamp = format_timestamp(entry.start)
text = entry.text.replace('\n', ' ').strip()
print(f"[{timestamp}] {text}")
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python script.py <youtube_url_or_id>", file=sys.stderr)
sys.exit(1)
main(sys.argv[1])
```
## Complete Workflow
### Step 1: Check/Install youtube-transcript-api
**On macOS/Linux:**
```bash
python3 -c "import youtube_transcript_api" 2>/dev/null || pip3 install youtube-transcript-api
```
**On Windows (PowerShell):**
```powershell
python -c "import youtube_transcript_api" 2>$null; if ($LASTEXITCODE -ne 0) { pip install youtube-transcript-api }
```
### Step 2: Fetch Transcript
Save the Python script above to a temporary file and run it:
**Cross-platform approach** - Write and execute inline Python:
```bash
python3 << 'PYEOF' > transcript_with_timestamps.txt
import sys
import re
import urllib.request
from youtube_transcript_api import YouTubeTranscriptApi
VIDEO_URL = "REPLACE_WITH_URL"
def get_video_id(url):
patterns = [r'(?:v=|/v/|youtu\.be/|/embed/)([a-zA-Z0-9_-]{11})', r'^([a-zA-Z0-9_-]{11})$']
for pattern in patterns:
match = re.search(pattern, url)
if match:
return match.group(1)
return None
def get_video_title(video_id):
try:
url = f"https://www.youtube.com/watch?v={video_id}"
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
with urllib.request.urlopen(req, timeout=10) as response:
html = response.read().decode('utf-8')
match = re.search(r'<title>([^<]+)</title>', html)
if match:
return match.group(1).replace(' - YouTube', '').strip()
except:
pass
return f"YouTube Video {video_id}"
def format_timestamp(seconds):
seconds = int(seconds)
if seconds >= 3600:
return f"{seconds // 3600}:{(seconds % 3600) // 60:02d}:{seconds % 60:02d}"
return f"{seconds // 60:02d}:{seconds % 60:02d}"
video_id = get_video_id(VIDEO_URL)
title = get_video_title(video_id)
print(f"TITLE: {title}")
print(f"URL: https://www.youtube.com/watch?v={video_id}")
print("---TRANSCRIPT---")
# API v1.2+ requires instance
api = YouTubeTranscriptApi()
try:
transcript = api.fetch(video_id)
except:
transcript_list = api.list(video_id)
transcript = transcript_list.find_generated_transcript(['en']).fetch()
# Entries are objects with .start/.text attributes
for entry in transcript:
ts = format_timestamp(entry.start)
text = entry.text.replace('\n', ' ').strip()
print(f"[{ts}] {text}")
PYEOF
```
**On Windows (PowerShell)** - Use a temporary .py file:
```powershell
$script = @'
import sys, re, urllib.request
from youtube_transcript_api import YouTubeTranscriptApi
VIDEO_URL = "REPLACE_WITH_URL"
# ... (same Python code as above)
'@
$script | Out-File -Encoding utf8 temp_transcript.py
python temp_transcript.py > transcript_with_timestamps.txt
Remove-Item temp_transcript.py
```
### Step 3: Analyze and Create TRANSCRIPT.md
After running the above, you MUST:
1. **Read** the `transcript_with_timestamps.txt` file
2. **Extract** the TITLE and URL from the first lines
3. **Analyze** the transcript content to identify:
- Main topics coRelated in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.