mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Add missing download_media progress example
This commit is contained in:
parent
746a6eb477
commit
42cd135009
@ -99,6 +99,12 @@ class DownloadMedia(BaseClient):
|
|||||||
|
|
||||||
# Download from file id
|
# Download from file id
|
||||||
app.download_media("CAADBAADyg4AAvLQYAEYD4F7vcZ43AI")
|
app.download_media("CAADBAADyg4AAvLQYAEYD4F7vcZ43AI")
|
||||||
|
|
||||||
|
# Keep track of the progress while downloading
|
||||||
|
def progress(current, total):
|
||||||
|
print("{:.1f}%".format(current * 100 / total))
|
||||||
|
|
||||||
|
app.download_media(message, progress=progress)
|
||||||
"""
|
"""
|
||||||
error_message = "This message doesn't contain any downloadable media"
|
error_message = "This message doesn't contain any downloadable media"
|
||||||
available_media = ("audio", "document", "photo", "sticker", "animation", "video", "voice", "video_note")
|
available_media = ("audio", "document", "photo", "sticker", "animation", "video", "voice", "video_note")
|
||||||
|
Loading…
Reference in New Issue
Block a user