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

[Solved] Can't upload any file using my invitation link #143

Closed gustavolinux closed 2 years ago

gustavolinux commented 2 years ago
gustavolinux commented 2 years ago
telegram-upload --to https://t.me/blablabla a_file.rar 

Traceback (most recent call last):
  File "/usr/local/bin/telegram-upload", line 11, in <module>
    sys.exit(upload_cli())
  File "/usr/local/lib/python3.6/dist-packages/telegram_upload/exceptions.py", line 46, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/telegram_upload/management.py", line 45, in upload
    client.send_files(to, files, delete_on_success, print_file_id, force_file, forward, caption, no_thumbnail)
  File "/usr/local/lib/python3.6/dist-packages/telegram_upload/client.py", line 84, in send_files
    progress_callback=progress, attributes=attributes)
  File "/usr/local/lib/python3.6/dist-packages/telethon/sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.6/dist-packages/telethon/client/uploads.py", line 359, in send_file
    entity = await self.get_input_entity(entity)
  File "/usr/local/lib/python3.6/dist-packages/telethon/client/users.py", line 430, in get_input_entity
    await self._get_entity_from_string(peer))
  File "/usr/local/lib/python3.6/dist-packages/telethon/client/users.py", line 568, in _get_entity_from_string
    'Cannot find any entity corresponding to "{}"'.format(string)

It works without issues if I use it to upload my files to my saved messages.

doublep21 commented 2 years ago

just use the name without the @ , so "blablabla"

gustavolinux commented 2 years ago

just use the name without the @ , so "blablabla"

but it's a channel invite link, not a contact

doublep21 commented 2 years ago

just use the name without the @ , so "blablabla"

but it's a channel invite link, not a contact i think there is a bug for the private link , for now just make the channel public and use the name

gustavolinux commented 2 years ago

just use the name without the @ , so "blablabla"

but it's a channel invite link, not a contact i think there is a bug for the private link , for now just make the channel public and use the name

Thanks that worked after setting the channel to public