Remove byte_range param on aria2c downloader

Turns out, even if you manually set the Range header AND the server has full support, it does not work. It will act like it works, but it seems internally aria2c gets confused on what bytes it requested, what it returned, and it will either just download the full file, or the range requested (but still complain, and freeze!).

Yikes.
This commit is contained in:
rlaphoenix 2023-02-23 16:33:16 +00:00
parent 725480adf0
commit 55da41c74f
2 changed files with 1 additions and 7 deletions

View File

@ -12,7 +12,6 @@ async def aria2c(
out: Path,
headers: Optional[dict] = None,
proxy: Optional[str] = None,
byte_range: Optional[str] = None,
silent: bool = False,
*args: str
) -> int:
@ -65,11 +64,7 @@ async def aria2c(
"-i", "-"
]
headers = headers or {}
if byte_range:
headers["Range"] = f"bytes={byte_range}"
for header, value in headers.items():
for header, value in (headers or {}).items():
if header.lower() == "accept-encoding":
# we cannot set an allowed encoding, or it will return compressed
# and the code is not set up to uncompress the data

View File

@ -460,7 +460,6 @@ class DASH:
segment_save_path,
session.headers,
proxy,
byte_range=segment_range,
silent=True
))