youtube-transcript
Install this skill
npx skills add intellectronica/agent-skillsWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
The youtube-transcript skill provides a direct programmatic interface for retrieving closed captions from any YouTube video. It functions as a specialized wrapper around the youtube-transcript-api, allowing users to pull text data directly from a video URL or unique identifier. The tool supports fetching either raw text for reading or time-stamped segments for reference. By automating the extraction process, it removes the need to manually copy or scrape video content from browser windows. The output is formatted consistently, providing clean, paragraph-based text when timestamps are disabled or structured temporal markers when precision is needed. This ensures that the retrieved data remains faithful to the original caption stream, whether the source content consists of manual professional subtitling or platform-generated automatic captions.
When to Use This Skill
- •Summarizing educational video content for rapid knowledge acquisition
- •Creating searchable text archives of video libraries
- •Extracting quotes from technical tutorials or interviews
- •Generating documentation based on instructional video series
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- “Get the transcript for this YouTube video
- “Extract captions from the video at [URL]
- “Save the text of this YouTube video to a file
- “Provide a timestamped transcript for the video ID [ID]
- “Fetch the subtitles for the YouTube link provided
Pro Tips
- 💡Always specify `--timestamps` if precise timing for each caption segment is crucial for your task, such as video editing or detailed indexing.
- 💡Leverage the default output (without timestamps) for tasks requiring clean, readable text, and consider piping it directly into another AI agent for summarization or rephrasing.
- 💡Combine this skill with a file saving agent to automatically archive transcripts for a series of videos, facilitating batch processing and content management.
What this skill does
- •Extracts full text transcripts from YouTube video URLs or IDs
- •Generates optional timestamped segments in [MM:SS] or [HH:MM:SS] format
- •Automatically detects and pulls the best available caption source
- •Saves output to local text files using video-specific naming conventions
- •Formats plain text output into readable paragraphs by removing line breaks
When not to use it
- ✕Videos that have no captions or subtitles enabled
- ✕Scenarios requiring high-fidelity audio transcription for non-English languages not supported by the video owner
- ✕High-volume, real-time streaming analysis
Example workflow
- Identify the target YouTube video URL
- Invoke the script using the video URL as the primary argument
- Specify the optional --timestamps flag if exact timing is required
- Review the output generated in the resulting text file
- Process the paragraph-cleaned text for further summarization
Prerequisites
- –Python environment with uv installed
- –A valid YouTube video with enabled captions
- –Active internet connection for API requests
Pitfalls & limitations
- !Fails if the video author has explicitly disabled captioning
- !Auto-generated captions may contain grammatical errors or inaccuracies
- !Longer videos may experience slight delays depending on transcript length
FAQ
How it compares
Unlike manual copy-pasting from the YouTube UI, this tool automates file creation and provides consistent paragraph grouping, ensuring cleaner data for downstream tasks.
📄 Full skill instructions — original source: intellectronica/agent-skills
Extract transcripts from YouTube videos using the youtube-transcript-api.
## Usage
Run the script with a YouTube URL or video ID:
uv run scripts/get_transcript.py "VIDEO_URL_OR_ID"With timestamps:
uv run scripts/get_transcript.py "VIDEO_URL_OR_ID" --timestamps## Defaults
- **Without timestamps** (default): Plain text, one line per caption segment
- **With timestamps**:
[MM:SS] text format (or [HH:MM:SS] for longer videos)## Supported URL Formats
-
https://www.youtube.com/watch?v=VIDEO_ID-
https://youtu.be/VIDEO_ID-
https://youtube.com/embed/VIDEO_ID- Raw video ID (11 characters)
## Output
- CRITICAL: YOU MUST NEVER MODIFY THE RETURNED TRANSCRIPT
- If the transcript is without timestamps, you SHOULD clean it up so that it is arranged by complete paragraphs and the lines don't cut in the middle of sentences.
- If you were asked to save the transcript to a specific file, save it to the requested file.
- If no output file was specified, use the YouTube video ID with a
-transcript.txt suffix.## Notes
- Fetches auto-generated or manually added captions (whichever is available)
- Requires the video to have captions enabled
- Falls back to auto-generated captions if manual ones aren't available
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/youtube-transcript/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/intellectronica/agent-skills/youtube-transcript/SKILL.md - Cursor:
~/.cursor/skills/intellectronica/agent-skills/youtube-transcript/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/intellectronica/agent-skills/youtube-transcript/SKILL.md
🚀 Install with CLI:npx skills add intellectronica/agent-skills