|
1 | 1 | # ALL Imports |
2 | | - |
| 2 | +from tkinter.ttk import * |
3 | 3 | import tkinter as tk |
4 | 4 | from requests import get, HTTPError, ConnectionError |
5 | 5 | from re import findall |
@@ -33,7 +33,6 @@ def get_downloadlink(url): |
33 | 33 | def Download_vid(): |
34 | 34 |
|
35 | 35 | # Validates Link and download Video |
36 | | - Download_Window.delete("0.0", "end") |
37 | 36 | global Url_Val |
38 | 37 | url=Url_Val.get() |
39 | 38 |
|
@@ -64,8 +63,7 @@ def download(url): |
64 | 63 | for data in r.iter_content(block_size): |
65 | 64 | totaldata+=len(data) |
66 | 65 | per_downloaded=totaldata*100/total_size |
67 | | - Download_Window.delete("1.0","end") |
68 | | - Download_Window.insert(tk.END,f"Dowloaded.... {per_downloaded}%") |
| 66 | + bar['value'] = per_downloaded |
69 | 67 | file.write(data) |
70 | 68 | file.close() |
71 | 69 | print("Download Finished") |
@@ -94,11 +92,11 @@ def download(url): |
94 | 92 | Download_button = tk.Button(ld_window, text="Download", font=("Calibri", 9), command=Download_vid) |
95 | 93 | Download_button.place(x=100, y=100, width=200) |
96 | 94 |
|
97 | | -# Download Window |
| 95 | +# Progress Bar |
| 96 | +bar = Progressbar(ld_window, length=350, style='grey.Horizontal.TProgressbar') |
| 97 | +bar['value'] = 0 |
| 98 | +bar.place(y=200,width=350,x=25) |
98 | 99 |
|
99 | | -Download_Window = tk.Text(ld_window, font=("Calibri", 9), bg="black", fg="white", bd=1, relief=tk.SUNKEN, wrap=tk.WORD) |
100 | | -Download_Window.insert(tk.END, "Welcome to Facebook Video Downloader, Provide a Facebook video link in the above box and click download to start the process. :D") |
101 | | -Download_Window.place(x=25, y=200, width=350, height=250) |
102 | 100 |
|
103 | 101 | # Text for Status of Downloading |
104 | 102 | Status = tk.Label(ld_window, text="Hello!! :D", fg="blue", font=("Calibri", 9), bd=1, relief=tk.SUNKEN, anchor=tk.W, padx=3) |
|
0 commit comments