agentleFS
tejask0tejask0/agent-skills/youtube-transcript/SKILL.md

youtube-transcript

Skill0 starsChanged 4 months agoMITView on GitHub

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.

  • Installs packages

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use research-prompt, ship-learn-next and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • matyasstochSkill

    research-prompt

    Write a single-paragraph Deep Research prompt to hand to a human researcher (or a deep-research AI). Use when the user wants a research brief, a "deep research prompt", a one-paragraph task for a researcher, or asks "what should our researcher look for". Produces ONE tight paragraph with full context, numbered sub-questions, and per-finding output format.

    Also in 3 projects that use this

  • michalparkolaSkill

    ship-learn-next

    Transform learning content (like YouTube transcripts, articles, tutorials) into actionable implementation plans using the Ship-Learn-Next framework. Use when user wants to turn advice, lessons, or educational content into concrete action steps, reps, or a learning quest.

    Also in 4 projects that use this

  • huskerjeffSkill

    youtube-search

    Search YouTube and extract video metadata and captions using yt-dlp. Use when the user wants to search YouTube, find video transcripts, research topics via YouTube, or feed video content into other tools like NotebookLM.

    Also in 4 projects that use this

  • michalparkolaSkill

    article-extractor

    Extract clean article content from URLs (blog posts, articles, tutorials) and save as readable text. Use when user wants to download, extract, or save an article/blog post from a URL without ads, navigation, or clutter.

    Also in 3 projects that use this

  • MicrosoftSkill

    web-search

    Also in 3 projects that use this

  • ArogyaReddySkill

    changelog-generator

    Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check these exist before starting.

    line 20
  2. Very specific:

    Use these to name the output file, e.g.

    line 35
  3. Very specific:

    If a .vtt file appears, clean it to plain text and stop — no transcription needed.

    line 48
  4. Very specific:

    Only if no .vtt file was found in Step 2:

    line 80

“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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-dlp or brew install yt-dlp
  • ffmpeg — 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 .vtt file before falling back to whisper.
  • Skipping the language filter. Without --sub-langs, yt-dlp may 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.