yt2sub
Skill0 starsChanged 6 days agoMITView on GitHub
Transcribes a YouTube video or local audio/video file to plain text with ./fw yt2sub. Use when a task needs spoken content as text: the user gives a YouTube URL or media file to transcribe, summarize, or 觀看, or wants notes or an assignment written from a talk, lecture, or podcast. Tries YouTube captions first (zh-Hant/en) and falls back to local faster-whisper, so use it instead of a hand-rolled yt-dlp + whisper pipeline.
- Installs packages
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cite-checkSkill
- count-zhSkill
- deck-imageSkill
- deck-planSkill
- deck-runtimeSkill
- deck-svgSkill
- diagramSkill
- fix-termsSkill
- flow-checkSkill
- gpt-reviewSkill
- house-styleSkill
- safe-editSkill
- source-kitSkill
- topic-scoutSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Whisper fallback: If no usable captions exist (or the input is a local audio file, or you pass --whisper), it downloads the audio and …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
yt2sub — YouTube / audio → text
The framework ships ./fw yt2sub (run from the course root). This skill is the entry point for "watch/transcribe this video" requests; the script is the implementation. Run — and extend — ./fw yt2sub rather than building your own yt-dlp + whisper pipeline or calling a transcription API.
How it works
- Captions first. For a YouTube URL it fetches YouTube's own caption track and cleans it to plain text — near-instant, no GPU/CPU cost. Language preference is
en, en-US, en-GB, zh-Hant, zh-TW, zh-Hans, zh, ja, ko; the first track that exists wins. - Whisper fallback. If no usable captions exist (or the input is a local audio file, or you pass
--whisper), it downloads the audio and transcribes withfaster-whisper(large-v3-turbo, CPU, int8). This is accurate but slow (~real-time on CPU).
Usage
./fw yt2sub <youtube-url|audio-file> [output-dir] # default out: cwd
./fw yt2sub --whisper <url|file> [output-dir] # skip captions, force ASROutput is written to <output-dir>/<title>.txt; the final stdout line is Done: <path>. The transcription method is reported on stderr ((via captions) / (via whisper)).
Env knobs:
YT2SUB_LANGS— override the caption language preference, e.g.YT2SUB_LANGS="ja,en" ./fw yt2sub <url>.WHISPER_MODEL— Whisper model for the fallback (defaultlarge-v3-turbo).
When to reach for each path
- Captions are ideal when you just need to read/understand the content (summaries, reflections, homework). They reflect the spoken language; for an English talk you get English text to write Chinese notes from.
- Whisper (
--whisper) when the video has no captions, when captions are auto-translations you don't trust, or for a local recording.
Setup / dependencies
yt-dlp(uv tool install yt-dlp) — required for any URL. Invoke yt-dlp with--js-runtimes node(local node); do not add--remote-components ejs:github— it pulls and runs remote JS and the sandbox classifier denies it (the script already omits it).python3— for caption cleaning (present by default on macOS).- Whisper fallback only:
ffmpeg, and a venv at~/tools/yt2sub/venvwithfaster-whisper(uv venv ~/tools/yt2sub/venv && uv pip install --python ~/tools/yt2sub/venv/bin/python faster-whisper).
Gotchas
- YouTube's timedtext (caption) endpoint rate-limits (
HTTP 429) easily. The script requests one language at a time to stay under it; if it still 429s for every language, it falls back to Whisper automatically. - The caption cleaner keeps only the finalized lines of YouTube's rolling auto-caption format, so the text is complete and non-overlapping — but it is not a verbatim, punctuation-perfect transcript. Good for comprehension and writing; use
--whisperif you need higher fidelity.
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
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.

