You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Опишите ошибку
Невозможно скачать аватар методом download_avatar() в классе Account Воспроизведение
Шаги для воспроизведения бага:
Создать объект client1
Вызвать метод client1.client.me.account.download_avatar('avatar.png','orig')
Увидеть ошибку
Ожидаемое поведение
Должен загрузится аватар пользователя.
Логи
Traceback (most recent call last):
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 138, in _parse
data = json.loads(decoded_s, object_hook=Request._object_hook)
File "/usr/lib/python3.8/json/init.py", line 370, in loads
return cls(**kw).decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 271, in
print(client1.client.me.account.download_avatar('avatar.png','orig'))
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/account/account.py", line 97, in download_avatar
self.client.request.download(
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 283, in download
result = self.retrieve(url, timeout=timeout, *args, *kwargs)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 267, in retrieve
return self._request_wrapper('GET', url, proxies=self.proxies, timeout=timeout, *args, **kwargs)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 189, in _request_wrapper
parse = self._parse(resp.content)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 145, in _parse
raise YandexMusicError('Invalid server response')
yandex_music.exceptions.YandexMusicError: Invalid server response Дополнительная информация
Можно заменить
self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename) на что-то типо этого
self.client.request.download(f'https://avatars.mds.yandex.net/get-yapic/27503/enc-e678a2fb49ae8b1fa2ce271d79b7a16adb049a36caed38d9381db296b6d83a8f/islands-retina-middle'
The text was updated successfully, but these errors were encountered:
Вся система с авторизацией была вынесена в отдельный сервис и SDK. Кроме получения токена для определенного приложения туда и входит менеджмент аватарок.
В первой запросе получения токена, во втором информация об аккаунт. В том числе avatar_url.
Ответ 1-го запроса:
Ответ 2-го запроса:
Не входит в рамки этой библиотеки, пока старый способ авторизации работает. Всё связанное с аватаркой профиля будет временно удалено
Опишите ошибку
Невозможно скачать аватар методом download_avatar() в классе Account
Воспроизведение
Шаги для воспроизведения бага:
Ожидаемое поведение
Должен загрузится аватар пользователя.
Логи
Traceback (most recent call last):
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 138, in _parse
data = json.loads(decoded_s, object_hook=Request._object_hook)
File "/usr/lib/python3.8/json/init.py", line 370, in loads
return cls(**kw).decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 271, in
print(client1.client.me.account.download_avatar('avatar.png','orig'))
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/account/account.py", line 97, in download_avatar
self.client.request.download(
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 283, in download
result = self.retrieve(url, timeout=timeout, *args, *kwargs)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 267, in retrieve
return self._request_wrapper('GET', url, proxies=self.proxies, timeout=timeout, *args, **kwargs)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 189, in _request_wrapper
parse = self._parse(resp.content)
File "/home/shamilu/.local/lib/python3.8/site-packages/yandex_music/utils/request.py", line 145, in _parse
raise YandexMusicError('Invalid server response')
yandex_music.exceptions.YandexMusicError: Invalid server response
Дополнительная информация
Можно заменить
self.client.request.download(f'https://upics.yandex.net/{self.uid}/{format_}', filename) на что-то типо этого
self.client.request.download(f'https://avatars.mds.yandex.net/get-yapic/27503/enc-e678a2fb49ae8b1fa2ce271d79b7a16adb049a36caed38d9381db296b6d83a8f/islands-retina-middle'
The text was updated successfully, but these errors were encountered: