Youtube-dl is the most important and useful open-source command-line tool for Linux system to download videos from websites like Youtube, Dailymotion, Facebook, Google video, yahoo and many similar sites. It developed on python based library, so python is essential to install or available to use Youtube-dl software.
The Youtube-dl application supports many operating systems to download web video, including Windows, Linux, and Mac.
Youtube-dl also supports resuming features for video download, when the download gets interrupted, It will again start from resuming point.
In this tutorial, we will learn how to install youtube-dl and how to use it on Ubuntu 20.04 Linux.
Prerequisite
- A server or system running on Ubuntu 20.04 Operating system
- An user with sudo privileges
System Update
It is general to update and upgrade system packages before installing a new package into the system. To update and upgrade your Ubuntu system use below commands:
$ sudo apt-get update –y
$ sudo apt-get upgrade –y
When your system gets updated, restart your system to apply all updated changes.
Install Youtube-dl on Ubuntu 20.04 OS
Here we are going to explain the very simplest way to install youtube-dl in any Ubuntu system. To install youtube-dl we need curl package, So first install curl into your system using the following command:
$ sudo apt-get install curl –y
After installing curl, download the youtube-dl into your system using curl command:
$ curl –L https://yt-dl.org/latest/youtube-dl -o /usr/bin/youtube-dl
Now, you should change the permission for this downloaded binary file using the following command:
$ sudo chmod 755 /usr/bin/youtube-dl
Now, youtube-dl is installed and working on your system.
Youtube-dl Uses
$ youtube-dl –h
Youtube-dl has the capabilities to support more video formats such as MP4, 3GP, WebM, and FLV. You can check all the available video format for any video by using below command:
$ youtube-dl –F https://www.youtube.com/watch?v=uooY7-eKAeA
You will get output like below where all the available format for this video is listed:
Output:
[info] Available formats for j_JgXJ-apXs:
format code extension resolution note
139 m4a audio only DASH audio 56k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 756.44KiB
249 webm audio only DASH audio 56k , opus @ 50k, 724.28KiB
250 webm audio only DASH audio 69k , opus @ 70k, 902.75KiB
171 webm audio only DASH audio 110k , vorbis@128k, 1.32MiB
251 webm audio only DASH audio 122k , opus @160k, 1.57MiB
140 m4a audio only DASH audio 146k , m4a_dash container, mp4a.40.2@128k (44100Hz), 1.97MiB
278 webm 256x144 144p 97k , webm container, vp9, 24fps, video only, 1.33MiB
160 mp4 256x144 DASH video 102k , avc1.4d400c, 24fps, video only, 731.53KiB
133 mp4 426x240 DASH video 174k , avc1.4d4015, 24fps, video only, 1.36MiB
242 webm 426x240 240p 221k , vp9, 24fps, video only, 1.74MiB
134 mp4 640x360 DASH video 369k , avc1.4d401e, 24fps, video only, 2.90MiB
243 webm 640x360 360p 500k , vp9, 24fps, video only, 4.15MiB
135 mp4 854x480 DASH video 746k , avc1.4d401e, 24fps, video only, 6.11MiB
244 webm 854x480 480p 844k , vp9, 24fps, video only, 7.27MiB
247 webm 1280x720 720p 1155k , vp9, 24fps, video only, 9.21MiB
136 mp4 1280x720 DASH video 1300k , avc1.4d401f, 24fps, video only, 9.66MiB
248 webm 1920x1080 1080p 1732k , vp9, 24fps, video only, 14.24MiB
137 mp4 1920x1080 DASH video 2217k , avc1.640028, 24fps, video only, 15.28MiB
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2@ 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
43 webm 640x360 medium , vp8.0, vorbis@128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2@ 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2@192k (best)
Now, you can choose the format to download the video using the flag –f like below:
$ youtube-dl –f 18 https://www.youtube.com/watch?v=uooY7-eKAeA
The above command will download the video in MP4 format at 640×360 resolution:
[youtube] j_JgXJ-apXs: Downloading webpage
[youtube] j_JgXJ-apXs: Downloading video info webpage
[youtube] j_JgXJ-apXs: Extracting video information
[youtube] j_JgXJ-apXs: Downloading MPD manifest
[download] Destination: Lucknow se Aaya Mera Dost (Become YouTuber) | Vlog.mp4
[download] 100% of 6.90MiB in 00:47
You can download youtube video in MP3 audio format also using the following command:
$ youtube-dl https://www.youtube.com/watch?v=uooY7-eKAeA –x --audio-format mp3
You can also download the all video from specific youtube channel using channel’s url as show below:
$ youtube-dl –citw https://www.youtube.com/channel/UCSHW4sIysWm_Q69t7RE-slQ
Youtube-dl is also working good with a proxy network, so if you are using the proxy network, you can use youtube-dl as shown below:
$ youtube-dl –proxy http://proxy-ip:port https://www.youtube.com/watch?v=uooY7-eKAeA
You can also download multiple videos using youtube-dl, you can create a text file with the list of video and use the following command:
$ youtube-dl –a video-list.txt
Youtube-dl GUI Installation
There is another tool called youtube-dlg, which is the graphical tool for youtube-dl. It is the best choice if you are looking for a graphical video download tool. It is also a free, open-source tool written in wxPython.
This tool’s repository not included in the Ubuntu system, so if you want to install youtube-dlg first, you need to configure the repository.
You can add youtube-dlg repository into your system using the following commands:
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update –y
Now, after updating the repository, you can install youtube-dlg by apt-get command, as shown below:
$ sudo apt-get install youtube-dlg –y
Now you can install youtube-dl or youtube-dlg any application in your system or server which will help you to download videos from various sites.
Conclusion
Now, you have learned to install youtube-dl successfully into your Ubuntu 20.04 Operating system and uses of this tool. Now you are ready to download any video from youtube or youtube-dl supported sites.
If you have any doubt, problem in instalaltion or any feedback, feel free to leave a comment below.
0 Comments