Fix progress calc when video duration is 0

fixes #146
This commit is contained in:
Ivan Habunek 2024-04-10 08:47:11 +02:00
parent bce573ef3c
commit 446b4f9f91
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D

View File

@ -127,7 +127,7 @@ class Progress:
size = last_sample.downloaded - first_sample.downloaded size = last_sample.downloaded - first_sample.downloaded
duration = last_sample.timestamp - first_sample.timestamp duration = last_sample.timestamp - first_sample.timestamp
return size / duration return size / duration if duration > 0 else None
def print(self): def print(self):
now = time.time() now = time.time()