forked from DRMTalks/devine
Add ability to silence aria2c's output
This commit is contained in:
parent
0913b0dda6
commit
4406e3bbab
|
@ -15,6 +15,7 @@ async def aria2c(
|
||||||
headers: Optional[dict] = None,
|
headers: Optional[dict] = None,
|
||||||
proxy: Optional[str] = None,
|
proxy: Optional[str] = None,
|
||||||
byte_range: Optional[str] = None,
|
byte_range: Optional[str] = None,
|
||||||
|
silent: bool = False,
|
||||||
*args: str
|
*args: str
|
||||||
) -> int:
|
) -> int:
|
||||||
"""
|
"""
|
||||||
|
@ -88,7 +89,9 @@ async def aria2c(
|
||||||
p = await asyncio.create_subprocess_exec(
|
p = await asyncio.create_subprocess_exec(
|
||||||
executable,
|
executable,
|
||||||
*arguments,
|
*arguments,
|
||||||
stdin=subprocess.PIPE
|
stdin=subprocess.PIPE,
|
||||||
|
stderr=[None, subprocess.DEVNULL][silent],
|
||||||
|
stdout=[None, subprocess.DEVNULL][silent]
|
||||||
)
|
)
|
||||||
await p.communicate(uri.encode())
|
await p.communicate(uri.encode())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue