Skip to content

Instantly share code, notes, and snippets.

@mymindwentblvnk
Created April 23, 2026 12:55
Show Gist options
  • Select an option

  • Save mymindwentblvnk/5c3be5dcc407f1dce88f508af51c34d2 to your computer and use it in GitHub Desktop.

Select an option

Save mymindwentblvnk/5c3be5dcc407f1dce88f508af51c34d2 to your computer and use it in GitHub Desktop.
# Download a YouTube video as MP3 in highest quality
download URL:
uv run yt-dlp \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--embed-thumbnail \
--add-metadata \
--output "%(title)s [%(id)s].%(ext)s" \
"{{URL}}"
# Download using uvx (doesn't require project install)
download-uvx URL:
uvx yt-dlp \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--embed-thumbnail \
--add-metadata \
--output "%(title)s [%(id)s].%(ext)s" \
"{{URL}}"
# Update yt-dlp to the latest version
update:
uv add --upgrade yt-dlp
# Update yt-dlp using uvx
update-uvx:
uvx --refresh yt-dlp --version
# Show yt-dlp version
version:
uv run yt-dlp --version
# List available formats for a URL
formats URL:
uv run yt-dlp --list-formats "{{URL}}"
# Download playlist to a folder
download-playlist URL FOLDER:
mkdir -p "{{FOLDER}}"
uv run yt-dlp \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
--embed-thumbnail \
--add-metadata \
--output "{{FOLDER}}/%(playlist_index)s - %(title)s [%(id)s].%(ext)s" \
"{{URL}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment