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
47def threading ():
58 # Call work function
69 t1 = Thread (target = download )
710 t1 .start ()
11+
12+ # this function for Download Youtube video
813def 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!!! \n please 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