Nekmo / telegram-upload

Upload and download files from Telegram up to 4 GiB using your account
MIT License
1.09k stars 237 forks source link

telethon.errors.rpcerrorlist.FloodWaitError: A wait of 819 seconds is required (caused by CheckChatInviteRequest) #111

Closed kevinmay99 closed 1 year ago

kevinmay99 commented 3 years ago

Description

I used this program to upload some video files from my VPS. At first, it worked very well, but after a while, this error appeared, and then I needed to wait for some time to continue uploading. Then keep repeating this process.

Traceback (most recent call last):
  File "/usr/local/bin/telegram-upload", line 8, in <module>
    sys.exit(upload_cli())
  File "/usr/local/lib/python3.7/site-packages/telegram_upload/exceptions.py", line 50, in wrap
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/telegram_upload/management.py", line 101, in upload
    client.send_files(to, files, delete_on_success, print_file_id, force_file, forward, caption, thumbnail)
  File "/usr/local/lib/python3.7/site-packages/telegram_upload/client.py", line 142, in send_files
    progress_callback=progress, attributes=attributes)
  File "/usr/local/lib/python3.7/site-packages/telethon/sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/site-packages/telethon/client/uploads.py", line 329, in send_file
    entity = await self.get_input_entity(entity)
  File "/usr/local/lib/python3.7/site-packages/telethon/client/users.py", line 432, in get_input_entity
    await self._get_entity_from_string(peer))
  File "/usr/local/lib/python3.7/site-packages/telethon/client/users.py", line 537, in _get_entity_from_string
    functions.messages.CheckChatInviteRequest(username))
  File "/usr/local/lib/python3.7/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "/usr/local/lib/python3.7/site-packages/telethon/client/users.py", line 79, in _call
    result = await future
telethon.errors.rpcerrorlist.FloodWaitError: A wait of 1408 seconds is required (caused by CheckChatInviteRequest)

What I Did

I find https://docs.telethon.dev/en/latest/concepts/errors.html#common-errors, still don't know how to solve the problem.

Nekmo commented 3 years ago

Hi, I can add a wait for the error, but I don't think I can skip the wait.

kevinmay99 commented 3 years ago

Hi, do you know what cause the wait? It seems that my VPS in US works better than VPS in japan. Is there anyway to change to another account automaticly to continue uploading while a account need to wait? (accounts are in the same group)

tissole commented 3 years ago

A similar error I encountered too when I tried to upload to my channel using the invite link. There were no problems when I uploaded using the channel username. Telegram thinks that files uploaded using the invite links are members added to a channel and the temporary bans happen because Telegram imposes some limits on how many members can be added in a given timeframe. That's why it's better to use the username for public channels/groups and IDs for private ones.

wonbinbk commented 1 year ago

Is it possible to specified a channel id instead of a URL in case of a private channel? I also met this error. Although I have to say I use find together with telegram-upload to only process a specific file type, so I can't use the --directory option.

Currently I can work around this by temporarily switching the channel to public, use its name instead but this is not optimal.

Appreciate the tool though, works excellent!

Nekmo commented 1 year ago

Is it possible to specified a channel id instead of a URL in case of a private channel? I also met this error. Although I have to say I use find together with telegram-upload to only process a specific file type, so I can't use the --directory option.

Currently I can work around this by temporarily switching the channel to public, use its name instead but this is not optimal.

Appreciate the tool though, works excellent!

Hi, there are other issues similar to what you mention like #160. This incident is about another matter. Please use the correct issue or create a new issues.

Thanks!