From 55da41c74fe24f66e0351bd3b1ea840a120c9987 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Thu, 23 Feb 2023 16:33:16 +0000 Subject: [PATCH] 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. --- devine/core/downloaders/aria2c.py | 7 +------ devine/core/manifests/dash.py | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index ec3cacc..3efbe52 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -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 diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index f4cd1d1..40f09d0 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -460,7 +460,6 @@ class DASH: segment_save_path, session.headers, proxy, - byte_range=segment_range, silent=True ))