@@ -20,31 +20,33 @@ def download():
2020 except Exception :
2121 messagebox .showerror ("Error" , "An error occurred while downloading the video." )
2222
23+
24+ # This code runes on only this file
25+ if __name__ == "__main__" :
26+ root = Tk ()
27+ root .title ("YouTube Downloader" )
28+ root .geometry ("780x500+200+200" )
29+ root .configure (bg = "olivedrab1" )
30+ root .resizable (False , False )
31+ # Label widgets
32+ introlable = Label (
33+ root ,
34+ text = "YouTube Video Downloader" ,
35+ width = 30 ,
36+ relief = "ridge" ,
37+ bd = 4 ,
38+ font = ("chiller" , 26 , "italic bold" ),
39+ fg = "red" ,
40+ )
41+ introlable .place (x = 35 , y = 20 )
2342
24- root = Tk ()
25- root .title ("YouTube Downloader" )
26- root .geometry ("780x500+200+200" )
27- root .configure (bg = "olivedrab1" )
28- root .resizable (False , False )
29- # Label widgets
30- introlable = Label (
31- root ,
32- text = "YouTube Video Downloader" ,
33- width = 30 ,
34- relief = "ridge" ,
35- bd = 4 ,
36- font = ("chiller" , 26 , "italic bold" ),
37- fg = "red" ,
38- )
39- introlable .place (x = 35 , y = 20 )
43+ Label (root , text = "Enter YouTube Link" , font = ("sans-serif" , 16 ), bg = "olivedrab1" ).place (
44+ x = 40 , y = 150
45+ )
4046
41- Label (root , text = "Enter YouTube Link" , font = ("sans-serif" , 16 ), bg = "olivedrab1" ).place (
42- x = 40 , y = 150
43- )
47+ url_box = Entry (root , font = ("arial" , 30 ), width = 30 )
48+ url_box .place (x = 40 , y = 180 )
4449
45- url_box = Entry (root , font = ("arial" , 30 ), width = 30 )
46- url_box .place (x = 40 , y = 180 )
47-
48- btn = Button (root , text = "DOWNLOAD" , font = ("sans-serif" , 25 ), command = threading )
49- btn .place (x = 270 , y = 240 )
50- root .mainloop ()
50+ btn = Button (root , text = "DOWNLOAD" , font = ("sans-serif" , 25 ), command = threading )
51+ btn .place (x = 270 , y = 240 )
52+ root .mainloop ()
0 commit comments