Effortless YouTube Video Downloads on Linux

Jay Kumar GuptaJay Kumar Gupta
3 min read

In this blog post, we will delve into the realm of YouTube video downloads using the robust yt-dlp tool on Kubuntu, a Linux-based operating system.

It's important to note that the steps outlined in this guide are applicable to any Linux distribution, ensuring that users across various Linux environments can benefit from the functionality of yt-dlp for downloading YouTube videos seamlessly.

I aim to provide a comprehensive guide covering everything you need to know, from the installation of yt-dlp to downloading single videos, playlists, and even audio-only versions of content.

To begin, we will explore the installation process, ensuring that your Linux system meets the necessary prerequisites, such as having Python 3 installed.

About yt-dlp

yt-dlp is a versatile feature-rich command-line audio/video downloader with support for thousands of sites tool for downloading YouTube videos and other content, particularly for Linux users.

As a fork of youtube-dl, it offers active development and maintenance, ensuring compatibility with YouTube's frequent changes.

yt-dlp supports a wide range of websites and allows for downloading playlists, channels, and audio-only versions of videos, saving users time and effort. Check yt-dlp repository here:

https://github.com/yt-dlp/yt-dlp

Prerequisites

Before diving into the installation process, it's essential to ensure that your Linux system meets the necessary requirements.

yt-dlp relies on Python 3 to function, so make sure you have it installed on your system.

sudo apt-get install python3.8

Downloading a Single Video

Step 1

Select the video which you want to download from YouTube and copy the link of the video as follows:

Step 2

Go to the folder where you want to Download the video and open terminal there and type the following command. Press Enter after the command.

yt-dlp -F <link of the video>

Example: 
yt-dlp -F https://youtu.be/Z34GreYdyRc?si=pDnNV49NHeRE_Npd

This command will display available download options for the video, including various formats for both video and audio, as shown below:

You can see that on the left we have the list of the available formats.Each format has a id on the left, we need to choose from the list the id number of the format which we want to download.You can choose any audio or video format.

Step 3

Now we will simply download the video format which we want by the following command:

yt-dlp -f <format number> <link of the video>

Example: 
yt-dlp -f 313 https://youtu.be/Z34GreYdyRc?si=pDnNV49NHeRE_Npd

As you can see the video is downloaded on the system:

Also here's the video in File manager:

We have successfully downloaded the video! ๐Ÿคฉ

Supported sites

There are many sites which yt-dlp supports, checkout here:

https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md

Conclusion

As I conclude this blog post, I hope you found the insights on using yt-dlp for YouTube video downloads on Linux informative and beneficial.

Your feedback is valuable to me, so feel free to share your thoughts in the comments. If you found this guide helpful, consider sharing it with others who may benefit from leveraging yt-dlp.

Thank you for reading, and stay tuned for more Linux tips and tricks in my upcoming blog posts! โค๏ธ

17
Subscribe to my newsletter

Read articles from Jay Kumar Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jay Kumar Gupta
Jay Kumar Gupta

๐Ÿ‘‹ Hello Hashnode Community! I'm Jay Kumar Gupta, a 2024 Computer Science graduate with a passion for building robust and scalable web applications. ๐ŸŽ“ Skilled in MERN stack (MongoDB, Express.js, React.js, Node.js), PostgreSQL, Next.js, and TypeScript, Iโ€™m continuously honing my expertise by working on modern, efficient projects that solve real-world problems. ๐Ÿš€