From 009a8803718a28dde105f20ee50bce66216a9c64 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 9 Jan 2024 12:52:14 +0000 Subject: [PATCH] Silence at the log_buffer not the stdout in aria2c This is so we can still obtain progress data while calling aria2c silently --- devine/core/downloaders/aria2c.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index ef14b63..b44d510 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -119,7 +119,7 @@ async def aria2c( executable, *arguments, stdin=subprocess.PIPE, - stdout=[subprocess.PIPE, subprocess.DEVNULL][silent] + stdout=subprocess.PIPE ) p.stdin.write(url_file.encode()) @@ -165,7 +165,7 @@ async def aria2c( continue log_buffer += f"{line.strip()}\n" - if log_buffer: + if log_buffer and not silent: # wrap to console width - padding - '[Aria2c]: ' log_buffer = "\n ".join(textwrap.wrap( log_buffer.rstrip(),