-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81595ed
commit c00968e
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pytube import YouTube | ||
from tkinter import * | ||
from tkinter import ttk | ||
|
||
def download(): | ||
global entry | ||
#Get the link from entry | ||
videoLink= entry.get() | ||
video = YouTube(videoLink) | ||
video = video.streams.get_highest_resolution() | ||
try: | ||
video.download() | ||
except: | ||
label.configure(text="There has been an error in downloading!") | ||
label.configure(text="Download is Completed.") | ||
|
||
|
||
win= Tk() | ||
|
||
#Set the geometry of Tkinter frame | ||
win.geometry("750x250") | ||
|
||
#Initialize a Label to display the User Input | ||
label=Label(win, text="Enter Video Link Here", width=100,font=("Georgia"),height=2) | ||
label.pack() | ||
|
||
#Create an Entry widget to accept User Input | ||
entry= Entry(win, width= 40,font='Arial 15') | ||
entry.focus_set() | ||
entry.pack(padx=10,pady=5) | ||
|
||
#Create a Button to validate Entry Widget | ||
ttk.Button(win, text= "Download",width= 30, command= download).pack(padx=10,pady=30) | ||
|
||
win.mainloop() |