Enrique Fernandez
commited on
Commit
·
f709dd0
1
Parent(s):
55c1f36
Fix division by zero
Browse files- pytube/utils.py +5 -3
pytube/utils.py
CHANGED
@@ -79,7 +79,9 @@ def print_status(progress, file_size, start):
|
|
79 |
|
80 |
percentDone = int(progress) * 100. / file_size
|
81 |
done = int(50 * progress / int(file_size))
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
85 |
stdout.flush()
|
|
|
79 |
|
80 |
percentDone = int(progress) * 100. / file_size
|
81 |
done = int(50 * progress / int(file_size))
|
82 |
+
dt = (clock() - start)
|
83 |
+
if dt > 0:
|
84 |
+
stdout.write("\r [%s%s][%3.2f%%] %s at %s/s\r " %
|
85 |
+
('=' * done, ' ' * (50 - done), percentDone, sizeof(file_size),
|
86 |
+
sizeof(progress // dt)))
|
87 |
stdout.flush()
|