Saturday, April 2, 2022

Solve FloodWaitError in Telegram Export Group Python Script

Your export group python script was working fine but recently you tried to export members of one of your public group and it is showing following error.

telethon.errors.common.MultiError: ([None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)')
Solution :

You need to make one change in your export script.

Remove 

aggressive=True

from the line

all_participants = client.get_participants(target_group, aggressive=True)

Above line should be appeared like this

all_participants = client.get_participants(target_group)

and you will not get the following FloodWaitError anymore.

Traceback (most recent call last):
  File "exportgroup.py", line 49, in <module>
    all_participants = client.get_participants(target_group, aggressive=True)
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/client/chats.py", line 503, in get_participants
    return await self.iter_participants(*args, **kwargs).collect()
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/requestiter.py", line 113, in collect
    async for message in self:
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/requestiter.py", line 74, in __anext__
    if await self._load_next_chunk():
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/client/chats.py", line 221, in _load_next_chunk
    results = await self.client(self.requests)
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "virtualenvs/telegram/lib/python3.8/site-packages/telethon/client/users.py", line 75, in _call
    raise MultiError(exceptions, results, requests)
telethon.errors.common.MultiError: ([None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)')

 

To see the steps :

 



No comments:

Post a Comment