telegram-upload icon indicating copy to clipboard operation
telegram-upload copied to clipboard

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

Open kevinmay99 opened this issue 4 years ago • 3 comments

  • telegram-upload version: 0.4.0
  • Python version: Python 3.8.5
  • Operating System: Ubuntu 20.04.2 LTS
  • Dependencies list (run pip freeze):
attrs==19.3.0
Automat==0.8.0
blinker==1.4
certifi==2019.11.28
cffi==1.14.5
chardet==3.0.4
Click==7.0
cloud-init==20.4
colorama==0.4.3
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
cryptg==0.2.post2
cryptography==2.8
dbus-python==1.2.16
decorator==4.4.2
distro==1.4.0
distro-info===0.23ubuntu1
dnspython==1.16.0
entrypoints==0.3
ffmpy==0.3.0
hachoir==3.1.2
httplib2==0.14.0
hyperlink==19.0.0
idna==2.8
imageio==2.9.0
imageio-ffmpeg==0.4.3
importlib-metadata==1.5.0
incremental==16.10.1
Jinja2==2.10.1
jsonpatch==1.22
jsonpointer==2.0
jsonschema==3.2.0
keyring==18.0.1
language-selector==0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
lxml==4.6.2
MarkupSafe==1.1.0
more-itertools==4.2.0
moviepy==1.0.3
netifaces==0.10.4
numpy==1.20.1
oauthlib==3.1.0
pexpect==4.6.0
Pillow==8.1.1
proglog==0.1.9
pyaes==1.6.1
pyasn1==0.4.2
pyasn1-modules==0.2.1
pycparser==2.20
PyGObject==3.36.0
PyHamcrest==1.9.0
PyJWT==1.7.1
pymacaroons==0.13.0
pymongo==3.11.3
PyNaCl==1.3.0
pyOpenSSL==19.0.0
pyrsistent==0.15.5
pyserial==3.4
python-apt==2.0.0+ubuntu0.20.4.4
python-debian===0.1.36ubuntu1
PyYAML==5.3.1
requests==2.22.0
requests-unixsocket==0.2.0
rsa==4.7.2
SecretStorage==2.3.1
service-identity==18.1.0
simplejson==3.16.0
six==1.14.0
sos==4.0
ssh-import-id==5.10
systemd-python==234
telegram-upload==0.4.0
Telethon==1.20
tqdm==4.58.0
Twisted==18.9.0
ubuntu-advantage-tools==20.3
ufw==0.36
unattended-upgrades==0.1
urllib3==1.25.8
wadllib==1.3.3
zipp==1.0.0
zope.interface==4.7.1

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.

kevinmay99 avatar Apr 17 '21 17:04 kevinmay99

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

Nekmo avatar Apr 17 '21 23:04 Nekmo

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)

kevinmay99 avatar Apr 18 '21 03:04 kevinmay99

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.

tissole avatar Jun 03 '21 10:06 tissole

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!

wonbinbk avatar Feb 03 '23 07:02 wonbinbk

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!

Nekmo avatar Jun 14 '23 16:06 Nekmo