Set Referer & User-Agent via dedicated options instead Header in aria2c

This commit is contained in:
rlaphoenix 2024-01-09 09:57:31 +00:00
parent 347c31d717
commit 316f8f0530
1 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,12 @@ async def aria2c(
# we cannot set an allowed encoding, or it will return compressed
# and the code is not set up to uncompress the data
continue
if header.lower() == "referer":
arguments.extend(["--referer", value])
continue
if header.lower() == "user-agent":
arguments.extend(["--user-agent", value])
continue
arguments.extend(["--header", f"{header}: {value}"])
try: