Dineshkarthik / telegram_media_downloader

Download media files from a telegram conversation/chat/channel up to 2GiB per file
MIT License
2.11k stars 363 forks source link

got an unexpected keyword argument 'reverse' #467

Open berniqq opened 12 months ago

berniqq commented 12 months ago

running the latest version gives me the following error / output:


[21:11:49] Telegram Media Downloader v2.0.2,                                                                                     meta.py:18
           Copyright (C) 2019 Dineshkarthik <https://github.com/Dineshkarthik>                                                             
           Licensed under the terms of the MIT License                                                                           meta.py:21

[21:11:49] INFO     Device: CPython 3.11.2 - Telegram Media Downloader 2.0.2                                                     meta.py:22
           INFO     System: Linux 6.1.0-12-amd64 (EN)                                                                            meta.py:23
           INFO     Connecting...                                                                                          connection.py:47
           INFO     Connected! Production DC2 - IPv4                                                                       connection.py:54
           INFO     NetworkTask started                                                                                      session.py:294
           INFO     Session initialized: Layer 158                                                                           session.py:139
           INFO     Device: CPython 3.11.2 - Pyrogram 2.0.106                                                                session.py:140
           INFO     System: Linux 6.1.0-12-amd64 (en)                                                                        session.py:141
           INFO     Session started                                                                                          session.py:155
           INFO     PingTask started                                                                                         session.py:272
           INFO     Started 6 HandlerTasks                                                                                dispatcher.py:154
Traceback (most recent call last):
  File "/..../telegram_media_downloader/media_downloader.py", line 376, in <module>
    main()
  File "/..../telegram_media_downloader/media_downloader.py", line 360, in main
    updated_config = asyncio.get_event_loop().run_until_complete(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/..../telegram_media_downloader/media_downloader.py", line 313, in begin_import
    messages_iter = client.get_chat_history(
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/h....-python3-env/lib/python3.11/site-packages/pyrogram/sync.py", line 53, in async_to_sync_wrap
    coroutine = function(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GetChatHistory.get_chat_history() got an unexpected keyword argument 'reverse'

any ideas what going wrong ?

**OS:**
debian (latest)
jkowalski995 commented 11 months ago

I got a similar error. For me, removing the cloned repo and uninstalling rich and pyrogram (which I have installed manually) and then clonning repo again and make install solved the problem.

poliandro commented 9 months ago

Do not update pyrogram, latest version has removed the reverse parameter. Use the version from the requirements.

berniqq commented 9 months ago

i had pyrogram 2.0 installed right.. but installing pyrogram 1.4 gives me the following error message...

[20:05:13] Telegram Media Downloader v2.0.2, meta.py:18 Copyright (C) 2019 Dineshkarthik https://github.com/Dineshkarthik
Licensed under the terms of the MIT License meta.py:21

[20:05:13] INFO Device: CPython 3.11.2 - Telegram Media Downloader 2.0.2 meta.py:22 INFO System: Linux 6.1.0-16-amd64 (EN) meta.py:23 [20:05:14] INFO Connecting... connection.py:56 INFO Connected! Production DC2 - IPv4 - TCPAbridgedO connection.py:63 INFO NetworkTask started session.py:272 INFO Time synced: 2023-12-23 19:05:14.156179 UTC msg_id.py:45 INFO Session initialized: Layer 138 session.py:131 INFO Device: CPython 3.11.2 - Pyrogram 1.4.0 session.py:132 INFO System: Linux 6.1.0-16-amd64 (EN) session.py:133 INFO Session started session.py:148 INFO PingTask started session.py:250 INFO Started 6 HandlerTasks dispatcher.py:136 Traceback (most recent call last): File "/home/berniq/backup/ichbinhab/telegram_media_downloader/media_downloader.py", line 376, in main() File "/home/berniq/backup/ichbinhab/telegram_media_downloader/media_downloader.py", line 360, in main updated_config = asyncio.get_event_loop().run_until_complete( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/home/berniq/backup/ichbinhab/telegram_media_downloader/media_downloader.py", line 313, in begin_import messages_iter = client.get_chat_history( ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Client' object has no attribute 'get_chat_history'. Did you mean: 'get_history'?

jkowalski995 commented 9 months ago

I do not install them manually but I let installer do this via requirements.txt So, maybe this is the case?

poliandro commented 9 months ago

Probably you have multiple pyrogram versions installed. Try to remove them first and run the program again. Or try to run the program in a venv, to make sure it does not interact with other pyrogram version installed globally.