youtube-dl is a command line utility to download videos from Youtube and in this tutorial you will learn how to use it.

Install

There are several ways to install youtube-dl:

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

sudo chmod a+rx /usr/local/bin/youtube-dl
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl

sudo chmod a+rx /usr/local/bin/youtube-dl
sudo pip install --upgrade youtube_dl

Use

youtube-dl https://www.youtube.com/watch?v=1uu9VWBgcBU

Parameters

  • -o <filename>: set a name for the output file.
  • -f FORMAT: specify a quality format. FORMAT is an expression that describes format or formats you would like to download:
    -f "bestvideo[height<=1080,ext=webm]+bestaudio[ext=webm]"
    
    • best: Best quality format.
    • worst: Worst quality format.
    • bestvideo: Best quality video-only format (e.g. DASH video).
    • worstvideo: Worst quality video-only format.
    • bestaudio: Best quality audio only-format.
    • worstaudio: Worst quality audio only-format.
    • height: Height of the video, if known.
    • ext: File extension.
    • More options.