Skip to content

Commit

Permalink
Fix: Progress will be 99 percent even if the download has completed
Browse files Browse the repository at this point in the history
Feat: A button to open the downloading folder has been added
  • Loading branch information
itsHenry35 committed Jan 8, 2023
1 parent 20eed28 commit c802b2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file modified gui/__pycache__/download2.cpython-310.pyc
Binary file not shown.
9 changes: 8 additions & 1 deletion gui/download2.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ def get_stat():
tkinterlist[filename]['progress'].update()
tkinterlist[filename]['percentage'].configure(text=str("%.2f"%((int(stat['completedLength']) / int(stat['totalLength']) * 100))) + '%')
tkinterlist[filename]['speed'].configure(text='下载速度:' + str(round(int(stat['downloadSpeed'])/1024/1024, 2)) + 'MB/s')
if stat['status'] == 'complete':
tkinterlist[filename]['progress']['value'] = 100
tkinterlist[filename]['progress'].update()
tkinterlist[filename]['percentage'].configure(text='100%')
tkinterlist[filename]['speed'].configure(text='已完成')
time.sleep(0.1)
root = ttk.Window(title = '乐读视频下载器-下载', themename="morph")
root.geometry('1280x720')
Expand Down Expand Up @@ -152,7 +157,9 @@ def get_stat():
count += 1
path = os.path.join('乐读-下载', name) #create a folder to store the downloaded files
if not os.path.exists(path):
os.makedirs(path)
os.makedirs(path)
openpathbutton = ttk.Button(text = '打开下载目录', command = lambda: os.startfile(path))
openpathbutton.grid(row=count+1, column=0)
for i in downloadurls:
aria2_download(downloadurls[i], path, i)
thread = threading.Thread(target=get_stat)
Expand Down

0 comments on commit c802b2b

Please sign in to comment.