kokarare1212/librespot-python

[BUG]Recently I got a SpotifyAuthenticationException: PremiumAccountRequired

HendrikV37 opened this issue · 2 comments

Describe the bug
During logging this was reported:
File "/home/pi/Oradio_new/spotify_music_player_service.py", line 169, in connect
self.session = Session.Builder().stored_file().create()
File "/usr/local/lib/python3.9/dist-packages/librespot/core.py", line 1275, in create
session.authenticate(self.login_credentials)
File "/usr/local/lib/python3.9/dist-packages/librespot/core.py", line 697, in authenticate
self.__authenticate_partial(credential, False)
File "/usr/local/lib/python3.9/dist-packages/librespot/core.py", line 1055, in __authenticate_partial
raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.SpotifyAuthenticationException: PremiumAccountRequired

To Reproduce
Expected behavior
The librespot package was running for several month without any issues like this

Screenshots
If applicable, add screenshots to help explain your problem.

Client Information (please complete the following information):

  • Linux on RaspberryPi
  • Python Version [e.g. 3.9.0]

Additional context
The same issue was reported at librespot-org/librespot-java#614
The solution was to update the protocol version of the spotify client.
I did same thing in the spotify python code:
def standard_build_info() -> BuildInfo:
return BuildInfo(product=Product.PRODUCT_CLIENT,
product_flags=[ProductFlags.PRODUCT_FLAG_NONE],
platform=Version.platform(),
#version=112800721)
version=117300517)
...AND now it works again. Maybe something to include in the code.

duplicate #193

OK, now i see there is already an update. I will update my package with new version.
Thanks