Richard Borcsik
commited on
Commit
·
1711abb
1
Parent(s):
48f367d
Update comments
Browse files- pytube/utils.py +8 -0
pytube/utils.py
CHANGED
@@ -28,6 +28,14 @@ def safe_filename(text, max_length=200):
|
|
28 |
|
29 |
|
30 |
def print_status(progress, file_size):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
percent = progress * 100. / file_size
|
32 |
status = r"%10d [%3.2f%%]" % (progress, percent)
|
33 |
status = status + chr(8) * (len(status) + 1)
|
|
|
28 |
|
29 |
|
30 |
def print_status(progress, file_size):
|
31 |
+
"""
|
32 |
+
This function - when passed as `on_progress` to `Video.download` - prints
|
33 |
+
out the current download progress.
|
34 |
+
|
35 |
+
Arguments:
|
36 |
+
progress -- The lenght of the currently downloaded bytes.
|
37 |
+
file_size -- The total size of the video.
|
38 |
+
"""
|
39 |
percent = progress * 100. / file_size
|
40 |
status = r"%10d [%3.2f%%]" % (progress, percent)
|
41 |
status = status + chr(8) * (len(status) + 1)
|