|
| 1 | +# =================== PASSED =========================== |
| 2 | +# Fix Resolution Software Youtube Video Downloader |
| 3 | +# Add someone variabel in video downloader |
| 4 | +# And pop up show messagebox download started |
| 5 | +# ====================================================== |
| 6 | + |
| 7 | + |
| 8 | + |
1 | 9 | # ================= Importing Modules ===================
|
2 | 10 | from tkinter import *
|
3 | 11 | import tkinter as tk
|
@@ -45,15 +53,17 @@ def download_video(self):
|
45 | 53 | elif self.video_path.get() == "":
|
46 | 54 | messagebox.showerror("Error","Please provide Path")
|
47 | 55 | else:
|
48 |
| - try: |
49 |
| - |
| 56 | + # try: |
| 57 | + # Just fix resolution video and add variabel in video downloader |
| 58 | + # And create messagebox show info download started. |
50 | 59 | self.url = self.video_url.get()
|
51 | 60 | self.path = self.video_path.get()
|
52 |
| - self.video = YouTube(self.url) |
53 |
| - self.stream = self.video.streams.filter(only_audio=False).first() |
54 |
| - print("download started",self.video.title) |
55 |
| - |
56 |
| - print("download completed",self.video.title) |
| 61 | + self.video = YouTube(self.url).streams |
| 62 | + self.stream = self.video.filter( |
| 63 | + file_extension="mp4", res="720p", |
| 64 | + only_audio=False |
| 65 | + ).first() |
| 66 | + messagebox.showinfo("Information Download Video", "Download Started Just Wait Pop Up Show For Done Download Video.") |
57 | 67 |
|
58 | 68 | self.root = tk.Tk()
|
59 | 69 | self.root.geometry('300x150')
|
@@ -83,17 +93,17 @@ def download_video(self):
|
83 | 93 |
|
84 | 94 | self.dow_details = ScrolledText(self.root,width=30,height=3,font=('verdana',8,'bold'))
|
85 | 95 | self.dow_details.place(x=20,y=70)
|
86 |
| - self.dow_details.insert(END,f'{self.video_path.get()}\n {self.video.title}') |
| 96 | + self.dow_details.insert(END,f'{self.video_path.get()}') |
87 | 97 |
|
88 | 98 | self.dow_success = Label(self.root,text="Video downloaded successfully .....",fg="red",font=('verdana',10,'bold'),bg="white")
|
89 | 99 | self.dow_success.place(x=10,y=120)
|
90 | 100 |
|
91 | 101 | self.root.mainloop()
|
92 | 102 |
|
93 | 103 |
|
94 |
| - except: |
95 |
| - time.sleep(10) |
96 |
| - messagebox.showerror("Error","Unable to Download Video | Something went wrong !!") |
| 104 | + # except: |
| 105 | + # time.sleep(10) |
| 106 | + # messagebox.showerror("Error","Unable to Download Video | Something went wrong !!") |
97 | 107 |
|
98 | 108 | # ========================= End ==============================
|
99 | 109 |
|
|
0 commit comments