TelegramPlayGround / pyrogram

PyroGramFORK | Telegram MTProto API framework in Python for users and bots | PyroGramFORK
https://telegramplayground.github.io/pyrogram/
GNU Lesser General Public License v3.0
53 stars 9 forks source link

FLOOD_PREMIUM_WAIT_X #30

Open fivepe opened 1 month ago

fivepe commented 1 month ago

Checklist

Description

have set client sleep_threshold=8000,still run error, Telegram says: [420 FLOOD_PREMIUM_WAIT_X] - A wait of 11 seconds is required (caused by "upload.GetFile") pyrotgfork version 2.1.32.1

Steps to reproduce

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/pyrogram/client.py", line 1017, in get_file r = await session.invoke( File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 405, in invoke return await self.send(query, timeout=timeout) File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 373, in send RPCError.raise_it(result, type(data)) File "/usr/local/lib/python3.8/dist-packages/pyrogram/errors/rpc_error.py", line 106, in raise_it raise getattr( pyrogram.errors.exceptions.flood_420.FloodPremiumWait: Telegram says: [420 FLOOD_PREMIUM_WAIT_X] - A wait of 11 seconds is required (caused by "upload.GetFile")

Code example

No response

Logs

No response

SpEcHiDe commented 1 month ago

What is the version for which this error is coming?

from pyrogram import __version__
print(__version__)
fivepe commented 1 month ago

What is the version for which this error is coming?

from pyrogram import __version__
print(__version__)

image pyrotgfork version 2.1.32.1

SpEcHiDe commented 1 month ago

Please print the version from the code instead of a standalone interpreter.

This could be another attempt at debugging your issue.

pip freeze | grep -i pyr
fivepe commented 1 month ago

请打印代码中的版本,而不是独立的解释器。

这可能是调试问题的又一次尝试。

pip freeze | grep -i pyr

~# pip freeze | grep -i pyr pyrotgfork==2.1.32.1 pyrsistent==0.15.5

hudvaska commented 1 month ago

I am also getting the same thing.I used to get this error just once every couple days but now it is happening everytime I run the program and try to download a file.

SpEcHiDe commented 1 month ago

It is not possible to get this error with the >= 2.1.32.1 version of this fork.

fivepe commented 3 weeks ago

It is not possible to get this error with the >= 2.1.32.1 version of this fork.

I have upgraded to pyrotgfork==2.1.32.7, but this error still appears suddenly occasionally. This problem occurs when downloading files, causing the downloaded files to be interrupted.

SpEcHiDe commented 3 weeks ago

Can you check after how many downloads per day does this FloodPremiumWait appear?

fivepe commented 3 weeks ago

Can you check after how many downloads per day does this FloodPremiumWait appear?

Because the log shows too much content, I cannot see the specific number of times. It may also be related to the frequency of use, but currently I can bear this situation at least 10 times a day.

SpEcHiDe commented 2 weeks ago

Please retry with pyrotgfork==2.1.32.9 and reply here if issue still persists.

fivepe commented 2 weeks ago

Please retry with pyrotgfork==2.1.32.9 and reply here if issue still persists.

the issue still persists

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/pyrogram/client.py", line 1035, in get_file r = await session.invoke( File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 421, in invoke return await self.send(query, timeout=timeout) File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 389, in send RPCError.raise_it(result, type(data)) File "/usr/local/lib/python3.8/dist-packages/pyrogram/errors/rpc_error.py", line 107, in raise_it raise getattr( pyrogram.errors.exceptions.flood_420.FloodPremiumWait: Telegram says: [420 FLOOD_PREMIUM_WAIT_X] (caused by "upload.GetFile") Pyrogram 2.1.32.9 thinks: A wait of 11 seconds is required

fivepe commented 2 weeks ago

Please retry with pyrotgfork==2.1.32.9 and reply here if issue still persists.

the issue still persists

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/pyrogram/client.py", line 1035, in get_file r = await session.invoke( File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 421, in invoke return await self.send(query, timeout=timeout) File "/usr/local/lib/python3.8/dist-packages/pyrogram/session/session.py", line 389, in send RPCError.raise_it(result, type(data)) File "/usr/local/lib/python3.8/dist-packages/pyrogram/errors/rpc_error.py", line 107, in raise_it raise getattr( pyrogram.errors.exceptions.flood_420.FloodPremiumWait: Telegram says: [420 FLOOD_PREMIUM_WAIT_X] (caused by "upload.GetFile") Pyrogram 2.1.32.9 thinks: A wait of 11 seconds is required

Refer to this https://github.com/Mayuri-Chan/pyrofork/commit/7c0481d2f0802428406e21e91a3e686436d29a19. After modification, the error disappeared.

SpEcHiDe commented 2 weeks ago

A wait of 11 seconds is required

You can set a higher value of sleep_threshold The default is only 10second. Hence it is expected that the error is raised.

fivepe commented 2 weeks ago

需要等待 11 秒

您可以将更高的值设置为“默认值仅为 10 秒”。因此,预计会引发错误。sleep_threshold

No, the client has always set sleep_threshold. The client settings are as follows,user = Client('xxx', api_id=xxx, api_hash="xxx", no_updates=True, max_concurrent_transmissions=5, sleep_threshold=86400, workers =200), this is a userbot,but I don’t know why this error still occurs. The error did not disappear until I modified the content in the client.py source file as mentioned above.

fivepe commented 2 weeks ago

FLOOD_PREMIUM_WAIT_X

And every time the FLOOD_PREMIUM_WAIT_X prompt is waiting for 8 to 16 seconds