yt-whisper-skill
Transcribes YouTube videos with the local scripts/yt-transcribe.sh and a self-contained Whisper
toolchain (its own .venv, created by scripts/install.sh). It can also turn a transcript (or any
input document) into a structured AI summary and a compact research plan.
Features
- Download YouTube audio and transcribe it with Whisper on CUDA
- Auto-pick a faster model for long videos
- Respect
t= / start= / end= timestamps in YouTube URLs
- Save to
~/Transcriptions/<Category>/ with a URL + title header
- Infer the category from the title, or force one with
--category
- Support a single URL, several URLs, or bare 11-char video IDs
- Optional language detection or forced language
- Delete temporary media after transcription
- Produce a structured
*_AISUMMARY.md report from a transcript
- Produce a compact
*_AISEARCHPLAN.md research plan from ANY input file
Quick Start
# One-time setup (creates the local venv and installs yt-dlp + whisper)
bash {baseDir}/scripts/install.sh
# Transcribe a single video
{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID"
# Several videos in one run
{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/ID1" "https://youtu.be/ID2"
# Force a language, or force a category
{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID" --language it
{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID" --category Philosophy
# Live URL with a timestamp is normalized, the time range is preserved
{baseDir}/scripts/yt-transcribe.sh "https://www.youtube.com/live/VIDEO_ID?t=276s"
If install.sh has been run, the same script is also available on PATH as yt-transcribe.
Requirements
ffmpeg on PATH
- the local venv at
{baseDir}/.venv (created by scripts/install.sh; holds yt-dlp and
openai-whisper)
- a JavaScript runtime for
yt-dlp (node, deno, bun or quickjs)
- YouTube requires one; the script auto-resolves it from PATH and the usual install locations
(
~/.local/bin, ~/.nvm/versions/node/*, ~/.deno/bin, /usr/bin, ...) and passes the
concrete path as --js-runtimes <name>:<path>
- symptom when missing:
HTTP Error 403: Forbidden — this is NOT a YouTube block and NOT a
yt-dlp bug, it means no JS runtime was found
Output Format
Each transcription is saved as ~/Transcriptions/<Category>/<safe_title>_<video_id>.txt and starts with:
URL: https://youtube.com/watch?v=...
Title: <Video Title>
[Full transcript content...]
Temporary media is deleted right after transcription.
Operating Rules
Hard rules for agents:
- MUST invoke exactly
{baseDir}/scripts/yt-transcribe.sh (or the installed yt-transcribe)
- MUST pass each requested video as a quoted positional argument to that script
- MUST prefer the full YouTube URL when the user provides one
- MUST NOT strip a provided YouTube URL down to a bare video ID before execution
youtube.com/live/<id>, youtube.com/shorts/<id>, youtu.be/<id>, and bare 11-char IDs are acceptable; the script normalizes them internally
- MUST preserve
t=, start=, and end= query params when using the user URL
- MUST use
timeout >= 7200 for normal full-video transcriptions unless the user explicitly wants a short clip
- MUST NOT use
timeout: 300 for a normal transcription request
- If the user gives a live URL, pass it through directly; do not invent a partial command from just the ID
- If the user gives multiple URLs, pass them all in one command when feasible
- On failure with
Unknown option, treat it as an invocation contract bug first, not a Whisper failure
- On failure with
HTTP Error 403: Forbidden, suspect a missing JavaScript runtime before anything
else: check the JS runtime: line the script prints, and verify with command -v node deno bun qjs
- Treat
exitCode != 0 as failure, and also treat the run as failure if the output contains
Error:, Video unavailable, Unknown option, or Audio download failed
- After a successful transcription, report the saved path first
- Do not claim success just because other transcript files already exist in
~/Transcriptions
- Never launch a second run for the same URL while another run for it is still in progress
- If
--category is omitted, infer it from the title (falling back to Unsorted); use
--category <Category> only to force a different bucket
- Do not read the whole transcript back into the LLM by default; read only a short excerpt if needed
- After a successful transcription, if the user asks for a summary/report, follow the
## Detailed AI Summary section and save ~/Transcriptions/.agent/summaries/<Category>/<same-name>_AISUMMARY.md
- When the user asks for a research plan / NotebookLM input, produce
<same-name>_AISEARCHPLAN.md
(for ANY input file, not only transcriptions) following the ### Research plan subsection, staying
under ~4,600 characters
- MUST NOT write secrets into any repo file; never commit tokens (they live in
~/.hermes/.env)
Runtime Notes
- The script logs the effective duration, model, CUDA device and the resolved JavaScript runtime before transcribing
- Long videos can legitimately take far longer than 6-10 minutes; tool timeouts must reflect video length
- Timestamped links like
...?t=276s are clipped requests, not always full-video transcriptions
Detailed AI Summary (*_AISUMMARY.md)
After a successful transcription, optionally produce a structured, implementation-oriented report of
the video and archive it next to the transcript. Purpose: turn a raw transcript into a navigable
knowledge artifact (macro-themes, sub-themes, fundamental concepts, quotes, actionable takeaways)
that is usable for frontier implementation work.
Where to save
- Directory:
~/Transcriptions/.agent/summaries/<Category>/
<Category> MUST mirror the transcript's category subfolder. A transcript in
~/Transcriptions/Technology/ maps to ~/Transcriptions/.agent/summaries/Technology/.
- If the transcript sits directly in
~/Transcriptions/ (no category), use Unsorted.
- Filename: same base name as the transcript with
_AISUMMARY.md appended
(DHH_..._NYFGCESmikA.txt -> DHH_..._NYFGCESmikA_AISUMMARY.md)
- Create the folder if missing (
mkdir -p). The .agent/ tree is metadata, never mixed with the raw transcripts.
How to build the summary
- Read the transcript ENTIRELY before writing (it can be thousands of lines). Do not sample.
- Extract, in this order: a titled header block with source metadata (URL, title, transcript path,
duration, generator, date); a TL;DR of roughly 10-12 points; an ordered map of macro-themes (table:
theme / focus / why it matters); for each macro-theme the sub-themes, fundamental concepts, verbatim
key quotes and implications for frontier implementation; a glossary of recurring fundamental
concepts; an actionable playbook; experiments/benchmarks mentioned; tensions/risks with
counter-arguments; open questions; a short method note.
- Keep it evidence-bound: every claim must trace back to the transcript and quotes must be verbatim.
Mark paraphrases/translations explicitly. Never invent content.
- Language: write the report in the user's language (default Italian), keeping technical terms in English.
Rules
- Do NOT overwrite an existing
_AISUMMARY.md without asking; if one exists, ask first or write a dated variant.
- Back up any file before overwriting it (
cp -a file file.bak-YYYYMMDD-HHMMSS).
- The summary is a separate artifact: never modify or truncate the original
.txt transcript.
Research plan (*_AISEARCHPLAN.md)
For ANY input document - a transcription, or any other file the user provides - you can produce a
research plan: a compact, formal, deterministic brief meant to be pasted into NotebookLM (or a
similar deep-research tool) so it runs research across every theme of the input. It is NOT a summary,
and NOT a list of keywords: it is a set of instructions plus one context-anchored prompt per theme.
Where to save
- Transcriptions:
~/Transcriptions/.agent/summaries/<Category>/<same-name>_AISEARCHPLAN.md
(same folder and base name as the companion _AISUMMARY.md when one exists).
- Any other input file:
<input-dir>/.agent/<input-base-name>_AISEARCHPLAN.md (create the .agent
folder next to the source file if missing).
- Never modify or replace the source file.
Size cap (NON NEGOTIABLE)
- NotebookLM rejects long inputs: keep the plan within the length of the companion report's TL;DR +
macro-theme map, i.e. at most ~4,600 characters / ~1,150 tokens. Target 3,600-4,400.
- Verify the real size before saving (
wc -c / .length). If over, cut words, never themes.
How to build it well (do NOT compress into a keyword list)
- Header (2-3 lines): the source of the input, the input file path, and the goal of the research.
- A "Deterministic instructions" block: state the analyst role and require that EVERY theme be
delivered as a card with the SAME fixed fields, in the SAME order. Default six fields: (1) framing,
5-8 lines, what it is and why it matters; (2) state of the art with cited sources; (3) evidence
for/against, separating facts from opinions; (4) contextual glossary, every technical term defined
with an example; (5) risks, limits and unknowns; (6) three follow-up questions. Also state the
language, the "no isolated technical terms" rule, the traceability rule, and the final deliverable
shape (one document, themes in order, plus N priority research questions).
- One section per theme, as
### Tn - <theme> followed by ONE short paragraph made of a sentence of
CONTEXT plus the research objective. Anchor every technical term inside the sentence and define it
inline. NEVER emit bare term lists, entity lists or isolated keywords.
- Keep it compact but complete: one short paragraph per theme, no repetition, no omissions.
Rules
- Deterministic and evidence-bound: the same structure for every theme, so results are comparable.
- Do not overwrite an existing
_AISEARCHPLAN.md without asking; back up any file before overwriting it.
- The plan is a separate artifact: the source file stays untouched.
1---2name: yt-whisper-skill3description: Locally transcribe YouTube videos with Whisper on CUDA and archive a URL/title-headed .txt under ~/Transcriptions/<Category>/ (auto model selection, category inference, timestamp handling, temp cleanup). Also generates a structured *_AISUMMARY.md report and a compact *_AISEARCHPLAN.md research plan from any input file. Use for transcription, summary, or research-plan requests.4---56# yt-whisper-skill78Transcribes YouTube videos with the local `scripts/yt-transcribe.sh` and a self-contained Whisper9toolchain (its own `.venv`, created by `scripts/install.sh`). It can also turn a transcript (or any10input document) into a structured AI summary and a compact research plan.1112## Features1314- Download YouTube audio and transcribe it with Whisper on CUDA15- Auto-pick a faster model for long videos16- Respect `t=` / `start=` / `end=` timestamps in YouTube URLs17- Save to `~/Transcriptions/<Category>/` with a URL + title header18- Infer the category from the title, or force one with `--category`19- Support a single URL, several URLs, or bare 11-char video IDs20- Optional language detection or forced language21- Delete temporary media after transcription22- Produce a structured `*_AISUMMARY.md` report from a transcript23- Produce a compact `*_AISEARCHPLAN.md` research plan from ANY input file2425## Quick Start2627```bash28# One-time setup (creates the local venv and installs yt-dlp + whisper)29bash {baseDir}/scripts/install.sh3031# Transcribe a single video32{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID"3334# Several videos in one run35{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/ID1" "https://youtu.be/ID2"3637# Force a language, or force a category38{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID" --language it39{baseDir}/scripts/yt-transcribe.sh "https://youtu.be/VIDEO_ID" --category Philosophy4041# Live URL with a timestamp is normalized, the time range is preserved42{baseDir}/scripts/yt-transcribe.sh "https://www.youtube.com/live/VIDEO_ID?t=276s"43```4445If `install.sh` has been run, the same script is also available on PATH as `yt-transcribe`.4647## Requirements4849- `ffmpeg` on PATH50- the local venv at `{baseDir}/.venv` (created by `scripts/install.sh`; holds `yt-dlp` and51 `openai-whisper`)52- a JavaScript runtime for `yt-dlp` (`node`, `deno`, `bun` or `quickjs`)53 - YouTube requires one; the script auto-resolves it from PATH and the usual install locations54 (`~/.local/bin`, `~/.nvm/versions/node/*`, `~/.deno/bin`, `/usr/bin`, ...) and passes the55 concrete path as `--js-runtimes <name>:<path>`56 - **symptom when missing:** `HTTP Error 403: Forbidden` — this is NOT a YouTube block and NOT a57 yt-dlp bug, it means no JS runtime was found5859## Output Format6061Each transcription is saved as `~/Transcriptions/<Category>/<safe_title>_<video_id>.txt` and starts with:6263```64URL: https://youtube.com/watch?v=...65Title: <Video Title>6667[Full transcript content...]68```6970Temporary media is deleted right after transcription.7172## Operating Rules7374Hard rules for agents:7576- **MUST** invoke exactly `{baseDir}/scripts/yt-transcribe.sh` (or the installed `yt-transcribe`)77- **MUST** pass each requested video as a quoted positional argument to that script78- **MUST** prefer the full YouTube URL when the user provides one79- **MUST NOT** strip a provided YouTube URL down to a bare video ID before execution80- `youtube.com/live/<id>`, `youtube.com/shorts/<id>`, `youtu.be/<id>`, and bare 11-char IDs are acceptable; the script normalizes them internally81- **MUST** preserve `t=`, `start=`, and `end=` query params when using the user URL82- **MUST** use `timeout >= 7200` for normal full-video transcriptions unless the user explicitly wants a short clip83- **MUST NOT** use `timeout: 300` for a normal transcription request84- If the user gives a live URL, pass it through directly; do not invent a partial command from just the ID85- If the user gives multiple URLs, pass them all in one command when feasible86- On failure with `Unknown option`, treat it as an invocation contract bug first, not a Whisper failure87- On failure with `HTTP Error 403: Forbidden`, suspect a missing JavaScript runtime before anything88 else: check the `JS runtime:` line the script prints, and verify with `command -v node deno bun qjs`89- Treat `exitCode != 0` as failure, and also treat the run as failure if the output contains90 `Error:`, `Video unavailable`, `Unknown option`, or `Audio download failed`91- After a successful transcription, report the saved path first92- Do not claim success just because other transcript files already exist in `~/Transcriptions`93- Never launch a second run for the same URL while another run for it is still in progress94- If `--category` is omitted, infer it from the title (falling back to `Unsorted`); use95 `--category <Category>` only to force a different bucket96- Do not read the whole transcript back into the LLM by default; read only a short excerpt if needed97- After a successful transcription, if the user asks for a summary/report, follow the98 `## Detailed AI Summary` section and save `~/Transcriptions/.agent/summaries/<Category>/<same-name>_AISUMMARY.md`99- When the user asks for a research plan / NotebookLM input, produce `<same-name>_AISEARCHPLAN.md`100 (for ANY input file, not only transcriptions) following the `### Research plan` subsection, staying101 under ~4,600 characters102- **MUST NOT** write secrets into any repo file; never commit tokens (they live in `~/.hermes/.env`)103104## Runtime Notes105106- The script logs the effective duration, model, CUDA device and the resolved JavaScript runtime before transcribing107- Long videos can legitimately take far longer than 6-10 minutes; tool timeouts must reflect video length108- Timestamped links like `...?t=276s` are clipped requests, not always full-video transcriptions109110## Detailed AI Summary (`*_AISUMMARY.md`)111112After a successful transcription, optionally produce a structured, implementation-oriented report of113the video and archive it next to the transcript. Purpose: turn a raw transcript into a navigable114knowledge artifact (macro-themes, sub-themes, fundamental concepts, quotes, actionable takeaways)115that is usable for frontier implementation work.116117### Where to save118119- Directory: `~/Transcriptions/.agent/summaries/<Category>/`120 - `<Category>` MUST mirror the transcript's category subfolder. A transcript in121 `~/Transcriptions/Technology/` maps to `~/Transcriptions/.agent/summaries/Technology/`.122 - If the transcript sits directly in `~/Transcriptions/` (no category), use `Unsorted`.123- Filename: same base name as the transcript with `_AISUMMARY.md` appended124 (`DHH_..._NYFGCESmikA.txt` -> `DHH_..._NYFGCESmikA_AISUMMARY.md`)125- Create the folder if missing (`mkdir -p`). The `.agent/` tree is metadata, never mixed with the raw transcripts.126127### How to build the summary1281291. Read the transcript ENTIRELY before writing (it can be thousands of lines). Do not sample.1302. Extract, in this order: a titled header block with source metadata (URL, title, transcript path,131 duration, generator, date); a TL;DR of roughly 10-12 points; an ordered map of macro-themes (table:132 theme / focus / why it matters); for each macro-theme the sub-themes, fundamental concepts, verbatim133 key quotes and implications for frontier implementation; a glossary of recurring fundamental134 concepts; an actionable playbook; experiments/benchmarks mentioned; tensions/risks with135 counter-arguments; open questions; a short method note.1363. Keep it evidence-bound: every claim must trace back to the transcript and quotes must be verbatim.137 Mark paraphrases/translations explicitly. Never invent content.1384. Language: write the report in the user's language (default Italian), keeping technical terms in English.139140### Rules141142- Do NOT overwrite an existing `_AISUMMARY.md` without asking; if one exists, ask first or write a dated variant.143- Back up any file before overwriting it (`cp -a file file.bak-YYYYMMDD-HHMMSS`).144- The summary is a separate artifact: never modify or truncate the original `.txt` transcript.145146### Research plan (`*_AISEARCHPLAN.md`)147148For ANY input document - a transcription, or any other file the user provides - you can produce a149**research plan**: a compact, formal, deterministic brief meant to be pasted into NotebookLM (or a150similar deep-research tool) so it runs research across every theme of the input. It is NOT a summary,151and NOT a list of keywords: it is a set of instructions plus one context-anchored prompt per theme.152153**Where to save**154155- Transcriptions: `~/Transcriptions/.agent/summaries/<Category>/<same-name>_AISEARCHPLAN.md`156 (same folder and base name as the companion `_AISUMMARY.md` when one exists).157- Any other input file: `<input-dir>/.agent/<input-base-name>_AISEARCHPLAN.md` (create the `.agent`158 folder next to the source file if missing).159- Never modify or replace the source file.160161**Size cap (NON NEGOTIABLE)**162163- NotebookLM rejects long inputs: keep the plan within the length of the companion report's TL;DR +164 macro-theme map, i.e. at most ~4,600 characters / ~1,150 tokens. Target 3,600-4,400.165- Verify the real size before saving (`wc -c` / `.length`). If over, cut words, never themes.166167**How to build it well (do NOT compress into a keyword list)**1681691. Header (2-3 lines): the source of the input, the input file path, and the goal of the research.1702. A "Deterministic instructions" block: state the analyst role and require that EVERY theme be171 delivered as a card with the SAME fixed fields, in the SAME order. Default six fields: (1) framing,172 5-8 lines, what it is and why it matters; (2) state of the art with cited sources; (3) evidence173 for/against, separating facts from opinions; (4) contextual glossary, every technical term defined174 with an example; (5) risks, limits and unknowns; (6) three follow-up questions. Also state the175 language, the "no isolated technical terms" rule, the traceability rule, and the final deliverable176 shape (one document, themes in order, plus N priority research questions).1773. One section per theme, as `### Tn - <theme>` followed by ONE short paragraph made of a sentence of178 CONTEXT plus the research objective. Anchor every technical term inside the sentence and define it179 inline. NEVER emit bare term lists, entity lists or isolated keywords.1804. Keep it compact but complete: one short paragraph per theme, no repetition, no omissions.181182**Rules**183184- Deterministic and evidence-bound: the same structure for every theme, so results are comparable.185- Do not overwrite an existing `_AISEARCHPLAN.md` without asking; back up any file before overwriting it.186- The plan is a separate artifact: the source file stays untouched.