Manitej Pratha
Manitej Pratha's Blog

Manitej Pratha's Blog

Download YouTube videos using Python

Download YouTube videos using Python

Subscribe to my newsletter and never miss my upcoming articles

Hey guys, in this short post lets see how we can download youtube videos using Python.

To make this possible, we use a package called pytube

What is pytube?

Their official docs says,

pytube is a very serious, lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.

Installing pytube

Run the below command to install the pytube package.

pip install pytube

Now, pytube is successfully installed on your system.

To download a video, simply copy the URL of that video and run the below code

from pytube import YouTube
url = ""

Thats it folks :)

To learn more about pytube visit their docs

Share this
Proudly part of