Youtube transcript
A collection of reusable AI agent skills for everyday use.
npx -y skills add tejask0/agent-skills --skill youtube-transcriptAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 22 days oldThe repository was created 22 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when you need the transcript, captions, subtitles, or spoken text of a YouTube video or Short — e.g. "get the transcript of this video", "summarize this YouTube video", "what does this video say", or any task that requires the words from a YouTube URL.
SKILL.md
4.7 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
YouTube Transcript
Overview
Extracts a plain-text transcript from any YouTube video or Short. Prefer existing captions first (fast, no transcription needed); fall back to local audio transcription with faster-whisper only when no captions exist.
When to Use
- User gives a YouTube URL and wants the transcript / captions / subtitles.
- User wants a video summarized, quoted, or analyzed and the words are needed first.
- Any task gated on "what was said" in a YouTube video or Short.
Requirements
Check these exist before starting; install whatever's missing (prefer an isolated venv over polluting the system Python):
yt-dlp—pip install yt-dlporbrew install yt-dlpffmpeg— required only for the whisper fallback (brew install ffmpeg/apt install ffmpeg)faster-whisper—pip install faster-whisper, only needed if Step 3 runs
Workflow
Step 1 — Resolve video id and title
yt-dlp --no-warnings --print "%(id)s" --skip-download "<url>"
yt-dlp --no-warnings --print "%(title)s" --skip-download "<url>"
Use these to name the output file, e.g. <safe-title>_<id>.txt. Sanitize the title (strip to alphanumerics/spaces/._-, replace spaces with _) before using it in a filename.
Step 2 — Try captions (manual, then auto-generated)
Work in a scratch directory. Fetch subtitles without downloading video:
yt-dlp --no-warnings --skip-download \
--write-subs --write-auto-subs \
--sub-langs "en.*,en" --sub-format vtt --convert-subs vtt \
-o "<scratch-dir>/sub.%(ext)s" "<url>"
If a .vtt file appears, clean it to plain text and stop — no transcription needed. Clean it with an inline script (strips WEBVTT headers, timestamp cues, cue numbers, inline tags, and de-duplicates repeated lines — YouTube's auto-captions repeat the same line across consecutive cues):
python3 - "<scratch-dir>/sub.en.vtt" <<'PY'
import re, sys
path = sys.argv[1]
out, seen_last = [], None
with open(path, encoding="utf-8", errors="ignore") as f:
for line in f:
line = line.rstrip("\n")
if not line.strip():
continue
if line.startswith(("WEBVTT", "Kind:", "Language:", "NOTE")):
continue
if "-->" in line:
continue
if re.fullmatch(r"\d+", line.strip()):
continue
line = re.sub(r"<[^>]+>", "", line)
line = re.sub(r"\s+", " ", line).strip()
if not line or line == seen_last:
continue
seen_last = line
out.append(line)
print(" ".join(out))
PY
Redirect stdout to the output .txt file. Done — read that file for the transcript.
Step 3 — Fallback: download audio and transcribe
Only if no .vtt file was found in Step 2:
yt-dlp --no-warnings -x --audio-format mp3 --audio-quality 0 \
-o "<scratch-dir>/audio.%(ext)s" "<url>"
Then transcribe locally with faster-whisper:
python3 - "<scratch-dir>/audio.mp3" "<output>.txt" "base" <<'PY'
import sys
from faster_whisper import WhisperModel
audio, out_file, model_size = sys.argv[1], sys.argv[2], sys.argv[3]
model = WhisperModel(model_size, device="auto", compute_type="int8")
segments, info = model.transcribe(audio, beam_size=5, vad_filter=True)
print(f"[detected language: {info.language} (p={info.language_probability:.2f})]", file=sys.stderr)
with open(out_file, "w", encoding="utf-8") as f:
f.write(" ".join(seg.text.strip() for seg in segments).strip() + "\n")
PY
model_size defaults to base; bump to small or medium for hard-to-hear audio (slower on CPU). Long videos via whisper can take minutes — warn the user and consider running in the background.
Common Mistakes
- Assuming captions always exist. Many videos (non-English, niche, or creator-disabled) have none — always check for a produced
.vttfile before falling back to whisper. - Skipping the language filter. Without
--sub-langs,yt-dlpmay grab non-English subtitles by default. - Not de-duplicating caption lines. Auto-captions repeat the same line across consecutive cues; skip a line if it matches the previous one, or the transcript reads with stutter.
- Forgetting ffmpeg before Step 3. Both
yt-dlp's audio extraction and whisper need it — check it's installed before starting the fallback, not after it fails partway through. - Long whisper runs blocking the session. CPU transcription of a long video can take several minutes; run it in the background and poll rather than blocking.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most video audio skills give in ~1.2k tokens
Counted across 622 of the 795 authors here whose files we hold, read 2026-08-07
- Read individual rule files for detailed explanationsin 21 of 622, across 10 files
- Render final videoin 13 of 622, across 6 files
- Use WAV PCM 16kHz mono audio formatin 12 of 622, across 3 files
- Use this skill when dealing with Remotion codein 11 of 622, across 4 files
- Save generated audio to a WAV filein 11 of 622, across 4 files
- Handle conversion errors gracefullyin 10 of 622, across 6 files
- Add captions to videos alwaysin 10 of 622, across 4 files
- Generate music from text descriptions using MusicGenin 9 of 622, across 2 files
- Do not skip pipeline layersin 9 of 622, across 3 files
- Do not make one tool do everythingin 9 of 622, across 3 files
- Use Azure Document Intelligence for complex PDFsin 9 of 622, across 4 files
- Never ask the user to paste their full API keyin 9 of 622, across 3 files
Said here and by no other author read
- use isolated venv
- resolve video id and title
- sanitize title before using as filename
- try fetching subtitles before downloading video
- clean vtt file to plain text
- deduplicate repeated caption lines
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.