Skip to content

Instantly share code, notes, and snippets.

@jaredreich
Last active June 9, 2022 18:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredreich/50eb65acc3b361f6737d07c2509e676f to your computer and use it in GitHub Desktop.
Save jaredreich/50eb65acc3b361f6737d07c2509e676f to your computer and use it in GitHub Desktop.
youtube-dl download playlist as mp4 to directory (macOS)
# Playlist
# playlist id: PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
# or
youtube-dl -f mp4 -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
# or
# 135 = 480p mp4, 140 = m4a
youtube-dl -f '135+140/mp4' -o '~/Downloads/%(playlist_index)s-%(title)s.%(ext)s' -i PLNw_hEO5pK1pzbx5q5mcdpSKzHzgDSPjR
# Single video
youtube-dl 'https://youtu.be/Lk_5121rB0Y' -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' -o '~/Downloads/%(title)s.%(ext)s'
# Single video with specific formats
youtube-dl -F 'https://youtu.be/nFRkEYAZ0xk'
# 137 = 1080p mp4, 140 = m4a
youtube-dl 'https://youtu.be/nFRkEYAZ0xk' -f '137+140/mp4' -o '~/Downloads/%(title)s.%(ext)s'
# 135 = 480p mp4, 140 = m4a
youtube-dl 'https://youtu.be/nFRkEYAZ0xk' -f '135+140/mp4' -o '~/Downloads/%(title)s.%(ext)s'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment