youtube-dl_ Download YouTube Videos in Linux Command Line
youtube-dl_ Download YouTube Videos in Linux Command Line
Subscribe
But when it comes to Linux, nothing beats youtube-dl. It is a command line based tool, so not
everyone's cup of tea. Still, it's a versatile tool that lets you do a lot more than just downloading
videos.
I use it to make backups of the videos I have uploaded on It's FOSS YouTube channel.
Membership
https://itsfoss.com/download-youtube-linux/ 1/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
In this tutorial, I will show you how to use youtube-dl to download videos from YouTube and
other websites. I'll also share a few additional examples that you may find useful.
What is youtube-dl?
youtube-dl is a Python-based command-line tool that allows downloading videos
from YouTube, Dailymotion, Photobucket, Facebook, Yahoo, Metacafe, Depositfiles and a few
more similar sites. It is written in pygtk and requires Python interpreter to run this program, it’s
not platform restricted. It should run on any Unix, Windows or in Mac OS X based systems.
The youtube-dl tool supports resuming interrupted downloads. If youtube-dl is killed (for
example, by Ctrl-C or due to loss of Internet connectivity) in the middle of the download, you
can simply re-run it with the same YouTube video URL. It will automatically resume the
unfinished download as long as a partial download is present in the current directory. Which
means you don’t need download managers in Linux just for resuming downloads.
youtube-dl features
This tiny tool offers so many features that it won’t be an exaggeration to call it the best YouTube
downloader for Linux.
Download videos from not only YouTube but other popular video websites like
Dailymotion, Facebook etc
Allows downloading videos in several available video formats, such as MP4, WebM etc.
You can also choose the quality of the video being downloaded. If the video is available
in 4K, you can download it in 4K, 1080p, 720p, etc.
Automatic pause and resume of video downloads.
Allows to bypass YouTube geo-restrictions.
🚧 Attention! Downloading videos from websites could be against their policies. It’s up to
you if you decide to download videos. Furthermore, there is no release for this tool
because of various copyright issues of the past.
youtube-dl is a popular program and, is available in the default repositories of most Linux
distributions, if not all. But unfortunately, you cannot use these standard packages in your
distribution. They are old and most probably don’t work. You can get a working youtube-dl either
from the official GitHub repository, or from the youtube-dl nightly release.
Here, you can get a python file, named youtube-dl . Just download it. Once downloaded, copy
that file to /usr/local/bin/ . For this, open a terminal where you downloaded the file and
then run:
Now, give the file the required permissions using the chmod command.
You cannot just run youtube-dl now, because of issue with python naming. It uses python
while in Ubuntu-based systems, it is python3 . So, you can create an alias for youtube-dl in
your .bashrc .
If you are running an Ubuntu-based Linux distribution, you can install the tools needed to
compile youtube-dl using the command below:
Once you made youtube-dl, you need to copy it to a location in the path. Use the command
below:
As in the previous case, if you run youtube-dl from the command line, you will get an error about
python because it tries to run using python while in Ubuntu, it is python3 . You can create an
alias on your .bashrc like:
youtube-dl -U
https://itsfoss.com/download-youtube-linux/ 4/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
team@itsfoss-mantic:~$ youtube-dl
Update youtube-dl
youtube-dl <video_url>
Download a Video
The video is saved in the directory from where you run the command.
youtube-dl -F <video_url>
https://itsfoss.com/download-youtube-linux/ 5/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
team@itsfoss-mantic:~$
Now among the available video formats, choose one that you like. For example, if you want to
download it in MP4 version and 1080 pixel, you should use:
To download a playlist, simply run the following command. Where, “playlist_url” is the URL of the
playlist that you want to download.
If you just want to download the audio from a YouTube video, you can use the -x option to
simply extract the audio file from the video.
youtube-dl -x <video_url>
The file format is M4A/Ogg, which you may not like. You can specify the file format of the audio
file in the following manner:
ON THIS PAGE
What is youtube-dl?
youtube-dl -x --audio-format mp3 <video_url>
youtube-dl features
How to install youtube-dl on Linux
Install youtube-dl Nightly
And a lot more can be done with youtube-dl
Alternatively, compile from Git Master
Important: Keep your youtube-dl updated
youtube-dl is a versatile
Using YouTube-dl commandvideos
for downloading line tool and provides a number of functionalities. No wonder
Download
it is such YouTube
a popular videos inline
command various
tool.formats and quality size
Download subtitles of videos using youtube-dl
Download entire YouTube playlist
I haveDownload
only shown somefrom
only audio of the most videos
YouTube common usages of this tool. But if you are keen to explore
itsAnd
capabilities
a lot morefurther, please
can be done withcheck its manual.
youtube-dl
I hope this article helped you to download YouTube videos on Linux. If you have questions or
suggestions, please drop a comment below.
https://itsfoss.com/download-youtube-linux/ 7/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
Tutorial
Abhishek Prakash
Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's
degree in Engineering and years of IT industry experience. Huge fan of Agatha
Christie detective mysteries 🕵️♂️
Featured
Latest
https://itsfoss.com/download-youtube-linux/ 8/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
Subscribe
15 5 3 3 0 0
superb love wow sad laugh angry
Newest
GrowleyMonster 5 months ago
Has it been fixed to work with Wayland?
0 0 Reply
https://itsfoss.com/download-youtube-linux/ 9/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
I am not sure about the issues with Wayland… I was running a Wayland
session, and it worked without any issues.
0 0 Reply
READ NEXT
https://itsfoss.com/download-youtube-linux/ 12/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
SUBSCRIBE
https://itsfoss.com/download-youtube-linux/ 13/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
Subscribe
Navigation
📰 News Linux Server Side
📬 Newsletter En Español
🧩 Quizzes & Puzzles 🗳️ Feedback
🎒 Resources Impressum
🏘️Community
📖 About
🪪 Contact
📜 Policies
Resources
Courses 🎓
Distro Resources 📖
Guides 📒
Social
Facebook
Twitter
RSS
Instagram
Telegram
Youtube
©2024 It's FOSS. Hosted on Digital Ocean & Published with Ghost & Rinne. System
https://itsfoss.com/download-youtube-linux/ 14/15
12/1/24, 6:05 PM youtube-dl: Download YouTube Videos in Linux Command Line
https://itsfoss.com/download-youtube-linux/ 15/15