From a3efadf00b16e914c11bb9eae19e95dcfe7a0bd0 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 3 Mar 2023 02:48:35 +0000 Subject: [PATCH] Fix aria2c's segmented check for DASH/HLS --- devine/core/downloaders/aria2c.py | 2 +- devine/core/manifests/dash.py | 3 ++- devine/core/manifests/hls.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/devine/core/downloaders/aria2c.py b/devine/core/downloaders/aria2c.py index 2caec7f..2cb735f 100644 --- a/devine/core/downloaders/aria2c.py +++ b/devine/core/downloaders/aria2c.py @@ -17,6 +17,7 @@ def aria2c( headers: Optional[dict] = None, proxy: Optional[str] = None, silent: bool = False, + segmented: bool = False, progress: Optional[partial] = None, *args: str ) -> int: @@ -27,7 +28,6 @@ def aria2c( If multiple URLs are provided they will be downloaded in the provided order to the output directory. They will not be merged together. """ - segmented = False if isinstance(uri, list) and len(uri) == 1: uri = uri[0] if isinstance(uri, list): diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index b552d99..23396e9 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -471,7 +471,8 @@ class DASH: uri=segment_uri, out=segment_save_path, headers=session.headers, - proxy=proxy + proxy=proxy, + segmented=True ) data_size = segment_save_path.stat().st_size diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index dfb2da0..902955d 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -291,7 +291,8 @@ class HLS: uri=segment.uri, out=segment_save_path, headers=session.headers, - proxy=proxy + proxy=proxy, + segmented=True ) data_size = segment_save_path.stat().st_size