При попытке авторизации через свой аккаунт Яндекса появляется ошибка:
Traceback (most recent call last):File "L:/1/своё/python/yandex music.py", line 5, in <module>client = ym.Client('token').init()File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 70, in wrapperresult = method(*args, **kwargs)File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 156, in initself.me = self.account_status()File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 70, in wrapperresult = method(*args, **kwargs)File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 175, in account_statusresult = self._request.get(url, *args, **kwargs)File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\utils\request.py", line 263, in getresult = self._request_wrapper(File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\utils\request.py", line 231, in _request_wrapperraise UnauthorizedError(message)yandex_music.exceptions.UnauthorizedError: {'name': 'session-expired', 'message': 'Your OAuth token is likely expired'}
Код:
import yandex_music as ymtoken = 'токен из ссылки'client = ym.Client('token').init()client.users_likes_tracks()[0].fetch_track().download('example.mp3')
При попытке авторизации через свой аккаунт Яндекса появляется ошибка:
Traceback (most recent call last):
File "L:/1/своё/python/yandex music.py", line 5, in <module>
client = ym.Client('token').init()
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 70, in wrapper
result = method(*args, **kwargs)
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 156, in init
self.me = self.account_status()
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 70, in wrapper
result = method(*args, **kwargs)
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\client.py", line 175, in account_status
result = self._request.get(url, *args, **kwargs)
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\utils\request.py", line 263, in get
result = self._request_wrapper(
File "C:\Users\1\AppData\Local\Programs\Python\Python38\lib\site-packages\yandex_music\utils\request.py", line 231, in _request_wrapper
raise UnauthorizedError(message)
yandex_music.exceptions.UnauthorizedError: {'name': 'session-expired', 'message': 'Your OAuth token is likely expired'}
Код:
import yandex_music as ym
token = 'токен из ссылки'
client = ym.Client('token').init()
client.users_likes_tracks()[0].fetch_track().download('example.mp3')