-
Notifications
You must be signed in to change notification settings - Fork 12
/
YT_Video_Downloader
49 lines (34 loc) · 1.5 KB
/
YT_Video_Downloader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from tkinter import *
import sys
from tkinter import messagebox, filedialog
from pytube import YouTube
root = Tk()
root.geometry('500x300')
root.title("Youtube Video Downloader")
def Browse_Loc():
download_Directory = filedialog.askdirectory(
initialdir="PATH", title="Save Video")
loc.set(download_Directory)
Label(root, text='Youtube Video Downloader', font='arial 20 bold').pack()
link = StringVar()
loc = StringVar()
var = IntVar()
Label(root, text='Paste Video Link:', font='arial 15 bold').place(x=160, y=60)
link_enter = Entry(root, width=70, textvariable=link).place(x=32, y=90)
link_enter = Entry(root, width=50, textvariable=loc).place(x=32, y=130)
Button(root, text='Browse Folder..', font='arial 10 bold', bg='gray', fg='white', command=Browse_Loc
).place(x=345, y=125)
g = Radiobutton(root, text="240p", variable=var, value=133).place(x=32, y=155)
l = Radiobutton(root, text="360p", variable=var, value=18).place(x=92, y=155)
m = Radiobutton(root, text="720p", variable=var, value=22).place(x=152, y=155)
h = Radiobutton(root, text="1080p", variable=var, value=137).place(x=210, y=155)
def Downloader():
url = YouTube(str(link.get()))
video = url.streams.get_by_itag(var.get())
download_Folder = loc.get()
video.download(download_Folder)
Label(root, text='DOWNLOAD COMPLETE!!',
font='arial 10').place(x=165, y=180)
Button(root, text='DOWNLOAD', font='arial 15 bold', bg='red', fg='white',
padx=2, command=Downloader).place(x=180, y=230)
root.mainloop()