-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FloodWait Exception handling #1306
Comments
I found a solution after wasting many days. lets say you have 1000 files to download. sort all the files by |
In my function i walk through get_chat_history and this is sorted by date. Than i call download_media if the message media is MessageMediaType.PHOTO. |
I do not see Pyrogram Is this raising an error supported for this call? |
Better to use search_messages with photo filter. Also you can try this PR: #1313 |
I am trying to catch the exception using VS Code: |
The reason this error handling doesn't work is because the exception is trapped and logged within https://github.com/pyrogram/pyrogram/blob/master/pyrogram/client.py#L1020-L1021
The code should either re-throw the exception or return some details so that we can act on it. |
This was fixed in #1313, thanks @KurimuzonAkuma Works in this fork: |
Thanks for the update. Doesnt the link above need a |
Checklist
pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip
and reproduced the issue using the latest development versionDescription
For a download script i try to respect the telegram rate limits as documented here. This does not work cause my FloodWait exception is never reached.
Steps to reproduce
Call download_media in a loop for more than 200 files to download. Check if the exception get catched with a log and sleep the amount of time from FloodWait value.
Code example
Logs
The text was updated successfully, but these errors were encountered: