| name | yt-dlp |
| description | Comprehensive skill for yt-dlp - feature-rich command-line audio/video downloader supporting thousands of sites Use when this capability is needed. |
| metadata | {"author":"aeonbridge"} |
yt-dlp Skill
Expert assistance for using yt-dlp, a feature-rich command-line audio/video downloader with support for thousands of websites. Fork of youtube-dl with enhanced features and active maintenance.
When to Use This Skill
This skill should be used when:
- Downloading videos or audio from YouTube, Vimeo, or thousands of other sites
- Extracting audio from videos in various formats (MP3, M4A, OPUS, etc.)
- Downloading entire playlists or channels
- Selecting specific video quality or format combinations
- Embedding metadata, subtitles, or thumbnails
- Automating media downloads with scripts
- Recording live streams
- Converting video formats with FFmpeg integration
- Extracting video information without downloading
- Troubleshooting download issues or understanding yt-dlp options
- Setting up advanced configurations for batch processing
Overview
yt-dlp is a powerful command-line tool that:
- Supports thousands of sites: YouTube, Vimeo, Twitter, Facebook, Instagram, TikTok, and many more
- Actively maintained: Regular updates with bug fixes and new features
- Feature-rich: Extensive options for format selection, metadata handling, and post-processing
- Fast and efficient: Multi-threaded downloads with resume capability
- Extensible: Plugin system for custom extractors and post-processors
Key Improvements Over youtube-dl
- Better performance and stability
- More format options and quality selection
- Enhanced metadata handling
- Improved playlist and channel downloads
- Better error handling and retry logic
- Active development and frequent updates
- SponsorBlock integration for YouTube
Installation
Recommended Methods
Windows
winget install yt-dlp
scoop install yt-dlp
macOS
brew install yt-dlp
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos -o /usr/local/bin/yt-dlp
chmod a+rx /usr/local/bin/yt-dlp
Linux
python3 -m pip install -U yt-dlp
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
sudo add-apt-repository ppa:tomtomtom/yt-dlp
sudo apt update
sudo apt install yt-dlp
Using pip (cross-platform)
python3 -m pip install -U yt-dlp
pipx install yt-dlp
Essential Dependencies
FFmpeg (Strongly Recommended)
Required for merging video+audio formats and post-processing:
scoop install ffmpeg
brew install ffmpeg
sudo apt install ffmpeg
sudo dnf install ffmpeg
Optional Dependencies
pip install brotli certifi mutagen pycryptodomex websockets
pip install secretstorage
pip install pywin32
pip install curl-cffi
Quick Start
Basic Downloads
yt-dlp "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
yt-dlp URL1 URL2 URL3
yt-dlp -a urls.txt
yt-dlp "https://www.youtube.com/playlist?list=PLAYLIST_ID"
yt-dlp "https://www.youtube.com/@channelname"
Audio-Only Downloads
yt-dlp -x --audio-format mp3 URL
yt-dlp -x --audio-quality 0 URL
yt-dlp -x --audio-format mp3 --embed-metadata --embed-thumbnail URL
yt-dlp -f 'bestaudio[ext=m4a]' --embed-thumbnail --add-metadata URL
Format Selection
Understanding Formats
yt-dlp -F URL
yt-dlp -f "best" URL
yt-dlp -f "bestvideo+bestaudio" URL
yt-dlp -f 22 URL
yt-dlp -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" URL
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" URL
Advanced Format Selection
yt-dlp -f "best[filesize<100M]" URL
yt-dlp -f "bestvideo[height=720]+bestaudio" URL
yt-dlp -f "bestvideo[fps>30]+bestaudio" URL
yt-dlp -f "bestvideo" URL
yt-dlp -f "bestaudio" URL
yt-dlp -f "bestvideo[vcodec^=vp]+bestaudio[acodec^=opus]" URL
Common Use Cases
1. Download Entire Channel or Playlist
yt-dlp -f "bestvideo[height<=1080]+bestaudio" \
--output "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" \
"https://www.youtube.com/@channelname"
yt-dlp --output "%(playlist_index)s-%(title)s.%(ext)s" PLAYLIST_URL
yt-dlp --dateafter now-7days CHANNEL_URL
yt-dlp --dateafter 20230101 --datebefore 20231231 CHANNEL_URL
2. Download with Subtitles
yt-dlp --write-subs --write-auto-subs URL
yt-dlp --write-subs --sub-lang en URL
yt-dlp --write-subs --embed-subs --sub-lang en URL
yt-dlp --write-subs --all-subs URL
yt-dlp --write-subs --convert-subs srt URL
3. Download with Metadata and Thumbnails
yt-dlp --embed-metadata --embed-thumbnail URL
yt-dlp --write-thumbnail URL
yt-dlp --write-thumbnail --convert-thumbnails jpg URL
yt-dlp --embed-metadata --embed-thumbnail --embed-subs \
--embed-chapters --write-description --write-info-json URL
4. Live Stream Recording
yt-dlp --live-from-start URL
yt-dlp URL
yt-dlp --wait-for-video 60 URL
yt-dlp --wait-for-video 3600 --live-from-start URL
5. Download Specific Playlist Items
yt-dlp --playlist-end 10 PLAYLIST_URL
yt-dlp --playlist-start 5 --playlist-end 15 PLAYLIST_URL
yt-dlp --playlist-items 1,5,8,12 PLAYLIST_URL
yt-dlp --playlist-items "::5" PLAYLIST_URL
yt-dlp --playlist-start 21 PLAYLIST_URL
6. Archive and Download History
yt-dlp --download-archive archive.txt URL
yt-dlp --continue URL
yt-dlp --no-overwrites URL
yt-dlp --no-continue URL
Advanced Features
Output Templates
yt-dlp -o "%(title)s.%(ext)s" URL
yt-dlp -o "%(uploader)s/%(upload_date)s - %(title)s.%(ext)s" URL
yt-dlp -o "%(id)s - %(title)s [%(resolution)s].%(ext)s" URL
yt-dlp -o "Downloads/%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" URL
Post-Processing
yt-dlp --merge-output-format mp4 URL
yt-dlp --recode-video mp4 URL
yt-dlp -x --audio-format mp3 --audio-quality 0 URL
yt-dlp --remux-video mkv URL
yt-dlp -x --audio-format mp3 --embed-thumbnail URL
yt-dlp --embed-metadata --embed-chapters URL
yt-dlp --split-chapters URL
yt-dlp --exec "echo Downloaded: {}" URL
SponsorBlock Integration (YouTube)
yt-dlp --sponsorblock-mark all URL
yt-dlp --sponsorblock-remove all URL
yt-dlp --sponsorblock-mark sponsor,intro --sponsorblock-remove outro URL
Browser Cookie Support
yt-dlp --cookies-from-browser firefox URL
yt-dlp --cookies-from-browser chrome URL
yt-dlp --cookies cookies.txt URL
yt-dlp --cookies cookies.txt URL
Rate Limiting and Network Options
yt-dlp --limit-rate 1M URL
yt-dlp --proxy http://proxy.example.com:8080 URL
yt-dlp --user-agent "Mozilla/5.0..." URL
yt-dlp --referer "https://example.com" URL
yt-dlp --socket-timeout 30 URL
yt-dlp --retries 10 URL
yt-dlp --sleep-interval 5 URL
Geo-Restriction Bypass
yt-dlp --proxy socks5://127.0.0.1:1080 URL
yt-dlp --proxy socks5://127.0.0.1:9050 URL
yt-dlp --geo-bypass URL
yt-dlp --geo-bypass-country US URL
Configuration File
Create ~/.config/yt-dlp/config (Linux/macOS) or %APPDATA%/yt-dlp/config.txt (Windows):
# Default format selection
-f bestvideo[height<=1080]+bestaudio/best[height<=1080]
# Output template
-o ~/Downloads/%(uploader)s/%(title)s.%(ext)s
# Always embed metadata
--embed-metadata
--embed-thumbnail
--embed-subs
# Download subtitles
--write-subs
--sub-lang en
# Archive to avoid re-downloading
--download-archive ~/.config/yt-dlp/archive.txt
# No overwrite
--no-overwrites
# Continue incomplete downloads
--continue
# Prefer free formats
--prefer-free-formats
# Add metadata
--add-metadata
# SponsorBlock
--sponsorblock-mark all
# Rate limit (optional)
# --limit-rate 5M
# Retries
--retries 10
# Sleep between downloads
--sleep-interval 3
Information Extraction (No Download)
yt-dlp --dump-json URL
yt-dlp --get-title URL
yt-dlp --get-url URL
yt-dlp --get-filename URL
yt-dlp --get-thumbnail URL
yt-dlp --get-duration URL
yt-dlp --dump-single-json URL
yt-dlp --simulate URL
yt-dlp -F URL
Batch Processing and Automation
Bash Script Example
#!/bin/bash
CHANNEL_URL="$1"
OUTPUT_DIR="$2"
yt-dlp \
--download-archive archive.txt \
--format "bestvideo[height<=1080]+bestaudio" \
--output "${OUTPUT_DIR}/%(upload_date)s - %(title)s.%(ext)s" \
--write-subs \
--embed-subs \
--embed-metadata \
--embed-thumbnail \
--no-overwrites \
--continue \
--retries 10 \
--sleep-interval 5 \
"$CHANNEL_URL"
Python Integration
import yt_dlp
ydl_opts = {
'format': 'bestvideo+bestaudio/best',
'outtmpl': '%(title)s.%(ext)s',
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download(['https://www.youtube.com/watch?v=VIDEO_ID'])
with yt_dlp.YoutubeDL({'quiet': True}) as ydl:
info = ydl.extract_info('URL', download=False)
title = info.get('title', None)
duration = info.get('duration', None)
print(f"Title: {title}, Duration: {duration}s")
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download(['URL'])
Common Options Reference
General Options
--help, -h Show help message
--version Print program version
--update Update to latest version
--ignore-errors Continue on download errors
--no-abort-on-error Continue even if errors occur
--quiet, -q Suppress output
--verbose, -v Print debug information
--dump-json Output info as JSON
--simulate, -s Don't download, simulate
Download Options
-f, --format FORMAT Format selection
-o, --output TEMPLATE Output filename template
--playlist-items ITEMS Playlist items to download
--min-filesize SIZE Minimum file size
--max-filesize SIZE Maximum file size
--date DATE Download only on this date
--datebefore DATE Download before this date
--dateafter DATE Download after this date
Post-Processing
-x, --extract-audio Extract audio only
--audio-format FORMAT Audio format (mp3, m4a, opus, etc.)
--audio-quality QUALITY Audio quality (0-9, 0=best)
--recode-video FORMAT Re-encode video
--remux-video FORMAT Remux to different container
--embed-subs Embed subtitles in video
--embed-thumbnail Embed thumbnail
--embed-metadata Add metadata to file
--embed-chapters Add chapter markers
--split-chapters Split by chapters
--sponsorblock-mark CATS Mark SponsorBlock categories
--sponsorblock-remove CATS Remove SponsorBlock segments
Subtitle Options
--write-subs Write subtitles
--write-auto-subs Write auto-generated subtitles
--all-subs Download all subtitles
--sub-lang LANGS Subtitle languages (comma-separated)
--sub-format FORMAT Subtitle format (srt, vtt, etc.)
--convert-subs FORMAT Convert subtitles to format
Best Practices
1. Use Download Archive
Always use --download-archive archive.txt to avoid re-downloading videos:
yt-dlp --download-archive archive.txt CHANNEL_URL
2. Set Reasonable Rate Limits
Be respectful of bandwidth:
yt-dlp --limit-rate 5M --sleep-interval 3 URL
3. Use Configuration Files
Store commonly used options in config file instead of typing them each time.
4. Handle Errors Gracefully
Use retry options and error handling:
yt-dlp --retries 10 --ignore-errors --no-abort-on-error URL
5. Organize Downloads
Use meaningful output templates:
yt-dlp -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" URL
6. Keep yt-dlp Updated
Update regularly for bug fixes and new features:
yt-dlp -U
pip install -U yt-dlp
Troubleshooting
Common Issues
"Unable to extract video data"
yt-dlp -U
yt-dlp --rm-cache-dir
yt-dlp -f 'best' URL
"HTTP Error 403: Forbidden"
yt-dlp --cookies-from-browser firefox URL
yt-dlp --cookies cookies.txt URL
"Requested format not available"
yt-dlp -F URL
yt-dlp -f "bestvideo+bestaudio" URL
Geo-restricted Content
yt-dlp --proxy socks5://127.0.0.1:1080 URL
yt-dlp --geo-bypass --geo-bypass-country US URL
Slow Downloads
yt-dlp --concurrent-fragments 4 URL
Getting Help
yt-dlp --help
yt-dlp --help | grep subtitle
yt-dlp --version
yt-dlp --verbose URL
Update and Maintenance
Updating yt-dlp
yt-dlp -U
pip install -U yt-dlp
yt-dlp --update-to nightly
yt-dlp --version
Release Channels
- stable: Well-tested releases (default)
- nightly: Daily builds, recommended for regular users
- master: Latest development after each commit
Supported Sites
yt-dlp supports thousands of sites, including:
- Video: YouTube, Vimeo, Dailymotion, Twitch, TikTok
- Social: Facebook, Instagram, Twitter/X, Reddit
- Streaming: Twitch, Crunchyroll, Netflix (with cookies), Disney+
- Education: Coursera, Udemy, Khan Academy, edX
- News: BBC, CNN, NBC, ABC
- And many more: Full list at https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md
Legal and Ethical Considerations
Important Notes:
- Respect copyright and terms of service of websites
- Only download content you have the right to download
- Some content may be protected by DRM or geo-restrictions
- Always check local laws regarding downloading copyrighted content
- Use yt-dlp responsibly and ethically
Resources
License
yt-dlp is licensed under the Unlicense (public domain). Some bundled components may use different licenses.
Note: This skill provides comprehensive guidance for using yt-dlp. Always ensure your use complies with local laws and website terms of service.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.