Only calculate DASH/HLS dl speed if dl sizes are available

This commit is contained in:
rlaphoenix 2023-03-01 09:45:20 +00:00
parent 3a98c93f03
commit 624bb6fe75
2 changed files with 2 additions and 2 deletions

View File

@ -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")

View File

@ -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")