Skip to content

[BUG] BadCredentials #277

@hazycora

Description

@hazycora

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 (3b46fe5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions