CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

youtube-transcript

Fetches a YouTube video's transcript as plain text (optional [mm:ss] timestamps) with a stdlib-only Python script that works from cloud IPs where yt-dlp and youtube-transcript-api are blocked. Use before summarising or quoting a video; triggers on a youtube.com / youtu.be link plus "transcript", "summarise this video", or "/youtube-transcript".

Quality

94%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

SKILL.md
Quality
Evals
Security

YouTube Transcript

Gets a YouTube video's captions as text in one command. Why the script takes this route, and what fails instead: references/why-innertube.md.

Procedure

  1. Run the script with the URL or the 11-character video id:

    python3 -I <skill_dir>/scripts/yt_transcript.py "<url-or-id>" > transcript.txt
    • --lang <code> picks the caption language (default en). It prefers a human-made track and falls back to an auto-generated (asr) one, then to any track.
    • --timestamps emits one [mm:ss] text line per caption instead of one paragraph.
    • stderr carries # <title> [<lang>, <manual|asr>]; stdout carries only the transcript.
  2. Read transcript.txt from disk. Never paste a long transcript back to the user verbatim: summarise or quote short passages.

  3. Tell the user when the track is asr: auto-captions mishear names and jargon, so quote them with that caveat.

# ✓ Right — one call, output to a file
python3 -I scripts/yt_transcript.py "https://youtu.be/J9NQTYUP6k0" --timestamps > transcript.txt

# ✗ Wrong — these are bot-blocked from cloud IPs; do not try them first
pip install youtube-transcript-api && youtube_transcript_api J9NQTYUP6k0
yt-dlp --write-auto-subs --skip-download "https://youtu.be/J9NQTYUP6k0"

When it fails

Exit message containsDo this
LOGIN_REQUIRED / not a bot on both clientsBump clientVersion and the matching User-Agent for ANDROID and IOS in CLIENTS to the current app versions, then retry once
HTTP 429Wait a minute and retry once; the IP is rate-limited
any other HTTP <code> or network errorRetry once; if it repeats, the host is unreachable from this session — report it verbatim
unreadable caption track or unexpected responseRetry once; if it repeats, YouTube is serving a block page to this IP — treat it as unobtainable (below). The video may still have captions, so never say it has none
UNPLAYABLE / ERROR with a reasonThe video is private, removed, or age/region-restricted; report the reason to the user
no captionsThe video has no caption tracks; say so — do not invent content

If it still fails, tell the user the transcript is unobtainable from this IP. Offer three ways forward: run the script on a residential IP (a local machine), set a proxy, or paste the transcript from YouTube's "Show transcript" panel. The video title is always available without a block from https://www.youtube.com/oembed?url=<url>&format=json.

Repository

mthines/agent-skills

Path

skills/analysis/youtube-transcript/SKILL.md

Last updated
First committed

Is this your skill?

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.