KurimuzonAkuma / pyrogram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
https://pyrogram.org
GNU Lesser General Public License v3.0
358 stars 96 forks source link

FLOOD_PREMIUM_WAIT_7 #64

Closed fivepe closed 6 months ago

fivepe commented 6 months ago

Checklist

Description

have set client sleep_threshold=89000 downloading media, the program is suddenly interrupted. show FLOOD_PREMIUM_WAIT_7, and the downloaded file size is 0

Steps to reproduce

msg = await tiqu_user_app.get_messages(chat_id=msg.chat.id, message_ids=msg.id) file = await tiqu_user_app.download_media(msg, file_name=filename_temp, progress=progress, progress_args=(download_msg, f"{len(msgs)}-{i+1}",))

the message is belong to media_group.

Code example

No response

Logs

Telegram says: [420 Flood] - [420 FLOOD_PREMIUM_WAIT_7] (caused by "upload.GetFile")
Traceback (most recent call last):
  File "my_bot.py", line 1899, in get_muilt_msg
    raise ChatForwardsRestricted
pyrogram.errors.exceptions.bad_request_400.ChatForwardsRestricted: Telegram says: [400 CHAT_FORWARDS_RESTRICTED] - The chat restricts forwarding content 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/client.py", line 1007, in get_file
    r = await session.invoke(
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 399, in invoke
    return await self.send(query, timeout=timeout)
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 367, in send
    RPCError.raise_it(result, type(data))
  File "/usr/local/lib/python3.8/dist-packages/pyrogram/errors/rpc_error.py", line 80, in raise_it
    raise getattr(
pyrogram.errors.exceptions.flood_420.Flood: Telegram says: [420 Flood] - [420 FLOOD_PREMIUM_WAIT_7] (caused by "upload.GetFile")