Download YouTube video transcripts as readable text files. Use when extracting transcripts from videos for analysis, documentation, or content review.
41
Quality
27%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
Optimize this skill with Tessl
npx tessl skill review --optimize ./plugins/content-tools/skills/fetch-youtube-transcript/SKILL.mdDownload transcripts from YouTube videos as readable text files with timestamps. This skill wraps the youtube-transcript-api tool with a simple interface for quick transcript extraction.
/fetch-youtube-transcript <video-url-or-id> [--output DIR] [--language LANG]<video-url-or-id>: YouTube video URL or video ID
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDVIDEO_ID (11 characters)--output DIR: Output directory for transcript files
.work/transcripts/VIDEO_ID.txt--language LANG: Preferred transcript language code
en, es, fr, de, jaWhen the user invokes /fetch-youtube-transcript, follow these steps:
Extract the video URL/ID and optional parameters from the user's command:
# Example argument parsing logic
import re
from pathlib import Path
def parse_args(args_string):
"""Parse /fetch-youtube-transcript arguments."""
parts = args_string.split()
if not parts:
return None, None, None, "Error: Video URL or ID required"
video_url = parts[0]
output_dir = ".work/transcripts"
language = None
# Parse optional flags
i = 1
while i < len(parts):
if parts[i] == "--output" and i + 1 < len(parts):
output_dir = parts[i + 1]
i += 2
elif parts[i] == "--language" and i + 1 < len(parts):
language = parts[i + 1]
i += 2
else:
i += 1
return video_url, output_dir, language, NoneBuild the uvx command to run the transcript fetcher:
uvx --from youtube-transcript-api \
python scripts/fetch-youtube-transcript.py \
"<video-url>" \
--output "<output-dir>"If language is specified, add --language <lang>.
Important:
scripts/fetch-youtube-transcript.pyRun the command using the Bash tool with appropriate error handling:
# Construct full command
cmd_parts = [
"uvx --from youtube-transcript-api",
"python scripts/fetch-youtube-transcript.py",
f'"{video_url}"',
f"--output {output_dir}"
]
if language:
cmd_parts.append(f"--language {language}")
command = " ".join(cmd_parts)
# Execute via Bash tool
# The script will handle all video ID extraction and error casesThe script outputs structured information on success:
✅ Transcript downloaded successfully!
Video: 4_2j5wgt_ds
File: .work/transcripts/4_2j5wgt_ds.txt
Entries: 851Parse this output and report to the user:
The script returns non-zero exit codes and error messages for failures:
Common error scenarios:
Invalid URL format
❌ Error: Invalid YouTube URL or video IDReport: "The provided URL or video ID is invalid. Please provide a valid YouTube URL or 11-character video ID."
No transcript available
❌ Error: No transcript found for video
Could not retrieve a transcript for the video IDReport: "No transcript is available for this video. The creator may have disabled transcripts."
Video unavailable
❌ Error: Video unavailable or privateReport: "The video is unavailable, private, or has been deleted."
Network errors
❌ Error: Network request failedReport: "Failed to connect to YouTube. Please check your internet connection."
Invalid output directory
❌ Error: Cannot create output directoryReport: "Failed to create output directory. Please check permissions."
On successful execution, provide a clear summary:
✅ Transcript downloaded successfully!
📹 Video ID: 4_2j5wgt_ds
📄 File: .work/transcripts/4_2j5wgt_ds.txt
📊 Entries: 851 transcript segments
You can now read the transcript file or use it for analysis.Transcripts are saved as plain text files with the following format:
[00:00] Welcome to this video about Product Forge!
[00:15] Today we'll be exploring how to build custom Claude Code plugins.
[00:32] First, let's talk about the plugin architecture.
...Each line contains:
[MM:SS] format for easy navigationThe format is designed for:
Download a transcript using a full YouTube URL:
/fetch-youtube-transcript "https://www.youtube.com/watch?v=dQw4w9WgXcQ"Result:
.work/transcripts/dQw4w9WgXcQ.txtSave transcript to a specific directory:
/fetch-youtube-transcript "https://youtu.be/dQw4w9WgXcQ" --output ./transcriptsResult:
./transcripts/dQw4w9WgXcQ.txtRequest a Spanish transcript:
/fetch-youtube-transcript "dQw4w9WgXcQ" --language esResult:
Use just the video ID:
/fetch-youtube-transcript "dQw4w9WgXcQ"Result:
Missing URL:
/fetch-youtube-transcriptResponse: "Error: Video URL or ID required. Usage: /fetch-youtube-transcript <video-url-or-id> [--output DIR]"
Invalid URL format:
/fetch-youtube-transcript "not-a-youtube-url"Response: "Error: Invalid YouTube URL or video ID. Please provide a valid YouTube URL or 11-character video ID."
No transcript available:
Response: "No transcript available for this video. The creator may have disabled transcripts or automatic captions."
Video unavailable:
Response: "Video is unavailable. It may be private, deleted, or region-restricted."
Connection failed:
Response: "Failed to connect to YouTube. Please check your internet connection and try again."
Rate limiting:
Response: "Request rate limited. Please wait a moment and try again."
The script expects arguments in this order:
python script.py <video_url> [--output DIR] [--language LANG]Parse the user's /fetch-youtube-transcript command to extract these values:
/fetch-youtube-transcript prefix--output flag and next argument--language flag and next argumentMonitor the exit code and stderr:
Common error patterns in stderr:
"Invalid YouTube URL" → URL validation failed"No transcript found" → Transcripts disabled"Video unavailable" → Private/deleted video"Network" → Connection issuesThe script is bundled with this plugin at scripts/fetch-youtube-transcript.py (relative to the plugin directory).
Claude Code will resolve this path automatically when executing from the plugin context.
Output directory handling:
.work/transcripts/ is relative to current directoryBe conversational: Don't just dump the raw script output. Parse it and present it naturally:
Instead of:
✅ Transcript downloaded successfully!
Video: 4_2j5wgt_ds
File: .work/transcripts/4_2j5wgt_ds.txtSay:
I've downloaded the transcript for video 4_2j5wgt_ds.
The file is saved at .work/transcripts/4_2j5wgt_ds.txt with 851 transcript entries.Provide context: If the user might want to do something with the transcript, suggest next steps:
Transcript downloaded successfully! You can now:
- Read the file to review the content
- Search for specific topics or keywords
- Use it as reference material
- Process it further with other toolsHandle errors gracefully: Don't just report the error, explain what it means and what to do:
Instead of:
❌ Error: No transcript foundSay:
This video doesn't have a transcript available. This usually means the creator
disabled automatic captions. Unfortunately, there's no transcript to download.The script path is relative to the plugin directory and Claude Code handles path resolution automatically.
Output directory considerations:
.work/transcripts/ will be created relative to where the command is runBefore reporting success, verify:
This prevents false positives from script failures.
The skill uses youtube-transcript-api via uvx:
The Python script is bundled with the plugin at scripts/fetch-youtube-transcript.py (relative to plugin directory).
The script handles these YouTube URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/watch?v=VIDEO_ID&t=123shttps://m.youtube.com/watch?v=VIDEO_IDVIDEO_ID (11 characters)Common language codes for --language:
en - Englishes - Spanishfr - Frenchde - Germanja - Japaneseko - Koreanzh - Chinesept - Portugueseru - Russianar - ArabicFull list: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Files are named using the video ID:
.txtdQw4w9WgXcQ.txtThis ensures:
Potential improvements for future versions:
0ebe7ae
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.