diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index 591175b..0b4175e 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -11,7 +11,8 @@ async def aria2c( uri: Union[str, list[str]], out: Path, headers: Optional[dict] = None, - proxy: Optional[str] = None + proxy: Optional[str] = None, + byte_range: Optional[str] = None ) -> int: """ Download files using Aria2(c). @@ -68,6 +69,9 @@ async def aria2c( continue arguments.extend(["--header", f"{header}: {value}"]) + if byte_range: + arguments.extend(["--header", f"Range: bytes={byte_range}"]) + if proxy and proxy.lower().split(":")[0] != "http": # HTTPS proxies not supported by Aria2c. # Proxy the proxy via pproxy to access it as a HTTP proxy.