Skip to content

Commit 768dd28

Browse files
Merge pull request #3070 from mr-d-luffy/mr-temp
commets in code
2 parents 46ea830 + 59c99a0 commit 768dd28

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

youtubedownloader.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
from tkinter import Button, Entry, Label, Tk, filedialog, messagebox
2-
from threading import Thread
3-
from pytube import YouTube
1+
# modules for Using of app
2+
from tkinter import Button, Entry, Label, Tk, filedialog, messagebox # Gui Modules
3+
from threading import Thread # modules for multi threding
4+
from pytube import YouTube # Module for Youtube service
5+
6+
# this function for mulple code runes at a time
47
def threading():
58
# Call work function
69
t1 = Thread(target=download)
710
t1.start()
11+
12+
# this function for Download Youtube video
813
def download():
914
try:
1015
url = YouTube(str(url_box.get()))
@@ -18,7 +23,7 @@ def download():
1823
else:
1924
messagebox.showwarning("", "Download cancelled!")
2025
except Exception:
21-
messagebox.showerror("Error", "An error occurred while downloading the video.")
26+
messagebox.showerror("Error", "Some Thing Went Wrong!!!\nplease try again")
2227

2328

2429
# This code runes on only this file
@@ -40,13 +45,15 @@ def download():
4045
)
4146
introlable.place(x=35, y=20)
4247

43-
Label(root, text="Enter YouTube Link", font=("sans-serif", 16), bg="olivedrab1").place(
48+
Label(root, text="Enter YouTube Link", font=("sans-serif", 16), bg="olivedrab1", fg='Black').place(
4449
x=40, y=150
4550
)
4651

52+
# entry box in UI
4753
url_box = Entry(root, font=("arial", 30), width=30)
4854
url_box.place(x=40, y=180)
4955

56+
# download button in UI
5057
btn = Button(root, text="DOWNLOAD", font=("sans-serif", 25), command=threading)
5158
btn.place(x=270, y=240)
5259
root.mainloop()

0 commit comments

Comments
 (0)