Skip to content

Commit 811cd15

Browse files
committed
added progress bar
1 parent a6f97e5 commit 811cd15

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

Facebook_Video_Downloader/script.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ALL Imports
2-
2+
from tkinter.ttk import *
33
import tkinter as tk
44
from requests import get, HTTPError, ConnectionError
55
from re import findall
@@ -33,7 +33,6 @@ def get_downloadlink(url):
3333
def Download_vid():
3434

3535
# Validates Link and download Video
36-
Download_Window.delete("0.0", "end")
3736
global Url_Val
3837
url=Url_Val.get()
3938

@@ -64,8 +63,7 @@ def download(url):
6463
for data in r.iter_content(block_size):
6564
totaldata+=len(data)
6665
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
6967
file.write(data)
7068
file.close()
7169
print("Download Finished")
@@ -94,11 +92,11 @@ def download(url):
9492
Download_button = tk.Button(ld_window, text="Download", font=("Calibri", 9), command=Download_vid)
9593
Download_button.place(x=100, y=100, width=200)
9694

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)
9899

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)
102100

103101
# Text for Status of Downloading
104102
Status = tk.Label(ld_window, text="Hello!! :D", fg="blue", font=("Calibri", 9), bd=1, relief=tk.SUNKEN, anchor=tk.W, padx=3)
892 KB
Binary file not shown.

0 commit comments

Comments
 (0)