Skip to content

Instantly share code, notes, and snippets.

@kiranparajuli589
Last active March 9, 2023 15:10
Show Gist options
  • Save kiranparajuli589/a9b00af8859dc4c7f918adf6d0d8428a to your computer and use it in GitHub Desktop.
Save kiranparajuli589/a9b00af8859dc4c7f918adf6d0d8428a to your computer and use it in GitHub Desktop.
Example commands to download using `youtube-dl` CLI

YouTube DL

  1. Download the best quality video and audio:
youtube-dl -f bestvideo+bestaudio [video URL]

This will download the best quality video and audio available for the specified video URL.

  1. Download the best quality video and audio as separate files:
youtube-dl -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best [video URL]

This will download the best quality video and audio as separate files. The video will be saved in MP4 format and the audio will be saved in M4A format.

  1. Download the best quality audio only:
youtube-dl -f bestaudio[ext=m4a] --extract-audio [video URL]

This will download the best quality audio only and extract it into an M4A file.

  1. Download the best quality video only:
youtube-dl -f bestvideo[ext=mp4] [video URL]

This will download the best quality video only and save it in MP4 format.

  1. Download specific quality video and audio:
youtube-dl -f 720p+140 [video URL]

This will download a video with a resolution of 720p and audio with a bitrate of 140 kbps. You can adjust the quality by specifying different video and audio formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment