Skip to content

Commit f6272ef

Browse files
Update yt-downloader.py
1 parent 29435bb commit f6272ef

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed
Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1+
# ================================= Importing Suitable Libraries =========================================================
12
import tkinter as tk
23
from tkinter import *
34
from PIL import ImageTk, Image
45
from tkinter import messagebox
6+
#install through ->> pip install pytube3
57
import pytube
68
import time
79

10+
# ===================================== End ===============================================================
11+
12+
#===================================== Adding Window Components =============================================
13+
#craeting main window
814
root = tk.Tk()
15+
#window title
916
root.title("Youtube Downloader")
17+
#window logo
1018
root.iconbitmap("Youtube.ico")
19+
#window size
1120
root.geometry("700x300")
12-
#root.maxsize(700,250)
21+
#window max-size
22+
root.maxsize(700,250)
23+
#window min-size
1324
root.minsize(700,300)
1425

26+
# ================================ End =============================================================================
1527

28+
#=================================== function code starts here ======================================================
1629
def download():
1730
link = text.get("1.0","end-1c")
1831

@@ -28,31 +41,37 @@ def download():
2841
stream.download()
2942
messagebox.showinfo("YouTube Downloader",'Video has been download successfully')
3043

31-
44+
# ================================================= End =========================================================
3245

33-
34-
46+
# ================================================ main design code =================================================
47+
# header label
3548
header = Label(root,bg="black",width="300",height="2")
3649
header.place(x=0,y=0)
3750

51+
#youtube logo image
3852
yt_logo = ImageTk.PhotoImage(Image.open('youtube.png'))
3953
logo = Label(root, image = yt_logo,borderwidth=0)
4054
logo.place(x=10,y=10)
4155

56+
#caption label
4257
caption = Label(root,text="YouTube Downloader",font=('verdana',10,'bold'))
4358
caption.place(x=50,y=10)
4459

45-
46-
60+
#youtube logo image
4761
yt1_logo = ImageTk.PhotoImage(Image.open('yt.png'))
4862
logo1 = Label(root, image = yt1_logo,borderwidth=0)
4963
logo1.place(x=300,y=60)
5064

51-
65+
#text widgets to get the url
5266
text = Text(root,width=60,height=2,font=('verdana',10,'bold'))
5367
text.place(x=90,y=180)
5468
text.insert('end','Paste your video link here')
5569

70+
#Download Buttons
5671
button = Button(root,text="Download",relief=RIDGE,font=('verdana',10,'bold'),bg="red",fg="white",command=download)
5772
button.place(x=330,y=220)
58-
root.mainloop()
73+
74+
#load the window
75+
root.mainloop()
76+
77+
#======================================================== End ========================================================

0 commit comments

Comments
 (0)