added progress bar

This commit is contained in:
2025-09-21 02:16:17 +02:00
parent 8a856f0dad
commit eedb5ded17
2 changed files with 33 additions and 12 deletions
+14 -3
View File
@@ -1,9 +1,10 @@
import aria2p
import os
import subprocess
import time
def run_aria2p():
global aria2
aria2 = aria2p.API(
aria2p.Client(
@@ -22,8 +23,6 @@ def set_threads(threads):
t = threads
def aria2server():
downloads_dir = os.path.join("Library")
@@ -42,3 +41,15 @@ def aria2server():
aria2server = subprocess.Popen(cmd)
return aria2server
def dlprogress():
try:
download2 = aria2.get_downloads()
if download2:
for download in download2:
progress = download.progress_string(0)
progress_int = int(progress.strip('%'))
return progress_int
return 0
except:
return 0