python273 / vk_api

Модуль для создания скриптов для ВКонтакте | vk.com API wrapper
https://pypi.org/project/vk-api/
Apache License 2.0
1.33k stars 322 forks source link

Ошибка при авторизации #415

Closed through-your-tears closed 3 years ago

through-your-tears commented 3 years ago

Вылазит ошибка при авторизации аккаунта

Traceback (most recent call last):
  File "C:\Users\Dmitri\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "C:/Users/Dmitri/PycharmProjects/vk-music-desktop/script.py", line 8, in login_on_click
    vk = connect(login, password)
  File "C:\Users\Dmitri\PycharmProjects\vk-music-desktop\my_requests.py", line 10, in connect
    vk_session.auth(token_only=True)
  File "C:\Users\Dmitri\AppData\Local\Programs\Python\Python38-32\lib\site-packages\vk_api\vk_api.py", line 175, in auth
    self._auth_token(reauth=reauth)
  File "C:\Users\Dmitri\AppData\Local\Programs\Python\Python38-32\lib\site-packages\vk_api\vk_api.py", line 223, in _auth_token
    self._api_login()
  File "C:\Users\Dmitri\AppData\Local\Programs\Python\Python38-32\lib\site-packages\vk_api\vk_api.py", line 439, in _api_login
    params = response.url.split('#', 1)[1].split('&')
IndexError: list index out of range

Окружение

vk_api: 11.9.4

API: вставить версию

Пример

def connect(login=None, password=None):
    vk_session = vk_api.VkApi(login, password)
    try:
        vk_session.auth(token_only=True)
    except vk_api.AuthError as error_msg:
        print(error_msg)
    return vk_session
python273 commented 3 years ago

params = response.url.split('#', 1)[1].split('&')

Такого кода нет в 11.9.4, нужно обновить библиотеку