yt-dlp
Download videos and audio from YouTube and thousands of other sites. Use when downloading videos/audio, extracting audio, downloading playlists, or including subtitles/metadata.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
yt-dlp Skill
This skill provides common commands for downloading media using yt-dlp.
Basic Usage
# Download a video (best quality)
yt-dlp "https://www.youtube.com/watch?v=..."
# List available formats
yt-dlp -F "https://www.youtube.com/watch?v=..."
# Download specific format
yt-dlp -f 22 "https://www.youtube.com/watch?v=..."
Advanced Usage
Format Selection
# Best video + best audio
yt-dlp -f "bestvideo+bestaudio" "URL"
# Best video with height ≤ 720
yt-dlp -f "bestvideo[height<=720]+bestaudio" "URL"
# Specific format by ID
yt-dlp -f "137+140" "URL"
# Audio only in specific format
yt-dlp -f "bestaudio[ext=m4a]" "URL"
Output Templates
# Custom filename template
yt-dlp -o "%(title)s - %(uploader)s.%(ext)s" "URL"
# Organize by uploader
yt-dlp -o "%(uploader)s/%(title)s.%(ext)s" "URL"
# Include upload date
yt-dlp -o "%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "URL"
Common Tasks
Extracting Audio
# Extract best quality audio as MP3
yt-dlp -x --audio-format mp3 --audio-quality 0 "URL"
# Extract audio and keep the original video
yt-dlp -x -k "URL"
Video Selection
# Download best video and best audio separately and merge them
yt-dlp -f "bestvideo+bestaudio" "URL"
# Download video smaller than 50MB
yt-dlp -f "best[filesize<50M]" "URL"
Playlists
# Download entire playlist
yt-dlp --yes-playlist "URL_TO_PLAYLIST"
# Download only specific items from a playlist
yt-dlp --playlist-items 1,2,5,10-15 "URL"
Metadata and Subtitles
# Write subtitles to file
yt-dlp --write-subs --sub-langs "en.*" "URL"
# Embed subtitles in video file
yt-dlp --embed-subs "URL"
# Embed metadata and thumbnail
yt-dlp --add-metadata --embed-thumbnail "URL"
Post-Processing
Video Conversion
# Remux to different container
yt-dlp --remux-video mp4 "URL"
# Re-encode video
yt-dlp --recode-video mp4 "URL"
# Split by chapters
yt-dlp --split-chapters "URL"
SponsorBlock Integration
# Remove sponsor segments
yt-dlp --sponsorblock-remove sponsor "URL"
# Mark sponsor segments as chapters
yt-dlp --sponsorblock-mark sponsor "URL"
Cheat Sheet
Output Templates
Control the output filename:
yt-dlp -o "%(title)s.%(ext)s" "URL"
yt-dlp -o "%(uploader)s/%(upload_date)s - %(title)s.%(ext)s" "URL"
Authentication
# Use browser cookies (handy for age-restricted videos)
yt-dlp --cookies-from-browser chrome "URL"
# Use netrc file
yt-dlp -n "URL"
Useful Options
| Option | Description |
|---|---|
-U |
Update yt-dlp |
--list-subs |
List available subtitles |
--get-filename |
Print output filename without downloading |
--skip-download |
Process but don't download |
--limit-rate 1M |
Limit download speed to 1MB/s |
--playlist-random |
Download playlist in random order |
--no-overwrites |
Don't overwrite existing files |
--continue |
Resume partial downloads |
--ignore-errors |
Continue on download errors |
--verbose |
More detailed output |
--write-description |
Save video description |
--write-info-json |
Save metadata as JSON |
--download-archive FILE |
Skip already downloaded videos |
Format Selection Examples
# Best quality MP4
-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]"
# Audio only
-f "bestaudio"
# Video under 1080p
-f "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
# Specific codec
-f "bestvideo[vcodec^=avc]+bestaudio"
Output Template Fields
Common fields for -o template:
-
%(title)s- Video title -
%(uploader)s- Channel/uploader name -
%(upload_date)s- Upload date (YYYYMMDD) -
%(duration)s- Duration in seconds -
%(view_count)s- View count -
%(id)s- Video ID -
%(ext)s- File extension -
%(playlist_title)s- Playlist name -
%(playlist_index)s- Position in playlist
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!