Silence at the log_buffer not the stdout in aria2c

This is so we can still obtain progress data while calling aria2c silently
This commit is contained in:
rlaphoenix 2024-01-09 12:52:14 +00:00
parent 9f04676b5c
commit 009a880371
1 changed files with 2 additions and 2 deletions

View File

@ -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(),