python codes to download youtube videos by jubilantrich

Free simple steps to download any YouTube video using the URL of the video with just python codes.

 With these simple steps you can download Black panther Wakanda forever trailer video with is URL: https://www.youtube.com/watch?v=RlOB3UALvrQ

Using Jupyter notebook follow the following steps.

1. First, install pytube library using the command below.

Run this 

- pip install pytube

2. Now, we need to import pytube to our codes.


import pytube

3. Create an input variable to accept the video url or link


videoLink=input ("Enter your video link")

4. Determine where you downloaded video should be saved.


downloaddir="D:"

5. The code below will get the video link, assign to YouTube method, stream the highest video resolution and download.


pytube.YouTube(videoLink).streams.get_highest_resolution().download(downloaddir

python codes to download youtube videos by jubilantrich 1

When you run the codes successfully, you will be asked to import the url of your video and enter to download.


python codes to download youtube videos by jubilantrich 2

Download would be successful within a fleeting time.

Thank you for reading.