Best way to download Youtube Videos

Best way to download Youtube Videos

February 17, 2024

There was a time when it became incredibly difficult to make yt-dl work,due to several takedown notices from youtube. From personal experience, if it worked for me once, it wouldn’t work for the rest. It was frustrating to use third-party ad-ware sites to download anything off youtube.. until I discovered a (fork of yt-dl) better tool: YT-DLP.

It is one of those things that makes me really admire the efforts of the open-source community. In this post, I will share my go-to commands for using yt-dlp.

Install

sudo wget 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

Usage

  • Download and merge the best video-only format and the best audio-only format, or the best combined format (if video-only format is not available)
$ yt-dlp -f "bv+ba/b" <link>
  • Download a video in 1080p
yt-dlp -f 'bv*[height=1080]+ba' <link>
  • Download an audio while embedding thumbnail in the file.
yt-dlp -x --audio-format best --embed-thumbnail <link>

Alias

  • Obviously you can add this as an alias in your .bashrc or your .zshrc like so:
alias yta="yt-dlp -x --audio-format best --embed-thumbnail"

YT-DLP’s Github: