mirror of https://github.com/devine-dl/devine.git
Only calculate DASH/HLS dl speed if dl sizes are available
This commit is contained in:
parent
3a98c93f03
commit
624bb6fe75
|
@ -552,7 +552,7 @@ class DASH:
|
|||
if download_size: # no size == skipped dl
|
||||
download_sizes.append(download_size)
|
||||
|
||||
if time_since > 5 or finished_threads == len(segments):
|
||||
if download_sizes and (time_since > 5 or finished_threads == len(segments)):
|
||||
data_size = sum(download_sizes)
|
||||
download_speed = data_size / time_since
|
||||
progress(downloaded=f"DASH {filesize.decimal(download_speed)}/s")
|
||||
|
|
|
@ -392,7 +392,7 @@ class HLS:
|
|||
if download_size: # no size == skipped dl
|
||||
download_sizes.append(download_size)
|
||||
|
||||
if time_since > 5 or finished_threads == len(master.segments):
|
||||
if download_sizes and (time_since > 5 or finished_threads == len(master.segments)):
|
||||
data_size = sum(download_sizes)
|
||||
download_speed = data_size / time_since
|
||||
progress(downloaded=f"HLS {filesize.decimal(download_speed)}/s")
|
||||
|
|
Loading…
Reference in New Issue