By Sayak Mandal
This application downloads YouTube videos and viewers can see the videos in offline mode.
YouTube is a very popular website that can be used for watching videos. Sometimes we want to download these videos to watch without the internet. Downloading youtube videos from any random website can increase the risk of licking personal data and more, so we can use an application that is using GUI. It is very simple and safe.
Prerequisites:
pytube: To install this module we use pip install pytube3 command.
pytube is a Python library. It is used to download videos from YouTube easily. We use download() method to download videoes in a directory. To import pytube we use from pytube import youtube.
Tkinter: To install this module use pip install tk command.
Tkinter is a Python libarary. It is a GUI based application that's why we use tkinter. We use tkinter for creating GUI. Using tkinter we create labels, buttons, and more. To import tkinter we use from tkinter import *.
moviepy: To install this module use pip install moviepy command.
Moviepy is a Python module. We use the module for video processing and video editing. The VideoFileClip class is a part of the moviepy.editor module in the MoviePy library. To import VideoFileClip from moviepy we use from moviepy.editor import VideoFileClip. It is used to load and manipulate videoes from moviepy library. For using VideoFileClip we need to install moviepy library.
In this application when you run the script, it will open a GUI window with an input field to enter the YouTube URL, and an input field for enter the directory for downloading the video. In the GUI a "Download" button and a status label are there to display the download status. After entering the download button download is start and it is showing 'downloading'. If the download is successful, it will display a success message 'successful' in the status label.
After running this code we see this screen
Submitted by Sayak Mandal (Sayak)
Download packets of source code on Coders Packet
Comments