Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got an unexpected keyword argument 'reverse' #467

Open
berniqq opened this issue Oct 10, 2023 · 5 comments
Open

got an unexpected keyword argument 'reverse' #467

berniqq opened this issue Oct 10, 2023 · 5 comments

Comments

@berniqq
Copy link

berniqq commented Oct 10, 2023

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
Copy link

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
Copy link

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

@berniqq
Copy link
Author

berniqq commented Dec 23, 2023

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
Copy link

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

@poliandro
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants