# Youtube Transcribe Skill

Extract subtitles/transcripts from YouTube videos.

- Repository: https://github.com/feiskyer/claude-code-settings (1668 stars)
- Category: Media
- License: MIT
- Last updated: 2026-09-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add feiskyer/claude-code-settings --skill youtube-transcribe-skill -g -a claude-code -y`
Codex: `npx skills add feiskyer/claude-code-settings --skill youtube-transcribe-skill -g -a codex -y`
Cursor: `npx skills add feiskyer/claude-code-settings --skill youtube-transcribe-skill -g -a cursor -y`
Gemini CLI: `npx skills add feiskyer/claude-code-settings --skill youtube-transcribe-skill -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add feiskyer/claude-code-settings`

## Description

Extract subtitles/transcripts from YouTube videos. Triggers: "youtube transcript", "extract subtitles", "video captions", "视频字幕", "字幕提取", "YouTube转文字", "提取字幕".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# YouTube Transcript Extraction

Extract subtitles/transcripts from a YouTube video URL and save them as a local file.

Input YouTube URL: $ARGUMENTS

## Step 1: Verify URL

Confirm 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.

## Step 2: CLI Quick Extraction (Priority Attempt)

Use command-line tools to quickly extract subtitles.

### 2.1 Check Tool Availability

Execute `which yt-dlp`.

- If `yt-dlp` is **found**, proceed to 2.2.
- If `yt-dlp` is **not found**, skip to **Step 3**.

### 2.2 Get Video Title

```bash
yt-dlp --cookies-from-browser=chrome --get-title "[VIDEO_URL]"
```

- **Tip**: Always add `--cookies-from-browser` to avoid sign-in restrictions. Default to `chrome`.
- 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.

### 2.3 Download Subtitles

```bash
yt-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]"
```

### 2.4 Convert to Plain Text

`yt-dlp` saves subtitles as `.vtt` or `.srt` files. Convert the downloaded file to plain `Timestamp Text` format:

1. Read the downloaded subtitle file (`.vtt` or `.srt`).
2. Strip VTT/SRT headers, styling tags, and duplicate lines.
3. Save as `<Video Title>.txt` with one `Timestamp Text` entry per line.

### 2.5 Verify Results

- **Exit code 0**: Convert and save the subtitle file, then report completion.
- **Exit code non-0**:
  - If error is related to browser/cookies, ask user for correct browser and retry.
  - If other errors (e.g., video unavailable), proceed to **Step 3**.

## Step 3: Browser Automation (Fallback)

When the CLI method fails or `yt-dlp` is missing, use Chrome DevTools MCP to extract subtitles via browser UI automation.

The rest: https://github.com/feiskyer/claude-code-settings/blob/HEAD/skills/youtube-transcribe-skill/SKILL.md
