mirror of https://github.com/devine-dl/devine.git
refactor: Warn falling back to requests as aria2c doesn't support Range
This commit is contained in:
parent
5ef95e942a
commit
f08402d795
|
@ -472,6 +472,7 @@ class DASH:
|
||||||
if downloader.__name__ == "aria2c" and any(bytes_range is not None for url, bytes_range in segments):
|
if downloader.__name__ == "aria2c" and any(bytes_range is not None for url, bytes_range in segments):
|
||||||
# aria2(c) is shit and doesn't support the Range header, fallback to the requests downloader
|
# aria2(c) is shit and doesn't support the Range header, fallback to the requests downloader
|
||||||
downloader = requests_downloader
|
downloader = requests_downloader
|
||||||
|
log.warning("Falling back to the requests downloader as aria2(c) doesn't support the Range header")
|
||||||
|
|
||||||
for status_update in downloader(
|
for status_update in downloader(
|
||||||
urls=[
|
urls=[
|
||||||
|
|
|
@ -254,6 +254,12 @@ class HLS:
|
||||||
progress(total=total_segments)
|
progress(total=total_segments)
|
||||||
|
|
||||||
downloader = track.downloader
|
downloader = track.downloader
|
||||||
|
if (
|
||||||
|
downloader.__name__ == "aria2c" and
|
||||||
|
any(x.byterange for x in master.segments if x not in unwanted_segments)
|
||||||
|
):
|
||||||
|
downloader = requests_downloader
|
||||||
|
log.warning("Falling back to the requests downloader as aria2(c) doesn't support the Range header")
|
||||||
|
|
||||||
urls: list[dict[str, Any]] = []
|
urls: list[dict[str, Any]] = []
|
||||||
segment_durations: list[int] = []
|
segment_durations: list[int] = []
|
||||||
|
@ -266,9 +272,6 @@ class HLS:
|
||||||
segment_durations.append(int(segment.duration))
|
segment_durations.append(int(segment.duration))
|
||||||
|
|
||||||
if segment.byterange:
|
if segment.byterange:
|
||||||
if downloader.__name__ == "aria2c":
|
|
||||||
# aria2(c) is shit and doesn't support the Range header, fallback to the requests downloader
|
|
||||||
downloader = requests_downloader
|
|
||||||
byte_range = HLS.calculate_byte_range(segment.byterange, range_offset)
|
byte_range = HLS.calculate_byte_range(segment.byterange, range_offset)
|
||||||
range_offset = byte_range.split("-")[0]
|
range_offset = byte_range.split("-")[0]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue