Back to Workflow & Productivity

youtube-transcript

youtubetranscriptcaptionssubtitlesvideocontent extractionapidata processing
273📄 CC0-1.0🕒 2026-04-25Source ↗

Install this skill

npx skills add intellectronica/agent-skills

Works 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

  1. Identify the target YouTube video URL
  2. Invoke the script using the video URL as the primary argument
  3. Specify the optional --timestamps flag if exact timing is required
  4. Review the output generated in the resulting text file
  5. 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

Does this work on videos without manually added captions?
Yes. The tool automatically falls back to YouTube's auto-generated captions if manual ones are unavailable.
What happens if I don't specify a filename?
The script defaults to using the video ID as the filename with a '-transcript.txt' suffix.
Can I get timestamps for every single word?
No, the tool returns timestamps per caption segment, which usually encompasses a complete phrase or sentence.
Is the output text modified during the process?
The raw transcript content remains unchanged, though the tool may clean up formatting to group text into natural paragraphs.

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.

Source & trust

273 stars📄 CC0-1.0🕒 Updated 2026-04-25
📄 Full skill instructions — original source: intellectronica/agent-skills
# YouTube Transcript

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)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/youtube-transcript/
  3. Save the file as SKILL.md
  4. 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

Read the Master Guide: Mastering Agent Skills

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid workflow & productivity issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Workflow & Productivity and is published by intellectronica, maintained in intellectronica/agent-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.