-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2127 from HellspawnXerxes/master
Add files via upload
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
Program's_Contributed_By_Contributors/Python_Programs/YouTube_Video_Downloader.py
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,36 @@ | ||
import tkinter as tk | ||
from pytube import YouTube | ||
|
||
root= tk.Tk() | ||
|
||
canvas1 = tk.Canvas(root, width = 400, height = 300, relief = 'raised') | ||
canvas1.pack() | ||
|
||
label1 = tk.Label(root, text='Download Youtube Videos') | ||
label1.config(font=('helvetica', 14)) | ||
canvas1.create_window(200, 25, window=label1) | ||
|
||
label2 = tk.Label(root, text='Enter Video url : ') | ||
label2.config(font=('helvetica', 10)) | ||
canvas1.create_window(200, 100, window=label2) | ||
|
||
entry1 = tk.Entry (root) | ||
canvas1.create_window(200, 140, window=entry1) | ||
|
||
def download(): | ||
ytd_url = entry1.get() | ||
try: | ||
obj = YouTube(ytd_url) | ||
filter = obj.streams.filter(progressive=True,file_extension='mp4') | ||
filter.get_highest_resolution().download(filename='Snowman-WYS.mp4') | ||
label3 = tk.Label(root, text= "Downloading Started",font=('helvetica', 10)) | ||
canvas1.create_window(200, 210, window=label3) | ||
except Exception as e: | ||
label4 = tk.Label(root, text= "Downloading Failed",font=('helvetica', 10)) | ||
canvas1.create_window(200, 210, window=label4) | ||
|
||
|
||
button1 = tk.Button(text='Download', command=download, bg='red', fg='white', font=('helvetica', 9, 'bold')) | ||
canvas1.create_window(200, 180, window=button1) | ||
|
||
root.mainloop() |