K
K
Kir Mozor2021-09-25 20:34:43
Python
Kir Mozor, 2021-09-25 20:34:43

Audio not downloading in Pyrogram?

I'm trying to download an audio file by file_id via pyrogram
But because of the fig Internet, Timeout Error constantly pops up and the audio starts downloading again
How to make the audio download from the same place where it stopped?
See code

file_id = message.audio.file_id
def progress(current, total):
    print(f"{current * 100 / total:.1f}%")

#print(app.download_media(file_id, progress=progress))
while(True):
    download = message.download(file_id, progress=progress)
     if download == "100.0%":
         print("Завершение скачивания")
         break

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question