mirror of https://github.com/devine-dl/devine.git
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:
parent
725480adf0
commit
55da41c74f
|
@ -12,7 +12,6 @@ async def aria2c(
|
||||||
out: Path,
|
out: Path,
|
||||||
headers: Optional[dict] = None,
|
headers: Optional[dict] = None,
|
||||||
proxy: Optional[str] = None,
|
proxy: Optional[str] = None,
|
||||||
byte_range: Optional[str] = None,
|
|
||||||
silent: bool = False,
|
silent: bool = False,
|
||||||
*args: str
|
*args: str
|
||||||
) -> int:
|
) -> int:
|
||||||
|
@ -65,11 +64,7 @@ async def aria2c(
|
||||||
"-i", "-"
|
"-i", "-"
|
||||||
]
|
]
|
||||||
|
|
||||||
headers = headers or {}
|
for header, value in (headers or {}).items():
|
||||||
if byte_range:
|
|
||||||
headers["Range"] = f"bytes={byte_range}"
|
|
||||||
|
|
||||||
for header, value in headers.items():
|
|
||||||
if header.lower() == "accept-encoding":
|
if header.lower() == "accept-encoding":
|
||||||
# we cannot set an allowed encoding, or it will return compressed
|
# we cannot set an allowed encoding, or it will return compressed
|
||||||
# and the code is not set up to uncompress the data
|
# and the code is not set up to uncompress the data
|
||||||
|
|
|
@ -460,7 +460,6 @@ class DASH:
|
||||||
segment_save_path,
|
segment_save_path,
|
||||||
session.headers,
|
session.headers,
|
||||||
proxy,
|
proxy,
|
||||||
byte_range=segment_range,
|
|
||||||
silent=True
|
silent=True
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue