python3 -c "import rewith open('/tmp/video-name.en.vtt') as f: lines = f.readlines()text_lines = []seen = set()for line in lines: line = line.strip() if not line or line.startswith('WEBVTT') or line.startswith('Kind:') or line.startswith('Language:'): continue if re.match(r'^\d{2}:\d{2}', line) or '-->' in line: continue clean = re.sub(r'<[^>]+>', '', line) if clean and clean not in seen: seen.add(clean) text_lines.append(clean)print(' '.join(text_lines))"
Notes
yt-dlp is installed at /usr/local/bin/yt-dlp (Homebrew)
Works with YouTube short URLs (youtu.be/...) and full URLs
Auto-generated captions available on most videos
Use --sub-lang en for English (change for other languages)
The oEmbed API can get video title/metadata without downloading:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=VIDEO_ID&format=json