Documentation
README
yt-dlp
Download YouTube videos, audio, and subtitles/transcripts.
Setup
Check if yt-dlp is installed, and download it if not:
if ! command -v yt-dlp &>/dev/null && [ ! -f ~/yt-dlp ]; then
curl -sL https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/yt-dlp && chmod +x ~/yt-dlp
fi
Then use ~/yt-dlp (or just yt-dlp if installed globally).
Examples
Download subtitles/transcript:
~/yt-dlp --write-auto-sub --sub-lang en --skip-download -o "/tmp/%(id)s" <url>
Download audio only:
~/yt-dlp -x --audio-format mp3 -o "/tmp/%(title)s.%(ext)s" <url>
Download video:
~/yt-dlp -o "/tmp/%(title)s.%(ext)s" <url>
This is the opening of the README. Read the full README on GitHub.