In this article, we will see how to install youtube-dl in Ubuntu 18.04. What is youtube-dl and features of youtube-dl?
youtube-dl is a command-line program to download videos from YouTube.
Some of the features of Youtube-dl.

  • Download videos from youtube without interrupted.
  • Extract mp3 from video files.
  • From playlist download all videos.
  • Download only the videos uploaded in the last x days.

How to install youtube-dl
We can install youtube-dl from apt repository itself. For this, just need to run the below command:

sudo apt-get install youtube-dl

Update YouTube-DL

We can update youtube-dl to the latest release using the command below:

sudo youtube-dl -U

How to Use youtube-dl

We will see how to download highest quality of video.
To download the highest quality of a video from a URL, use the command:

youtube-dl example.com/watch?e=id

To Check available video formats

Check available video formats

YouTube-DL supports a multitude of formats, e.g Mp4, mkv, webm, FLV e.t.c. To list available video codes, use -F option. E.g

 youtube-dl -F https://youtu.bw/FjHk1z0nWvyc
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k, 26.70MiB
43 webm 640x360 medium , vp8.0, vorbis@128k, 30.47MiB
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)

Note: The format number – 18,43,22  is used when downloading the video.
Download Specific video format

After getting a list of formats available, download specific format using -f format-number. E.g

youtube-dl -f 22 https://youtu.bw/FJhUN1z9HKvyc

This will download format/codec1280x720 hd720.

Download Audio

We can  download audio using youtube-dl like below:

youtube-dl --extract-audio --audio-format mp3 example.com/watch?g=id

This will extract audio from the video.

Download a video playlist

Youtube-dl saves all videos on a playlist by default. Just copy playlist URL and pass it to youtube-dl command line tool.

youtube-dl example.com/watch?g=id&list=listid

You can also start from a specified number.

youtube-dl --playlist-start 6 example.com/watch?g=id&list=listid

To check all the options in youtube-dl use “man youtube-dl” or “youtube-dl -h”.

© 2019, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points
Categories: ubuntu

0 Comments

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.