Download Reels
CLI Reference • yt-dlp • 10 min read

Mastering yt-dlp & youtube-dl: Complete CLI Cheatsheet & Automation

yt-dlp is the undisputed heavyweight of command-line media extraction. While the original youtube-dl project is largely stagnant and heavily throttled, yt-dlp receives near-daily updates to evade anti-scraping countermeasures.

Prefer a graphical interface?

Download Reels lets you paste links directly in the browser.

Try Online Tool →

1. Installation & Updating

# Linux / macOS (via curl)
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

# Upgrade to the latest build anytime
yt-dlp -U

2. Best Format Selection Recipes

Platforms like YouTube separate 1080p video and audio tracks. Use these recipes to guarantee the best combined MP4 without manual merging:

# Best video up to 1080p + best audio merged into MP4 container
yt-dlp -f "bv*[height<=1080][ext=mp4]+ba[ext=m4a]/b[height<=1080]/bv*+ba/b" --merge-output-format mp4 "URL"

# List all available resolutions and formats for a link
yt-dlp -F "URL"

# Extract audio only in 320kbps MP3
yt-dlp -x --audio-format mp3 --audio-quality 0 "URL"

3. Bypassing Login Walls with Browser Cookies

Instagram and YouTube frequently restrict access behind login prompts. With yt-dlp, you can borrow authenticated session cookies directly from your local browser without typing passwords:

# Pass cookies from Chrome
yt-dlp --cookies-from-browser chrome "https://www.instagram.com/reel/DfGqtxDTZt_/"

# Pass cookies from Firefox
yt-dlp --cookies-from-browser firefox "https://www.instagram.com/reel/DfGqtxDTZt_/"

4. Batch Automation with URL Lists

Download hundreds of reels or shorts automatically from a text file, skipping already downloaded items:

yt-dlp -a urls.txt --download-archive archive.log -o "%(uploader)s/%(title)s.%(ext)s"

Related Guides: