youtube-transcription

使用 OpenAI Whisper 和 yt-dlp 将 YouTube 视频转录为文本。适用于需要从 YouTube 视频获取字幕、将语音转换为文本、生成 SRT/VTT 字幕文件或从链接提取语音内容的场景。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "youtube-transcription":https://skillpi.com/zh/skills/deepskill-690516427873d855c7147f2968c42a53b0da7eb374b1602f777e2348200263ba。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用 OpenAI Whisper 和 yt-dlp 将 YouTube 视频转录为文本。适用于需要从 YouTube 视频获取字幕、将语音转换为文本、生成 SRT/VTT 字幕文件或从链接提取语音内容的场景。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: youtube-transcription
description: >-
  Transcribe YouTube videos to text using OpenAI Whisper and yt-dlp. Use when
  the user wants to get a transcript from a YouTube video, generate subtitles,
  convert video speech to text, create SRT/VTT captions, or extract spoken
  content from YouTube URLs.
license: Apache-2.0
compatibility: >-
  Requires Python 3.8+, ffmpeg, and CUDA GPU recommended for large models.
  Install: pip install openai-whisper yt-dlp. CPU works but is slower.
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: content
  tags: [youtube, transcription, whisper, subtitles, speech-to-text]

YouTube Video Transcription

Transcribe YouTube videos to text using OpenAI Whisper and yt-dlp.

Overview

This skill downloads audio from YouTube videos using yt-dlp and transcribes it using OpenAI's Whisper model. Supports multiple output formats (txt, srt, vtt, json) and various model sizes for different accuracy/speed tradeoffs.

Instructions

1. Install dependencies

# Install whisper and yt-dlp
pip install openai-whisper yt-dlp

# Verify ffmpeg is installed (required for audio processing)
ffmpeg -version

If ffmpeg is missing:

2. Download audio from YouTube

# Download best audio quality as WAV
yt-dlp -x --audio-format wav -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# Download as MP3 (smaller file)
yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# Download with video ID as filename (safer for special characters)
yt-dlp -x --audio-format wav -o "%(id)s.%(ext)s" "YOUTUBE_URL"

3. Choose Whisper model

Model Parameters VRAM Relative Speed Use Case
tiny 39M ~1 GB ~32x Quick drafts, testing
base 74M ~1 GB ~16x Fast transcription
small 244M ~2 GB ~6x Good balance
medium 769M ~5 GB ~2x High accuracy
large 1550M ~10 GB 1x Best accuracy

English-only models (tiny.en, base.en, small.en, medium.en) are faster for English content.

4. Run transcription

CLI approach:

# Basic transcription (auto-detect language)
whisper audio.wav --model medium

# Specify language for better accuracy
whisper audio.wav --model medium --language en

# Output specific format
whisper audio.wav --model medium --output_format srt

# All formats at once
whisper audio.wav --model medium --output_format all

# Specify output directory
whisper audio.wav --model medium --output_dir ./transcripts

Python approach:

import whisper

# Load model (downloads on first run)
model = whisper.load_model("medium")

# Transcribe
result = model.transcribe("audio.wav", language="en")

# Get plain text
print(result["text"])

# Get segments with timestamps
for segment in result["segments"]:
    print(f"[{segment['start']:.2f} - {segment['end']:.2f}] {segment['text']}")

5. One-liner pipeline

Combine download and transcription:

# Download and transcribe in one command
yt-dlp -x --audio-format wav -o "audio.wav" "YOUTUBE_URL" && whisper audio.wav --model medium --output_format all

6. Alternative: yt-whisper tool

For simpler workflow, use the dedicated yt-whisper package:

# Install
pip install git+https://github.com/m1guelpf/yt-whisper.git

# Transcribe directly from URL
yt_whisper "https://www.youtube.com/watch?v=VIDEO_ID"

# With options
yt_whisper "YOUTUBE_URL" --model medium --language en --output_format srt

Output Formats

Format Extension Description
txt .txt Plain text transcript
srt .srt SubRip subtitle format (with timestamps)
vtt .vtt WebVTT subtitle format
tsv .tsv Tab-separated values
json .json Full data with word-level timestamps

Examples

<example> User: Transcribe this YouTube video to text Steps:

  1. yt-dlp -x --audio-format wav -o "video.wav" "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  2. whisper video.wav --model medium --language en --output_format txt Output: video.txt with full transcript </example>

<example> User: Generate SRT subtitles for a YouTube lecture Steps:

  1. yt-dlp -x --audio-format wav -o "lecture.wav" "https://www.youtube.com/watch?v=LECTURE_ID"
  2. whisper lecture.wav --model medium --output_format srt Output: lecture.srt with timestamped subtitles </example>

<example> User: Transcribe a Spanish YouTube video Steps:

  1. yt-dlp -x --audio-format wav -o "spanish.wav" "https://www.youtube.com/watch?v=VIDEO_ID"
  2. whisper spanish.wav --model medium --language es --output_format all Output: spanish.txt, spanish.srt, spanish.vtt, spanish.json </example>

<example> User: Quick transcription of a short video (speed over accuracy) Command: yt-dlp -x --audio-format mp3 -o "quick.mp3" "URL" && whisper quick.mp3 --model tiny.en </example>

<example> User: Get transcript with timestamps in Python

import whisper
model = whisper.load_model("medium")
result = model.transcribe("audio.wav")
for seg in result["segments"]:
    print(f"[{seg['start']:.1f}s] {seg['text']}")

</example>

Guidelines

  • Use --language flag when you know the spoken language for significantly better accuracy
  • For long videos (>1 hour), use small or medium model to balance speed and accuracy
  • English-only models (.en suffix) are faster and more accurate for English content
  • GPU with CUDA dramatically speeds up transcription; CPU works but is 5-10x slower
  • If transcription fails, ensure ffmpeg is properly installed and in PATH
  • For videos with background music, larger models (medium/large) handle it better
  • Clean up audio files after transcription to save disk space
  • Use --output_format all to get every format at once, then choose what you need

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 解决 YouTube 视频转录这一明确且高频的用户需求
  • 支持多种输出格式(txt/srt/vtt/json),满足不同使用场景
  • 提供 CLI 和 Python 两种使用方式,覆盖广泛用户群体
触发精准90/100

亮点

  • description 清晰完整,覆盖转录、字幕生成、语音提取等多种场景
  • 触发词具体明确(YouTube, transcribe, subtitles, SRT, VTT)
  • 边界清晰,不易与其他 Skill 混淆
结构规范95/100

亮点

  • 步骤划分清晰(安装→下载→模型选择→转录→管道→替代方案)
  • 提供 5 个完整端到端示例,覆盖不同语言和场景
  • frontmatter 完整,含兼容性说明和元数据
执行可靠88/100

亮点

  • 工具来源明确(OpenAI Whisper, yt-dlp, ffmpeg)
  • 覆盖主要异常情况(ffmpeg 缺失、语言指定、模型选择)
  • 提供 GPU/CPU 性能说明,用户预期管理良好
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • ffmpeg.org
  • github.com
  • www.youtube.com

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。