Nekmo / telegram-upload

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

telegram-download does not work on private groups/channels #245

Open ghost opened 10 months ago

ghost commented 10 months ago

Description

I am trying to download from private telegram group/channel but it gives an error. Public chats are fine though.

What I Did

command:

telegram-download -f 1796923091

traceback:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user\AppData\Roaming\Python\Python311\Scripts\telegram-download.exe\__main__.py", line 7, in <module>
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telegram_upload\exceptions.py", line 68, in wrap
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telegram_upload\management.py", line 230, in download
    download_files = messages_cls(reversed(list(messages)))
                                           ^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telegram_upload\client\telegram_download_client.py", line 30, in find_files
    for message in self.iter_messages(entity):
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telethon\requestiter.py", line 87, in __next__
    return self.client.loop.run_until_complete(self.__anext__())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telethon\requestiter.py", line 58, in __anext__
    if await self._init(**self.kwargs):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telethon\client\messages.py", line 27, in _init
    self.entity = await self.client.get_input_entity(entity)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\telethon\client\users.py", line 468, in get_input_entity
    raise ValueError(
ValueError: Could not find the input entity for PeerUser(user_id=1796923091) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.
Nideapum commented 9 months ago

I can download from URL using this https://github.com/Nekmo/telegram-upload/issues/159#issuecomment-1166413222

Nideapum commented 9 months ago

Me funciona bien en un equipo que no he actualizado nunca. Y en otro me salta este error si uso la opción (-f).

No da problema al usar el modo interactivo (-i).

He puesto la misma versión que tengo funcionando en el otro equipo, instalada usando pip, y no hay manera

telegram-upload==0.6.1
Telethon==1.24.0

También he copiado los directorios .../sites-packages/telethon y telegram-upload del equipo donde funciona y tampoco le gusta. Me aparece otro error.