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

vk_api.longpoll: KeyError: 'pts' #514

Open
gorinovdan opened this issue Nov 7, 2024 · 5 comments
Open

vk_api.longpoll: KeyError: 'pts' #514

gorinovdan opened this issue Nov 7, 2024 · 5 comments

Comments

@gorinovdan
Copy link

Ошибка при запуске user longpoll. Уже запущенные сессии продолжают работать.

Traceback (most recent call last):
  File "C:\Users\Asuse\Documents\Study\OtherProjects\WDB\OtherTest.py", line 97, in <module>
    longpoll = VkLongPoll(vk_session)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Asuse\Documents\Study\OtherProjects\WDB\.venv\Lib\site-packages\vk_api\longpoll.py", line 511, in __init__
    self.update_longpoll_server()
  File "C:\Users\Asuse\Documents\Study\OtherProjects\WDB\.venv\Lib\site-packages\vk_api\longpoll.py", line 535, in update_longpoll_server
    self.pts = response['pts']
               ~~~~~~~~^^^^^^^
KeyError: 'pts'

Окружение

vk_api: 11.9.9

API: default (5.92)

Пример

vk_session = vk_api.VkApi(token=TOKEN)
longpoll = VkLongPoll(vk_session)
@ShishkaDanil
Copy link

Ща законтрибьючу

@AnakhSun
Copy link

AnakhSun commented Nov 8, 2024

решение:
(pull request #515)

@python273
Copy link
Owner

pts не шлют иногда теперь или там это нужно как-то правильно обрабатывать?

@AnakhSun
Copy link

Теперь иногда не шлют

@dementidesu
Copy link

dementidesu commented Dec 4, 2024

def update_longpoll_server(self, update_ts=True):
        values = {
            'lp_version': '3',
            'need_pts': '1'
        }

так работает вроде

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

5 participants