YouTube-DL : A Powerful YouTube Video Downloader For Linux

youtube-dl is a small command-line program to download videos from YouTube.com, Facebook, Yahoo, Google Video, etc.. almost support around 800+ websites. It requires the Python interpreter to work. This will work under Unix, Windows & Mac OS X. They are offering new releases once in a month.

1) Install YouTube-DL on Ubuntu & Mint

We can easily install YouTube-DL on Ubuntu, Mint & Elementary OS using webupd8 PPA.

[Debian, Ubuntu & Mint]
$ sudo apt-get install youtube-dl

[Ubuntu & Mint]
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install youtube-dl

2) Install YouTube-DL on RHEL, CentOS & Fedora

We can easily install YouTube-DL on RHEL, CentOS & Fedora by enabling EPEL repo. Note: For fedora we can install directly.

[RHEL, CentOS & Fedora 21 & older]
# yum install youtube-dl

[Fedora 22 & later]
# dnf install youtube-dl

3) Install YouTube-DL on Linux

We can easily install YouTube-DL on all the Linux distribution such as Debian, RHEL, Ubuntu, LinuxMint, CentOS, Fedora, suse, openSUSE, ArchLinux, Manjaro, Mageia, etc..,. by using below method.

[Download through curl]
# curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl

or

[Download through wget]
# wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl

[Set Executable permission]
# chmod a+rx /usr/local/bin/youtube-dl

[Upgrade to latest version]
# youtube-dl -U

4) How to Use YouTube-DL to Download Videos

Use the below command to download any video from supported sites. Just past your URL which you want to download.

[Syntax]
# youtube-dl [Options] [Video URL]

4a) You can download any video from supported sites. For testing purpose we are going to download video from YouTube.

[Sample video downloading from YouTube]
# youtube-dl https://www.youtube.com/watch?v=SjiwQxbol7I
[youtube] SjiwQxbol7I: Downloading webpage
[youtube] SjiwQxbol7I: Extracting video information
[download] Destination: Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.f136.mp4
[download] 100% of 16.10MiB in 00:13
[download] Destination: Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.f140.m4a
[download] 100% of 2.55MiB in 00:02
[ffmpeg] Merging formats into "Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.mp4"
Deleting original file Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.f136.mp4 (pass -k to keep)
Deleting original file Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.f140.m4a (pass -k to keep)

4b) To list out available format of particular video, we can use the youtube-dl command with below format.

[List out available format for a video]
# youtube-dl -F https://www.youtube.com/watch?v=SjiwQxbol7I
[youtube] SjiwQxbol7I: Downloading webpage
[youtube] SjiwQxbol7I: Extracting video information
[info] Available formats for SjiwQxbol7I:
format code  extension  resolution note
171          webm       audio only DASH audio , [email protected]
140          m4a        audio only DASH audio , m4a_dash container, aac  @128k
278          webm       144p       DASH video , webm container, VP9, video only
160          mp4        144p       DASH video , video only
242          webm       240p       DASH video , video only
133          mp4        240p       DASH video , video only
243          webm       360p       DASH video , video only
134          mp4        360p       DASH video , video only
244          webm       480p       DASH video , video only
135          mp4        480p       DASH video , video only
247          webm       720p       DASH video , video only
136          mp4        720p       DASH video , video only
17           3gp        176x144    
36           3gp        320x240    
5            flv        400x240    
43           webm       640x360    
18           mp4        640x360    
22           mp4        1280x720   (best)

4c) If we want to download the video as 3gp format, we can use the youtube-dl command with 3gp format code (17).

[Download the video with specific format]
# youtube-dl -f 17 https://www.youtube.com/watch?v=SjiwQxbol7I
[youtube] SjiwQxbol7I: Downloading webpage
[youtube] SjiwQxbol7I: Extracting video information
[download] Destination: Linux _ Unix - Find Out DNS IP Addresss Settings Tutorial-SjiwQxbol7I.3gp
[download] 100% of 1.14MiB in 00:00

4d) Also we can download bulk of videos by creating list into txt file. Make sure each line one URL

[Download videos from file]
# youtube-dl -a videos-list.txt

4e) To save the downloaded video to different file name, use the below format.

[Save the file with different name]
# youtube-dl https://www.youtube.com/watch?v=SjiwQxbol7I -o linux-video.mp4
[youtube] SjiwQxbol7I: Downloading webpage
[youtube] SjiwQxbol7I: Extracting video information
[download] Destination: linux-video.f136.mp4
[download] 100% of 16.10MiB in 00:13
[download] Destination: linux-video.mp4.f140
[download] 100% of 2.55MiB in 00:02
[ffmpeg] Merging formats into "linux-video.mp4"
Deleting original file linux-video.f136.mp4 (pass -k to keep)
Deleting original file linux-video.mp4.f140 (pass -k to keep)

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...

Shares
Close
Please support the site
By clicking any of these buttons you help our site to get better