youtube-transcribe

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

YouTube Transcribe

YouTube Transcribe

Turn a video — or a whole topic's worth of videos — into text you can actually read and reason over. The point is not to hand back a transcript and stop; it is to absorb what the video teaches and report it back usefully.
Pipeline: find → download → transcribe → (look at frames) → (ask Gemini) → synthesize. Most tasks only need the middle. Reach for the visual steps when the spoken words are not enough.
将一个视频——或围绕某个主题的一整组视频——转换成真正可读、可据此推理的文本。重点不是丢回一份文字稿就结束,而是吸收视频所传授的知识,并以有用的方式汇报。
处理流水线:查找 → 下载 → 转录 →(查看帧)→(询问 Gemini)→ 综合整理。 大多数任务只需要中间几步。当口头内容不够时,再使用视觉处理步骤。

Setup (once per machine)

设置(每台机器执行一次)

bash
S=.claude/skills/youtube-transcribe/scripts
bash "$S/setup.sh"    # creates a venv, installs yt-dlp + elevenlabs + google-genai (idempotent)
If venv creation fails on Debian/Ubuntu, install
python3-venv
first (
sudo apt-get install -y python3-venv
).
Keys: transcription reads
ELEVENLABS_API_KEY
; the Gemini fallback reads
GEMINI_API_KEY
. Export them, or drop a
scripts/load-keys.local.sh
that resolves them however you like (the wrappers source it automatically, and it is gitignored so it never ships). Never print a key into your output.
bash
S=.claude/skills/youtube-transcribe/scripts
bash "$S/setup.sh"    # creates a venv, installs yt-dlp + elevenlabs + google-genai (idempotent)
如果 Debian/Ubuntu 上创建 venv 失败,请先安装
python3-venv
(
sudo apt-get install -y python3-venv
)。
**密钥:**转录会读取
ELEVENLABS_API_KEY
;Gemini 兜底方案会读取
GEMINI_API_KEY
。导出这些密钥,或者放入一个
scripts/load-keys.local.sh
,用任意方式解析它们(包装脚本会自动 source 它,而且它已加入 gitignore,因此绝不会被提交)。切勿在输出中打印密钥。

Mode A — one video

模式 A——单个视频

bash
S=.claude/skills/youtube-transcribe/scripts
OUT=/tmp/claude/youtube-transcribe/<video-id>        # scratch; never a repo

bash "$S/download.sh"   "<url>" "$OUT" audio          # audio.mp3 + metadata.json
bash "$S/transcribe.sh" "$OUT/audio.mp3" "$OUT"        # transcript.txt + .diarized.txt + .json
Then read
transcript.diarized.txt
(timestamped, speaker-grouped) and write up what matters: the thesis, the steps/method, the concrete claims, the numbers, anything actionable. Skip the filler. If it is a tutorial, capture the actual how; if it is a talk, capture the argument and evidence.
transcribe.sh
flags:
--no-diarize
(single speaker),
--lang spa
(hint; omit to auto-detect),
--keyterms "Kubernetes,PyTorch,yt-dlp"
(spell names/jargon right — Scribe will otherwise mangle them, which poisons the summary).
bash
S=.claude/skills/youtube-transcribe/scripts
OUT=/tmp/claude/youtube-transcribe/<video-id>        # scratch; never a repo

bash "$S/download.sh"   "<url>" "$OUT" audio          # audio.mp3 + metadata.json
bash "$S/transcribe.sh" "$OUT/audio.mp3" "$OUT"        # transcript.txt + .diarized.txt + .json
然后读取
transcript.diarized.txt
(带时间戳、按说话者分组),并整理出重要内容:核心论点、步骤/方法、具体主张、数字,以及任何可执行事项。略去填充内容。如果教程,记录真正的操作方法;如果是演讲,记录论证与证据。
transcribe.sh
支持以下参数:
--no-diarize
(单一说话人)、
--lang spa
(指定语言提示;省略则自动检测)、
--keyterms "Kubernetes,PyTorch,yt-dlp"
(确保专有名词和术语拼写正确——否则 Scribe 可能会把它们弄错,进而污染摘要)。

Mode B — a topic (many videos)

模式 B——某个主题(多个视频)

Search is free and needs no API key — it uses yt-dlp's own search.
bash
S=.claude/skills/youtube-transcribe/scripts
搜索免费且无需 API key——它使用 yt-dlp 自带的搜索。
bash
S=.claude/skills/youtube-transcribe/scripts

1. Find candidates — pick the good ones by title/channel/duration before spending transcription on them.

1. Find candidates — pick the good ones by title/channel/duration before spending transcription on them.

bash "$S/search.sh" "quantitative trading with LLMs" 20 # id | duration | channel | title bash "$S/search.sh" "quantitative trading with LLMs" 20 --date # sort by newest instead of relevance
bash "$S/search.sh" "quantitative trading with LLMs" 20 # id | duration | channel | title bash "$S/search.sh" "quantitative trading with LLMs" 20 --date # sort by newest instead of relevance

2. Transcribe the chosen ones in one go (each lands in <OUT>/<video-id>/).

2. Transcribe the chosen ones in one go (each lands in <OUT>/<video-id>/).

bash "$S/search.sh" "quantitative trading with LLMs" 20 --urls > /tmp/urls.txt
bash "$S/search.sh" "quantitative trading with LLMs" 20 --urls > /tmp/urls.txt

...edit /tmp/urls.txt down to the 10-15 worth watching, then:

...edit /tmp/urls.txt down to the 10-15 worth watching, then:

bash "$S/batch.sh" /tmp/claude/youtube-transcribe/topic /tmp/urls.txt

Be selective, not exhaustive: a 3-hour stream and a 40-second Short are rarely both worth it. Prefer substance (duration, channel authority, title specificity) over raw view count. Then read every transcript and produce **one synthesis** across all of them — the consensus, the disagreements, the best single source, and what is still unanswered — not N separate summaries.
bash "$S/batch.sh" /tmp/claude/youtube-transcribe/topic /tmp/urls.txt

要有选择性,而不是穷尽一切:3 小时的直播和 40 秒的 Short 很少都值得看。优先考虑实质内容(时长、频道权威性、标题具体程度),而不是单纯播放量。然后阅读每份文字稿,产出一份**跨所有视频的综合结论**,涵盖共识、分歧、最佳单一信息源和尚无定论的问题——不要给出 N 份彼此独立的摘要。

Seeing what is on screen

查看屏幕上显示的内容

The transcript misses slides, charts, code, dashboards, product shots, and anyone pointing at "this". Two escalating tools:
1. Frames (cheap, local). Download the video, pull stills, and Read the JPGs.
bash
bash "$S/download.sh" "<url>" "$OUT" video                 # video.mp4 (≤720p)
bash "$S/frames.sh"   "$OUT/video.mp4" "$OUT/frames" every 30          # one frame / 30s
bash "$S/frames.sh"   "$OUT/video.mp4" "$OUT/frames" at 00:01:20,00:04:05   # exact moments from the transcript
Use timestamps from
transcript.diarized.txt
to grab the exact moment someone says "as you can see here".
2. Gemini (last resort, needs GEMINI_API_KEY). When frames are not enough — you need the video understood, on-screen text read, or a direct visual question answered. Gemini ingests the YouTube URL directly (no download); for a local file it uploads first.
bash
bash "$S/ask-gemini.sh" "<url-or-local-mp4>" "What indicators are shown on the chart at minute 4, and what are their values?"
Gemini is the fallback, not the default: transcription is cheaper, faster, and usually sufficient. Go to Gemini only when the answer is genuinely visual.
文字稿会漏掉幻灯片、图表、代码、仪表板、产品截图,以及有人指着“这个”的场景。可以使用两种逐级增强的工具:
1. 帧提取(便宜、本地)。 下载视频,提取静态帧,然后读取 JPG。
bash
bash "$S/download.sh" "<url>" "$OUT" video                 # video.mp4 (≤720p)
bash "$S/frames.sh"   "$OUT/video.mp4" "$OUT/frames" every 30          # one frame / 30s
bash "$S/frames.sh"   "$OUT/video.mp4" "$OUT/frames" at 00:01:20,00:04:05   # exact moments from the transcript
利用
transcript.diarized.txt
中的时间戳,截取某人说出“as you can see here”时的精确时刻。
2. Gemini(最后手段,需要
GEMINI_API_KEY
)。
当帧仍不够用——你需要让视频本身被理解、读出屏幕上的文字,或直接回答视觉问题时,再使用它。Gemini 可直接接收 YouTube URL(无需下载);对于本地文件,它会先上传。
bash
bash "$S/ask-gemini.sh" "<url-or-local-mp4>" "What indicators are shown on the chart at minute 4, and what are their values?"
Gemini 是兜底方案,而非默认方案:转录更便宜、更快,而且通常足够。只有当答案确实依赖视觉内容时,才使用 Gemini。

Output — absorb, do not dump

输出——吸收内容,而非直接倾倒

Default to a tight knowledge digest, not a wall of transcript:
  • What it is: title, channel, length, one-line framing.
  • Core knowledge: the actual ideas/method/claims, in your own words, dense and specific.
  • Notable specifics: numbers, names, tools, steps, quotes worth keeping (with
    [mm:ss]
    timestamps).
  • Caveats / what's unproven or salesy. Many "educational" videos are funnels — say so plainly.
Keep the raw
transcript.txt
on disk and point to it; paste quotes, not the whole thing.
默认应输出紧凑的知识摘要,而不是一大段文字稿:
  • **它是什么:**标题、频道、时长、一句话概括。
  • **核心知识:**用自己的话,以高密度且具体的方式呈现实际观点、方法或主张。
  • **值得注意的细节:**数字、名称、工具、步骤,以及值得保留的引文(附
    [mm:ss]
    时间戳)。
  • 注意事项/哪些内容未经证实或带有营销色彩。 许多“教育类”视频其实是销售漏斗——应直截了当地指出。
将原始
transcript.txt
保留在磁盘上并提供路径;粘贴引文,不要粘贴全文。

Scripts

脚本

ScriptDoes
scripts/setup.sh
Create the venv, install deps (idempotent)
scripts/search.sh "<q>" [n] [--date] [--urls]
Find videos for a topic — free, no API key
scripts/download.sh <url> <out> [audio|video|both]
yt-dlp audio (mp3) and/or video (≤720p) + metadata.json
scripts/transcribe.sh <audio> <out> [--no-diarize] [--lang] [--keyterms]
ElevenLabs Scribe v2 → text + diarized + raw json
scripts/batch.sh <outdir> <urls-file>
Download+transcribe many; one folder per video + manifest
scripts/frames.sh <video> <out> every <sec> | at <ts,ts>
Extract stills to Read
scripts/ask-gemini.sh <url|file> "<question>"
Gemini visual understanding (fallback)
脚本作用
scripts/setup.sh
创建 venv、安装依赖(幂等)
scripts/search.sh "<q>" [n] [--date] [--urls]
查找某个主题的视频——免费,无需 API key
scripts/download.sh <url> <out> [audio|video|both]
使用 yt-dlp 下载音频(mp3)和/或视频(≤720p),并生成 metadata.json
scripts/transcribe.sh <audio> <out> [--no-diarize] [--lang] [--keyterms]
ElevenLabs Scribe v2 → 文本 + 分说话人文字稿 + 原始 json
scripts/batch.sh <outdir> <urls-file>
批量下载并转录;每个视频一个文件夹 + manifest
scripts/frames.sh <video> <out> every <sec> | at <ts,ts>
提取静态帧以供读取
scripts/ask-gemini.sh <url|file> "<question>"
Gemini 视觉理解(兜底方案)

Notes

注意事项

  • Scratch only. Media and transcripts go in
    /tmp/claude/youtube-transcribe/…
    , never in a repo. They can be large.
  • Scribe limits: 3 GB / 10 h per file; 90+ languages, auto-detected. A ~12 min talk is a single call.
  • Age-restricted / members-only / private videos may need cookies (
    yt-dlp --cookies-from-browser
    or
    --cookies
    ). For Gemini, prefer uploading the downloaded file over passing a URL it cannot reach.
  • This is for learning from public videos. Respect copyright and each platform's terms; do not republish someone's content as your own.
  • 仅使用临时目录。 媒体文件和文字稿应放在
    /tmp/claude/youtube-transcribe/…
    ,绝不能放进 repo。它们可能很大。
  • **Scribe 限制:**每个文件 3 GB / 10 h;支持 90 多种语言,并可自动检测。约 12 min 的演讲只需一次调用。
  • 年龄限制、仅会员或私有视频可能需要 cookies(
    yt-dlp --cookies-from-browser
    或
    --cookies
    )。对于 Gemini,优先上传已下载的文件,而不是传入其无法访问的 URL。
  • 此 skill 仅用于从公开视频中学习。请遵守版权要求和各平台条款;不要将他人的内容作为自己的内容重新发布。