name: youtube-subtitle description: Downloads the original-language subtitle from a YouTube video, converts it to plain text, and saves it with an auto-generated filename (YYYYMMDD-xxx-yyy). Use when given a YouTube URL and asked to download subtitles.
YouTube Subtitle Downloader
Purpose
Download the original-language subtitle of a YouTube video, convert it from VTT to plain text, and save it with a consistent filename.
Arguments
url(required): YouTube video URL
Workflow
- Get title: Run
yt-dlp --print title [url] - Get date: Run
date +%Y%m%d - Generate PREFIX: Compress the title to 2 English lowercase words →
YYYYMMDD-xxx-yyy - Confirm with user: Show the proposed PREFIX and ask for approval before proceeding
- Download subtitle:
yt-dlp --write-auto-subs --sub-langs ".*-orig" --skip-download -o "PREFIX.%(ext)s" [url] - Convert to text:
uv run skills/youtube-subtitle/scripts/vtt2txt.py PREFIX.<lang>-orig.vtt --url [url] --title [title]<lang>is the language code detected in the downloaded filename (e.g.kn)[title]is the title obtained in step 1
Notes
- The
.*-origpattern matches the original-language auto-caption (e.g.kn-origfor Kannada) - VTT and TXT files are saved in the current directory