How to Create a Simple YouTube Download Program with a Progress Indicator in Python 3 with pytube

Python 3, pytube, os in Windows 10

Some of my friends live in an area that really struggles to get decent internet speeds in the afternoons and evenings. So much so that they can barely watch a YouTube video at 144p some days, and that is not particularly useful if they are trying to watch a video with code or some technical specs on the screen.

They really needed to download the videos, but really did not trust the programs available online to download videos for me without spamming them with advertising or adding some malicious malware to their beloved computers.

Fortunately, someone developed a Python 3 library to do just that – pytube.  In an earlier post I dive into some of the main aspects pytube:

How do I download YouTube videos with Python 3 using Pytube?

In this post, I am going to show you a quick app that can be run in the Python shell to download videos that features a progress indicator (not quite a progress bar).

I’ve intentionally kept the program fairly limited so you can focus on the important parts. I’ll show you the code and an example of what it looks like when it is running first and then give you the breakdown where you can focus on what you need to know and ignore the rest.

Continue reading “How to Create a Simple YouTube Download Program with a Progress Indicator in Python 3 with pytube”

How do I download YouTube videos with Python 3 using Pytube?

Python 3, pytube 9.0.6 in Windows 10. 

pytube is a very easy to use light-weight library that you can use to download YouTube Videos.

Installation can be achieved in the terminal or command prompt with pip:

To download a video from YouTube you don’t really have to do much. So much so that you can get everything you need from the shell and be downloading a video in two lines of code.

In line 2, you can see that we have copied and pasted our YouTube URL. You can either use the one in the Address Bar on the one that appears when you click “Share” on YouTube.

Continue reading “How do I download YouTube videos with Python 3 using Pytube?”