Hy, In this tutorial we will make a video download application with the help of TKInter.
What is TKinter ?
Tkinter is the Python interface to the Tk GUI toolkit shipped with Python.
Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.
Tkinter can be installed using pip. The following command is run in the command prompt to install Tkinter:
>> pip install tk
What is pytube ?
pytube is a very serious, lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos.
To install the required module run pip installer command on the command line:
>> pip install pytube
Source Code:
from tkinter import *
from pytube import YouTube
root = Tk()
root.geometry('500x300')
root.resizable(0,0)
root.title("youtube video downloader")
Label(root,text = 'Youtube Video Downloader', font ='arial 20 bold').pack()
link = StringVar()
Label(root, text = 'Paste Link Here:', font = 'arial 15 bold').place(x= 160 , y = 60)
link_enter = Entry(root, width = 70,textvariable = link).place(x = 32, y = 90)
def Downloader():
url =YouTube(str(link.get()))
video = url.streams.first()
video.download()
Label(root, text = 'DOWNLOADED', font = 'arial 15').place(x= 180 , y = 210)
Button(root,text = 'DOWNLOAD', font = 'arial 15 bold' ,bg = 'pale violet red',
padx = 2, command = Downloader).place(x=180 ,y = 150)
root.mainloop()
Output:
0 Comments