librespot-python
librespot-python copied to clipboard
[BUG] BadCredentials
Describe the bug Login fails on some accounts on some devices. My current guess is they're doing some kind of A/B test to phase out something this relies on? Maybe the protocol version needs to be updated? Occurs not just here but also on the separate librespot-js project and librespot-java. The bug is not with some library-specific logic but with a change to Spotify- a fix here will likely also be able to be applied everywhere else.
To Reproduce
from librespot.core import Session
session = Session.Builder() \
.user_pass("username", "password") \
.create()
Expected behavior The login should be successful.
Screenshots
Traceback (most recent call last):
File "/home/hazy/tmp_a/test.py", line 7, in <module>
.create()
^^^^^^^^
File "/home/hazy/tmp_a/venv/lib/python3.12/site-packages/librespot/core.py", line 1634, in create
session.authenticate(self.login_credentials)
File "/home/hazy/tmp_a/venv/lib/python3.12/site-packages/librespot/core.py", line 939, in authenticate
self.__authenticate_partial(credential, False)
File "/home/hazy/tmp_a/venv/lib/python3.12/site-packages/librespot/core.py", line 1350, in __authenticate_partial
raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.Session.SpotifyAuthenticationException: BadCredentials
Client Information (please complete the following information):
- OS: Arch Linux
- Python Version: 3.12.4
- Library Version: Last snapshot (3b46fe560ad829b976ce63e85012cff95b1e0bf3)