From 316f8f05307c91c85db9f44cb77ed4d6e24c8221 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 9 Jan 2024 09:57:31 +0000 Subject: [PATCH] Set Referer & User-Agent via dedicated options instead Header in aria2c --- devine/core/downloaders/aria2c.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index 39f0985..9fa887a 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -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: