It’s well known that videos are not nearly as easy to save from a website as things like images or text. Although web browsers do not feature a default way to save videos directly to our hard drive, open source projects like
youtube-dl fill this gap quite nicely.
As you can tell from the names, these tools work especially for YouTube, where most of the world’s videos are found these days. But they can also work for a variety of other sites – actually, most any site that you come across. And, usually, if there is a site that these tools can’t work with, the developers will work on adding support for it into the next release of their software.
In this tutorial, we will show you how to install
youtube-dl on major Linux distros. We will also go over their pros and cons to help you see which one is better.
In this tutorial you will learn:
- How to install
youtube-dlon major Linux distros
- How to use
youtube-dlto download video and audio streams
- Which is better? yt-dlp vs youtube-dl
|Category||Requirements, Conventions or Software Version Used|
|System||Any Linux system|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to install yt-dlp and youtube-dl on major Linux distros
On some Linux distros, these packages can be installed from the system’s package manager. However, it is recommended that you download the packages from their respective GitHub pages in order to make sure you get the latest version possible.
To install the latest version of yt-dlp on your Linux distro:
$ sudo curl -L 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
To install the latest version of youtube-dl on your Linux distro:
$ 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
yt-dlp vs youtube-dl – usage examples
All of these commands should be interchangeable between either program, so we will only show
yt-dlp (our preferred program) in the syntax examples below.
- To keep the program up to date, use the
$ yt-dlp -U
- View the available formats and resolutions of a video with the
$ yt-dlp --list-formats https://www.youtube.com/watch?v=IyOcjK3pa4w
- Download the highest quality video stream and the highest quality audio stream for a video, and combine them into a single file.
$ yt-dlp -f 'bv*+ba' https://www.youtube.com/watch?v=IyOcjK3pa4w -o '%(id)s.%(ext)s'
- Download 1080p video quality and combine it with the best possible audio stream.
$ yt-dlp -f 'bv*[height=1080]+ba' https://www.youtube.com/watch?v=IyOcjK3pa4w -o '%(id)s.%(ext)s'
- Save only the audio stream (best quality possible) and put into an mp3 file:
$ yt-dlp -f 'ba' -x --audio-format mp3 https://www.youtube.com/watch?v=dQw4w9WgXcQ -o '%(id)s.mp3'
- Of course, many more options exist, and you can get very granular with your settings in order to produce the exact video and/or audio file that you want. Use the
--helpoption to produce a long list of options that you can use with the
$ yt-dlp --help
yt-dlp vs youtube-dl – which is better?
Both tools work very similarly and incorporate a lot of the exact same code. With this in mind, determining which tool works better basically boils down to their sets of features and how often either tool gets updated or maintained.
Seeing as yt-dlp absorbs all of the code and features from youtube-dl, it makes it the pretty clear winner. This means you get all the features from youtube-dl, as well as other unique features not found in the other video downloading projects.
From monitoring both GitHub pages, it’s also obvious that yt-dlp gets more updates than its counterpart. This is important since websites are always introducing new obstacles (intentionally or not) which thwart download programs like yt-dlp, and an update to the code is needed in order to circumvent the new block.
You can see a list of these features for yourself over on the features section of the yt-dlp GitHub page.
There is one important caveat to keep in mind when you are determining which project has the better software. These projects are only as reliable as their maintainers. If the project head for either software were to suddenly disappear due to real life circumstances (has happened many times to orphaned projects), then a new leader would have to take over, or the project eventually dies and is superseded.
To get involved with either project, or download the source code directly, check out either project’s GitHub page:
In this tutorial, we saw how to install and use the
youtube-dlprograms on any Linux distribution. These are very similar programs, with one being forked from the other, and both work very well at downloading video and audio from YouTube and other sources. Due to additional features and better maintenance,
yt-dlpgets the edge slightly.