youtube-transcribe-skill
Agent skill fromfeiskyer/claude-code-settings
Extract subtitles/transcripts from YouTube videos. Triggers: "youtube transcript", "extract subtitles", "video captions", "视频字幕", "字幕提取", "YouTube转文字", "提取字幕".
How to install youtube-transcribe-skill
install youtube-transcribe-skill
# install the claude-code-settings pack with the skills CLI
npx skills add feiskyer/claude-code-settings# or add only this skill to Claude Code: copy the folder
skills/youtube-transcribe-skill/
# into
~/.claude/skills/youtube-transcribe-skill/ (all projects)
.claude/skills/youtube-transcribe-skill/ (one project)
1# YouTube Transcript Extraction23Extract subtitles/transcripts from a YouTube video URL and save them as a local file.45Input YouTube URL: $ARGUMENTS67## Step 1: Verify URL89Confirm the input is a valid YouTube URL (supports `youtube.com/watch?v=`, `youtu.be/`, and `youtube.com/shorts/` formats). If no URL is provided via arguments, check the conversation context for a YouTube link.1011## Step 2: CLI Quick Extraction (Priority Attempt)1213Use command-line tools to quickly extract subtitles.1415### 2.1 Check Tool Availability1617Execute `which yt-dlp`.1819- If `yt-dlp` is **found**, proceed to 2.2.20- If `yt-dlp` is **not found**, skip to **Step 3**.2122### 2.2 Get Video Title2324```bash25yt-dlp --cookies-from-browser=chrome --get-title "[VIDEO_URL]"26```2728- **Tip**: Always add `--cookies-from-browser` to avoid sign-in restrictions. Default to `chrome`.29- If it fails with a browser error (e.g., "Could not open Chrome"), ask the user to specify their available browser (e.g., `firefox`, `safari`, `edge`) and retry.3031### 2.3 Download Subtitles3233```bash34yt-dlp --cookies-from-browser=chrome --write-auto-sub --write-sub --sub-lang zh-Hans,zh-Hant,en --skip-download --output "<Video Title>.%(ext)s" "[VIDEO_URL]"35```3637### 2.4 Convert to Plain Text3839`yt-dlp` saves subtitles as `.vtt` or `.srt` files. Convert the downloaded file to plain `Timestamp Text` format:40411. Read the downloaded subtitle file (`.vtt` or `.srt`).422. Strip VTT/SRT headers, styling tags, and duplicate lines.43…
Excerpt shown under the repository's MIT license.
