
Youtube Transcript
- 3.1k installs
- 281 repo stars
- Updated April 25, 2026
- intellectronica/agent-skills
youtube-transcript is a skill that pulls YouTube video captions as plain text or timestamped lines so researchers can search and repurpose talk content.
About
youtube-transcript extracts captions from YouTube videos using the youtube-transcript-api through a bundled uv script. Invoke it when a user provides a YouTube URL or 11-character video ID and asks for transcripts, subtitles, or captions. Supported URL formats include youtube.com watch links, youtu.be short links, embed URLs, and raw video IDs. Default output is plain text with one line per caption segment; add --timestamps for MM:SS or HH:MM:SS prefixed lines. The skill mandates never modifying the returned transcript text. For timestamp-free output, agents may reformat paragraphs without altering wording. Save to a user-specified file or default to VIDEO_ID-transcript.txt. The script fetches auto-generated or manually added captions, preferring manual captions when available and falling back to auto-generated tracks. Requires captions to be enabled on the target video. Run via uv run scripts/get_transcript.py with optional --timestamps flag for timed segments.
- Extracts YouTube captions via scripts/get_transcript.py and youtube-transcript-api.
- Supports watch, youtu.be, embed URLs, and raw 11-character video IDs.
- Optional --timestamps flag outputs MM:SS or HH:MM:SS prefixed caption lines.
- Never modifies the original transcript text returned by the API.
- Defaults output to VIDEO_ID-transcript.txt when no save path is specified.
Youtube Transcript by the numbers
- 3,145 all-time installs (skills.sh)
- +24 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #249 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Aug 2, 2026 (Skillselion catalog sync)
youtube-transcript capabilities & compatibility
- Capabilities
- youtube caption extraction · timestamped or plain text output · multiple url format parsing · file output with default naming
- Use cases
- research
What youtube-transcript says it does
CRITICAL: YOU MUST NEVER MODIFY THE RETURNED TRANSCRIPT
uv run scripts/get_transcript.py "VIDEO_URL_OR_ID" --timestamps
Fetches auto-generated or manually added captions (whichever is available)
npx skills add https://github.com/intellectronica/agent-skills --skill youtube-transcriptAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3.1k |
|---|---|
| repo stars | ★ 281 |
| Security audit | 1 / 3 scanners passed |
| Last updated | April 25, 2026 |
| Repository | intellectronica/agent-skills ↗ |
How do I get an accurate transcript from a YouTube video URL without manual copy-paste from the player?
Instantly pull accurate transcripts from any YouTube video for research, competitor analysis, or content repurposing.
Who is it for?
Researchers, content teams, and agents ingesting technical talks, demos, or conference videos for analysis.
Skip if: Skip when the video has no captions enabled or when you need audio download instead of text transcripts.
When should I use this skill?
User provides a YouTube URL or video ID and asks for transcript, subtitles, or captions with or without timestamps.
What you get
Plain-text or timestamped transcript saved to a file or returned verbatim for further analysis or repurposing.
- plain-text transcript
- timestamped caption file
By the numbers
- Bundled scripts/get_transcript.py script with optional --timestamps flag
Files
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" --timestampsDefaults
- Without timestamps (default): Plain text, one line per caption segment
- With timestamps:
[MM:SS] textformat (or[HH:MM:SS]for longer videos)
Supported URL Formats
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://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.txtsuffix.
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
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["youtube-transcript-api>=1.0.0"]
# ///
"""
Extract transcript from a YouTube video.
Usage:
uv run scripts/get_transcript.py <video_id_or_url> [--timestamps]
"""
import sys
import re
import argparse
from youtube_transcript_api import YouTubeTranscriptApi
def extract_video_id(url_or_id: str) -> str:
"""Extract video ID from various YouTube URL formats or return as-is if already an ID."""
patterns = [
r'(?:youtube\.com/watch\?v=|youtu\.be/|youtube\.com/embed/|youtube\.com/v/)([a-zA-Z0-9_-]{11})',
r'^([a-zA-Z0-9_-]{11})$'
]
for pattern in patterns:
match = re.search(pattern, url_or_id)
if match:
return match.group(1)
raise ValueError(f"Could not extract video ID from: {url_or_id}")
def format_timestamp(seconds: float) -> str:
"""Convert seconds to HH:MM:SS or MM:SS format."""
hours = int(seconds // 3600)
minutes = int((seconds % 3600) // 60)
secs = int(seconds % 60)
if hours > 0:
return f"{hours:02d}:{minutes:02d}:{secs:02d}"
return f"{minutes:02d}:{secs:02d}"
def get_transcript(video_id: str, with_timestamps: bool = False) -> str:
"""Fetch and format transcript for a YouTube video."""
api = YouTubeTranscriptApi()
transcript = api.fetch(video_id)
if with_timestamps:
lines = [f"[{format_timestamp(snippet.start)}] {snippet.text}" for snippet in transcript.snippets]
else:
lines = [snippet.text for snippet in transcript.snippets]
return '\n'.join(lines)
def main():
parser = argparse.ArgumentParser(description='Get YouTube video transcript')
parser.add_argument('video', help='YouTube video URL or video ID')
parser.add_argument('--timestamps', '-t', action='store_true',
help='Include timestamps in output')
args = parser.parse_args()
try:
video_id = extract_video_id(args.video)
transcript = get_transcript(video_id, with_timestamps=args.timestamps)
print(transcript)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == '__main__':
main()
Related skills
Forks & variants (1)
Youtube Transcript has 1 known copy in the catalog totaling 71 installs. They canonicalize to this original listing.
- connorads - 71 installs
How it compares
Pick youtube-transcript over browser automation skills when only caption text from public YouTube videos is needed.
FAQ
Which URL formats are supported?
youtube.com/watch links, youtu.be short URLs, embed URLs, and raw 11-character video IDs.
Can the transcript text be edited?
No; the skill requires never modifying the returned transcript, though paragraph formatting is allowed for non-timestamp output.
What command runs the extractor?
uv run scripts/get_transcript.py with the video URL or ID and optional --timestamps flag.
Is Youtube Transcript safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.