Agent skill
youtube-transcript
Extract YouTube video transcripts/subtitles using yt-dlp. Handles rate limiting, auto-generated captions, multiple languages, and VTT parsing.
Install this agent skill to your Project
npx add-skill https://github.com/jung3fun/claude/tree/main/claude-skills-main/youtube-transcript
SKILL.md
YouTube Transcript Extraction Skill
Overview
Extract YouTube transcripts and download videos using yt-dlp via Desktop Commander MCP. Executes commands directly on your local machine with automatic error handling and cross-platform support.
How It Works
- Claude uses
start_processto run yt-dlp commands on your local system - Automatically checks tool installation and offers to install if missing
- Handles YouTube bot detection and common errors automatically
- Downloads to ~/Downloads by default (customizable)
- Monitors progress and provides real-time status updates
Prerequisites Check & Installation
Claude Will Automatically:
- Check if yt-dlp and ffmpeg are installed
- Detect your OS and available package managers
- Offer installation options if tools are missing
- Verify installation and update if needed
Installation Commands by Platform:
# macOS (Homebrew)
brew install yt-dlp ffmpeg
# Windows (Chocolatey - run as Admin)
choco install yt-dlp ffmpeg -y
# Linux (apt)
sudo apt update && sudo apt install yt-dlp ffmpeg -y
# Linux (snap)
sudo snap install yt-dlp ffmpeg
Core Usage
Request Examples:
- "유튜브 자막 추출해줘: [URL]" → Korean subtitles only
- "영상도 다운로드해줘: [URL]" → Video + Korean subtitles (720p)
- "영어 자막도 추가해줘" → Multiple languages
- "/path/to/folder에 저장해줘" → Custom output directory
What Claude Executes:
Subtitles Only (Default):
yt-dlp --extractor-args "youtube:player_client=android" \
--write-auto-sub --sub-lang ko \
--convert-subs srt --skip-download \
"VIDEO_URL"
Video + Subtitles:
yt-dlp --extractor-args "youtube:player_client=android" \
--write-auto-sub --sub-lang ko,en \
--convert-subs srt \
-f "best[height<=720]" \
"VIDEO_URL"
Error Handling (Automatic)
Bot Detection Error
Error: "Sign in to confirm you're not a bot" Solution: Use Android client (already included in commands above)
HTTP 403 Forbidden
Error: Video download fails with 403 Claude's Response:
- Retry with 720p quality (automatic)
- Try iOS client if 720p fails
- Offer browser cookies as last resort (requires approval)
HTTP 429 Rate Limited
Error: "Too Many Requests" for subtitles Claude's Response:
- Add
--sleep-subtitles 2delay - Download languages separately with 5-second intervals
Missing Subtitles
Error: "No subtitles available" Claude's Response:
- Check with
--list-subsfirst - Try auto-generated if manual unavailable
- Report if video has no captions
Tool Not Found
Error: "command not found: yt-dlp" Claude's Response:
- Detect OS and package manager
- Offer installation with commands
- Install with user approval
- Verify and retry download
Key Parameters Explained
| Parameter | Purpose | When Used |
|---|---|---|
--extractor-args "youtube:player_client=android" |
Bypass bot detection | Always (most reliable) |
--write-auto-sub |
Download auto-generated subtitles | When manual subs unavailable |
--sub-lang ko,en |
Specify languages | Default: ko (Korean) |
--convert-subs srt |
Convert to SRT format | Always (best compatibility) |
--skip-download |
Subtitles only, no video | Subtitle-only requests |
-f "best[height<=720]" |
720p quality | Video downloads (avoids 403) |
--cookies-from-browser safari |
Use browser session | Last resort for persistent errors |
Claude's Execution Flow
Step 1: Verify Tools
which yt-dlp && yt-dlp --version
which ffmpeg && ffmpeg -version
Step 2: Navigate to Output Directory
cd ~/Downloads # or user-specified path
Step 3: Execute Download
# Start process with 180-second timeout for videos
start_process("yt-dlp [options] VIDEO_URL", timeout_ms=180000)
Step 4: Monitor Progress
# Check output every 10 seconds
read_process_output(pid, timeout_ms=10000)
# Watch for: completion, errors, progress percentage
Step 5: Handle Errors
- Detect error type from output
- Apply appropriate solution automatically
- Report status to user
Step 6: Verify & Report
ls -la *.srt *.mp4 # List downloaded files
- Provide absolute file paths
- Confirm successful downloads
- Mention any issues encountered
Best Practices for Claude
- Always start with Android client - highest success rate
- Use 720p for videos - best balance of quality and reliability
- Check subtitles first - run
--list-subsif uncertain - Handle errors gracefully - try alternatives before asking user
- Ask before cookies - browser cookies need user approval
- Provide absolute paths - always report full file locations
- Clean up .part files - remove incomplete downloads on failure
- Update when needed - suggest upgrade if repeated failures
Timeout Guidelines
# Short: Check/list operations (5-10s)
start_process("yt-dlp --list-subs URL", timeout_ms=10000)
# Medium: Subtitle downloads (30-60s)
start_process("yt-dlp --skip-download ...", timeout_ms=60000)
# Long: Video downloads (2-3 minutes)
start_process("yt-dlp -f best[height<=720] ...", timeout_ms=180000)
Common Request Patterns
| User Request | Claude Action | Output |
|---|---|---|
| "자막 추출해줘: [URL]" | Subtitles only, Korean | .srt file |
| "영상도 다운로드" | 720p video + subtitles | .mp4 + .srt |
| "영어 자막도 추가" | Add --sub-lang ko,en |
Multiple .srt files |
| "1080p로 다운로드" | Try, fallback to 720p if 403 | Best available quality |
| "/path에 저장" | Navigate to path first | Files in specified directory |
Advanced Options
Playlist Download
yt-dlp --extractor-args "youtube:player_client=android" \
--write-auto-sub --sub-lang ko \
"PLAYLIST_URL"
Custom Filename Template
yt-dlp -o "%(uploader)s_%(title)s_%(upload_date)s.%(ext)s" VIDEO_URL
Resume Interrupted Download
yt-dlp --continue "VIDEO_URL"
Multiple URLs (Batch Processing)
Claude will process each URL sequentially with appropriate delays between downloads.
Troubleshooting Quick Reference
| Symptom | Cause | Quick Fix |
|---|---|---|
| Bot detection error | Default client blocked | Use player_client=android |
| 403 on video | High quality blocked | Lower to 720p or below |
| 429 on subtitles | Rate limited | Add delays between languages |
| Cookie decrypt failed | Browser security | Close browser, grant permissions |
| No subtitles found | Video has no captions | Check --list-subs, try auto-generated |
| Command not found | Tools not installed | Install via package manager |
Platform-Specific Notes
macOS: Safari cookies work best, may need Full Disk Access for Terminal Windows: Use PowerShell/CMD, Chrome cookies recommended Linux: Firefox or Chrome cookies, may need sudo for installation
Support
- GitHub: https://github.com/yt-dlp/yt-dlp
- Update regularly - YouTube API changes frequently
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
youtube-summary
This skill should be used when Claude needs to create structured, educational summaries of YouTube videos. Use this skill when the user requests a video summary, content analysis, or learning-focused breakdown of YouTube content. The skill integrates youtube-video-info and youtube-transcript skills to gather video data and transcripts, then generates comprehensive summaries following a specific educational format with key topics, insights, data-based analysis, and exploratory questions.
storage-cleaner
Manage computer storage and clean up disk space. Use this skill when the user needs to find large files, detect duplicate files, remove unused applications, clear caches, or clean up Docker resources. Supports macOS, Windows, and Linux with platform-specific commands for storage analysis and cleanup operations.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
Didn't find tool you were looking for?