Skip to content

Commit

Permalink
real time aria2 output, removed the buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
FireHead90544 committed Sep 23, 2022
1 parent 3d3f1c1 commit f1195ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ def download_using_aria2(links: list, anime_dir: str) -> None:
cmd = [str(client.config.aria_2_path.resolve()), "-s", '16', "-x", '16', "-j", '16', "--max-concurrent-downloads=6", "-d", str(download_dir.resolve()), "-Z"]
cmd = subprocess.list2cmdline(cmd)
cmd += " \"" + "\" \"".join(links) + "\""
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
p = subprocess.Popen(cmd, shell=True, bufsize=1, universal_newlines=True, stdout=subprocess.PIPE)
for line in p.stdout:
print(line.decode('utf-8', errors='ignore').rstrip())
print(line.rstrip(), end="\r")
p.wait()
total_time = client.utils.convert_seconds_to_time(round(time.perf_counter() - start))
header()
client.config.logger.info(f"Downloaded {len(links)} episodes to \"{download_dir.resolve()}\" in {total_time}")
print(f"{Fore.GREEN}>>> Download Completed in {total_time} {Fore.WHITE}| Downloaded {Fore.GREEN}{len(links)} episodes{Fore.WHITE} to {Fore.RED}\"{download_dir.resolve()}\" {Fore.GREEN}<<<")
# Some pyinstaller config for --onefile option
Expand Down
2 changes: 1 addition & 1 deletion senpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
from .client import GogoClient
from .errors import *

__version__ = "0.1.4"
__version__ = "0.1.5"
__author__ = "</Rudransh Joshi> (FireHead90544)"

0 comments on commit f1195ed

Please sign in to comment.