Loading...
Loading...
Use when "youtube transcript", "extract subtitles", "video captions", "get transcript", "video to text"
npx skill4agent add eyadsibai/ltk youtube-transcribe| Method | Tool | When to Use |
|---|---|---|
| CLI | yt-dlp | Fast, reliable, preferred |
| Browser | Chrome automation | Fallback when CLI fails |
| API | youtube-transcript-api | Python programmatic access |
yt-dlp --write-auto-sub --write-sub --sub-lang en --skip-download -o "%(title)s.%(ext)s" "VIDEO_URL"| Flag | Purpose |
|---|---|
| Download manual subtitles |
| Download auto-generated subtitles |
| Specify language (en, zh-Hans, etc.) |
| Don't download video |
| Use browser cookies for restricted videos |
| Issue | Solution |
|---|---|
| Sign-in required | Add |
| No subtitles found | Video has no captions available |
| Age-restricted | Use cookies from logged-in browser |
| Element | Selector |
|---|---|
| Transcript segments | |
| Timestamp | |
| Text | |
| Format | Extension | Use Case |
|---|---|---|
| VTT | .vtt | Web standard, includes timing |
| SRT | .srt | Video editing, media players |
| TXT | .txt | Plain text, no timing |
# Strip timing and formatting
sed '/^[0-9]/d; /^$/d; /WEBVTT/d; /-->/d' video.vtt > video.txt| Language | Code |
|---|---|
| English | |
| Chinese (Simplified) | |
| Chinese (Traditional) | |
| Spanish | |
| Multiple | |
| Practice | Why |
|---|---|
| Try manual subs first | Higher quality than auto-generated |
| Use cookies for restricted | Avoids sign-in errors |
| Check multiple languages | Some videos have better subs in other languages |
| Verify transcript exists | Not all videos have captions |