Fix aria2c's segmented check for DASH/HLS

This commit is contained in:
rlaphoenix 2023-03-03 02:48:35 +00:00
parent 714e9af99a
commit a3efadf00b
3 changed files with 5 additions and 3 deletions

View File

@ -17,6 +17,7 @@ def aria2c(
headers: Optional[dict] = None, headers: Optional[dict] = None,
proxy: Optional[str] = None, proxy: Optional[str] = None,
silent: bool = False, silent: bool = False,
segmented: bool = False,
progress: Optional[partial] = None, progress: Optional[partial] = None,
*args: str *args: str
) -> int: ) -> int:
@ -27,7 +28,6 @@ def aria2c(
If multiple URLs are provided they will be downloaded in the provided order If multiple URLs are provided they will be downloaded in the provided order
to the output directory. They will not be merged together. to the output directory. They will not be merged together.
""" """
segmented = False
if isinstance(uri, list) and len(uri) == 1: if isinstance(uri, list) and len(uri) == 1:
uri = uri[0] uri = uri[0]
if isinstance(uri, list): if isinstance(uri, list):

View File

@ -471,7 +471,8 @@ class DASH:
uri=segment_uri, uri=segment_uri,
out=segment_save_path, out=segment_save_path,
headers=session.headers, headers=session.headers,
proxy=proxy proxy=proxy,
segmented=True
) )
data_size = segment_save_path.stat().st_size data_size = segment_save_path.stat().st_size

View File

@ -291,7 +291,8 @@ class HLS:
uri=segment.uri, uri=segment.uri,
out=segment_save_path, out=segment_save_path,
headers=session.headers, headers=session.headers,
proxy=proxy proxy=proxy,
segmented=True
) )
data_size = segment_save_path.stat().st_size data_size = segment_save_path.stat().st_size