---
name: youtube-transcript
description: Download and process YouTube video transcripts using yt-dlp. Use this when extracting subtitles, creating summaries from videos, or processing video content.
allowed-tools: Read, Glob, Grep, Bash, Write
license: MIT
metadata:
  author: michalparkola
  version: "1.0"
---

# YouTube Transcript Downloader

유튜브 영상에서 자막을 추출하고 처리하는 스킬입니다.

## Priority Order

```
1. yt-dlp 설치 확인
2. 사용 가능한 자막 목록 확인
3. 수동 자막 우선 시도
4. 자동 생성 자막 폴백
5. 최후 수단: Whisper 변환
```

## Requirements

```bash
# macOS
brew install yt-dlp

# Linux
sudo apt install yt-dlp

# Universal
pip install yt-dlp
```

## Workflow

### Step 1: 자막 목록 확인

```bash
yt-dlp --list-subs "VIDEO_URL"
```

### Step 2: 수동 자막 다운로드 (권장)

```bash
# 한국어 자막
yt-dlp --write-sub --sub-lang ko --skip-download "VIDEO_URL"

# 영어 자막
yt-dlp --write-sub --sub-lang en --skip-download "VIDEO_URL"
```

### Step 3: 자동 생성 자막 (폴백)

```bash
yt-dlp --write-auto-sub --sub-lang ko --skip-download "VIDEO_URL"
```

### Step 4: VTT → 텍스트 변환

```bash
# VTT 파일에서 타임스탬프 제거
sed '/^[0-9]/d; /^$/d; /-->/d' subtitle.ko.vtt > transcript.txt
```

## Output Processing

### 중복 제거
자동 생성 자막은 progressive 캡션으로 인해 중복이 많음:

```python
# 중복 라인 제거
seen = set()
unique_lines = []
for line in lines:
    if line not in seen:
        seen.add(line)
        unique_lines.append(line)
```

### 요약 생성
추출된 자막으로:
- 핵심 내용 요약
- 타임스탬프별 챕터 생성
- 주요 키워드 추출

## Examples

### Example 1: 강의 영상 요약
```
User: 이 유튜브 강의 요약해줘 - https://youtube.com/watch?v=xxx

Claude:
1. yt-dlp로 자막 다운로드
2. VTT → 텍스트 변환
3. 핵심 내용 요약 생성
4. 타임스탬프별 목차 제공
```

### Example 2: 다국어 자막 추출
```
User: 이 영상의 영어/한국어 자막 둘 다 추출해줘

Claude:
1. --list-subs로 가용 언어 확인
2. 각 언어별 자막 다운로드
3. 정리된 텍스트 파일 제공
```

## Error Handling

| 에러 | 원인 | 해결책 |
|------|------|--------|
| `yt-dlp not found` | 미설치 | brew/apt/pip 설치 |
| `No subtitles available` | 자막 없음 | Whisper 사용 제안 |
| `Invalid URL` | URL 오류 | URL 형식 확인 |
| `Video unavailable` | 비공개/삭제 | 사용자에게 알림 |

## Whisper Fallback

자막이 전혀 없는 경우 (사용자 확인 필요):

```bash
# 파일 크기 확인
yt-dlp --print filesize "VIDEO_URL"

# 사용자 승인 후 오디오 다운로드
yt-dlp -x --audio-format mp3 "VIDEO_URL"

# Whisper로 변환
whisper audio.mp3 --language ko --model base
```

**주의**: 대역폭/처리 시간 소요로 사용자 확인 필수


---
Source attribution: aiskillstore
Original project: https://github.com/aiskillstore/marketplace/blob/main/skills/doyajin174/youtube-transcript/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: aiskillstore
Original project: https://github.com/aiskillstore/marketplace/blob/main/skills/doyajin174/youtube-transcript/SKILL.md
Attribution basis: Source repository record

Fields of work: Content & Media, Education & Research, Marketing
Roles: Content Marketer, Researcher, Video Producer
Specialties: Specialty not specified
Tools: Yt Dlp
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 5af57512277e0f8b25c9b2b5cc53e53079be10f8cf4a4fdef463ac36cc3afd1f
