youtube-transcribe
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYouTube 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 first ().
python3-venvsudo apt-get install -y python3-venvKeys: transcription reads ; the Gemini fallback reads . Export them, or drop a 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.
ELEVENLABS_API_KEYGEMINI_API_KEYscripts/load-keys.local.shbash
S=.claude/skills/youtube-transcribe/scripts
bash "$S/setup.sh" # creates a venv, installs yt-dlp + elevenlabs + google-genai (idempotent)如果 Debian/Ubuntu 上创建 venv 失败,请先安装 ()。
python3-venvsudo apt-get install -y python3-venv**密钥:**转录会读取 ;Gemini 兜底方案会读取 。导出这些密钥,或者放入一个 ,用任意方式解析它们(包装脚本会自动 source 它,而且它已加入 gitignore,因此绝不会被提交)。切勿在输出中打印密钥。
ELEVENLABS_API_KEYGEMINI_API_KEYscripts/load-keys.local.shMode 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 + .jsonThen read (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.
transcript.diarized.txttranscribe.sh--no-diarize--lang spa--keyterms "Kubernetes,PyTorch,yt-dlp"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.txttranscribe.sh--no-diarize--lang spa--keyterms "Kubernetes,PyTorch,yt-dlp"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/scripts1. 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 transcriptUse timestamps from to grab the exact moment someone says "as you can see here".
transcript.diarized.txt2. 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利用 中的时间戳,截取某人说出“as you can see here”时的精确时刻。
transcript.diarized.txt2. Gemini(最后手段,需要 )。 当帧仍不够用——你需要让视频本身被理解、读出屏幕上的文字,或直接回答视觉问题时,再使用它。Gemini 可直接接收 YouTube URL(无需下载);对于本地文件,它会先上传。
GEMINI_API_KEYbash
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 timestamps).
[mm:ss] - Caveats / what's unproven or salesy. Many "educational" videos are funnels — say so plainly.
Keep the raw on disk and point to it; paste quotes, not the whole thing.
transcript.txt默认应输出紧凑的知识摘要,而不是一大段文字稿:
- **它是什么:**标题、频道、时长、一句话概括。
- **核心知识:**用自己的话,以高密度且具体的方式呈现实际观点、方法或主张。
- **值得注意的细节:**数字、名称、工具、步骤,以及值得保留的引文(附 时间戳)。
[mm:ss] - 注意事项/哪些内容未经证实或带有营销色彩。 许多“教育类”视频其实是销售漏斗——应直截了当地指出。
将原始 保留在磁盘上并提供路径;粘贴引文,不要粘贴全文。
transcript.txtScripts
脚本
| Script | Does |
|---|---|
| Create the venv, install deps (idempotent) |
| Find videos for a topic — free, no API key |
| yt-dlp audio (mp3) and/or video (≤720p) + metadata.json |
| ElevenLabs Scribe v2 → text + diarized + raw json |
| Download+transcribe many; one folder per video + manifest |
| Extract stills to Read |
| Gemini visual understanding (fallback) |
| 脚本 | 作用 |
|---|---|
| 创建 venv、安装依赖(幂等) |
| 查找某个主题的视频——免费,无需 API key |
| 使用 yt-dlp 下载音频(mp3)和/或视频(≤720p),并生成 metadata.json |
| ElevenLabs Scribe v2 → 文本 + 分说话人文字稿 + 原始 json |
| 批量下载并转录;每个视频一个文件夹 + manifest |
| 提取静态帧以供读取 |
| Gemini 视觉理解(兜底方案) |
Notes
注意事项
- Scratch only. Media and transcripts go in , never in a repo. They can be large.
/tmp/claude/youtube-transcribe/… - 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 (or
yt-dlp --cookies-from-browser). For Gemini, prefer uploading the downloaded file over passing a URL it cannot reach.--cookies - This is for learning from public videos. Respect copyright and each platform's terms; do not republish someone's content as your own.
- 仅使用临时目录。 媒体文件和文字稿应放在 ,绝不能放进 repo。它们可能很大。
/tmp/claude/youtube-transcribe/… - **Scribe 限制:**每个文件 3 GB / 10 h;支持 90 多种语言,并可自动检测。约 12 min 的演讲只需一次调用。
- 年龄限制、仅会员或私有视频可能需要 cookies(或
yt-dlp --cookies-from-browser)。对于 Gemini,优先上传已下载的文件,而不是传入其无法访问的 URL。--cookies - 此 skill 仅用于从公开视频中学习。请遵守版权要求和各平台条款;不要将他人的内容作为自己的内容重新发布。