
It creates a blank variable called videoURL and, if there's an argument given at the command line, it checks to see if that URL contains.

It first imports YouTube from pytube and sys (needed for handling command-line arguments). This is a very simple script that could be even simpler. Yt.streams.first().download(filename=filename + ".mp4") Print("Downloading YouTube File: " + yt.title) Yt = YouTube(videoURL,use_oauth=True,allow_oauth_cache=True) Create the following Python script and save it as ytd.py or whatever you want to name it. If you're using Windows, you can get Python, which includes pip, from Ģ. Install Python and pip if you don't have them both already. The following steps will work for Windows, Linux and (likely) macOS as well.ġ. You just need to have a recent version of Python installed and be comfortable working with the command line. If you want a YouTube download process that involves fewer steps, using a Python script with pytube, a free Python library, is a great way to do it. How to Download YouTube Videos Using Python Once you have everything ready, click on Start, the video will be downloaded to the specified location and in a few seconds, you will enjoy your video in your device.When the download is complete, you'll find the file in the location where you set it to go. Click Browse at the end of the window and select a location. Choose the download formatĪfter choosing the final format of the video you are going to download, choose the folder or directory where you want to save the download. By the way, it is possible to create your own format profiles and have them appear on this list.

In the Profile tab, expand the list of options and choose the video format, audio format or a combination of both that you are looking for.

Now, it is time to choose an output format. Press the Convert/Save option in the bottom right corner. Go the Network tab, you should see the the URL of the YouTube video that you're playing. With the video on your screen, look for the Media option in the upper menu, but this time select the Convert/ Save list. The video will start playing in the VLC interface. Paste the URL of the YouTube video we want to downloadĪfter you paste the address of the video, look at the bottom of the window for the Play button and click it.
