zotify-dev / zotify

A fast and customizable music and podcast downloader.
zlib License
1.03k stars 79 forks source link

BadCredentials #181

Open 11plustwo opened 3 weeks ago

11plustwo commented 3 weeks ago

I'm getting "BadCredentials" error when I try to use Zotify.

FYI, there is an existing ticket for this issue but it is closed and I'm unsure if the devs get notified about closed tickets. The existing ticket is https://github.com/zotify-dev/zotify/issues/167

I tried on mac and Windows.

macOS Ventura 13.6.9:

asdf@asdf-iMac ~ % zotify "https://open.spotify.com/playlist/12345" --download-lyrics=false --download-format=mp3 --download-quality=high Username: XXXXXXXXXX@gmail.com Password: *** Traceback (most recent call last): File "/Users/jeremy/.local/bin/zotify", line 8, in sys.exit(main()) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/zotify/main.py", line 64, in main args.func(args) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/zotify/app.py", line 21, in client Zotify(args) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/zotify/zotify.py", line 21, in init Zotify.login(args) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/zotify/zotify.py", line 46, in login cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create() File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/librespot/core.py", line 1634, in create session.authenticate(self.login_credentials) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/librespot/core.py", line 939, in authenticate self.__authenticate_partial(credential, False) File "/Users/jeremy/.local/pipx/venvs/zotify/lib/python3.9/site-packages/librespot/core.py", line 1350, in __authenticate_partial raise Session.SpotifyAuthenticationException(ap_login_failed) librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Windows 10 Pro 10.0.19045 Build 19045:

C:\Users\asdf>zotify "https://open.spotify.com/playlist/12345" --download-lyrics=false --download-format=mp3 --download-quality=high Username: XXXXXXXXXX@gmail.com Password: ***** Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Scripts\zotify.exe__main.py", line 7, in File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\zotify__main.py", line 64, in main args.func(args) File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\zotify\app.py", line 21, in client Zotify(args) File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\zotify\zotify.py", line 21, in init__ Zotify.login(args) File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\zotify\zotify.py", line 46, in login cls.SESSION = Session.Builder(conf).user_pass(user_name, password).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\librespot\core.py", line 1634, in create session.authenticate(self.login_credentials) File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\librespot\core.py", line 939, in authenticate self.authenticate_partial(credential, False) File "C:\Users\asdf\AppData\Local\Programs\Python\Python312\Lib\site-packages\librespot\core.py", line 1350, in __authenticate_partial raise Session.SpotifyAuthenticationException(ap_login_failed) librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Thorneyyyy commented 3 weeks ago

Having the same error on Debian 13.2.0

rkmfl commented 3 weeks ago

Same error despite immediately authenticating using the same credentials via the Spotify website.

Also accessing natively from a static IP in the U.S. where I've always used the service from.

No reason for some of the known issues; this is a new issue with Spotify/Zotify

Error: librespot.core.Session.SpotifyAuthenticationException: BadCredentials

Glaedr304 commented 3 weeks ago

https://github.com/librespot-org/librespot/issues/1308#issuecomment-2276196094

I suspect this is because spotify changed how users authenticate.

akcharlie24 commented 3 weeks ago

librespot-org/librespot#1308 (comment)

I suspect this is because spotify changed how users authenticate.

what is the possible fix to this ?

Glaedr304 commented 3 weeks ago

I am going to wait until the dev pushes an update, but if you are asking me how I think that should be implemented, I unfortunately have no idea.

TheLastZombie commented 3 weeks ago

Duplicate of #174; see this comment for a workaround.

MarvAmBass commented 1 week ago

how to authenticate using the new oauth way:

install git, rust and cargo, download the following branch of librespot https://github.com/kingosticks/librespot/tree/credentials_with_access_token

run branch using:

cargo run --no-default-features -- --cache . --token ""

you'll need to open a link and let it redirect to the local librespot webservice.

if everything went well you end up with a credentials.json in the directory, which looks like this:

{
  "username": "QWERQWERQWERQWER",
  "auth_type": 1,
  "auth_data": "ASDFASDFASDF"
}

change it to look like the follwing:

{
  "username": "QWERQWERQWERQWER",
  "type": "AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS",
  "credentials": "ASDFASDFASDF"
}

and you're done - don't forget to refrence the credentials.json in you zotify/config.json

elidoz commented 1 week ago

I have a problem with this, when I run the command

cargo run --no-default-features -- --cache . --token ""

I get a bunch of warnings, and after that the credentials.json file is not created, it doesn't open any link on my internet browser, and I get this output

Error parsing command line options: Unrecognized option: 'token'

librespot 0.4.2 9d96efa (Built on 2024-09-08, Build ID: Bl43N9iw, Profile: debug)

An open source client library for Spotify, with support for Spotify Connect

https://github.com/librespot-org/librespot

I'm not sure I understand the part about the local librespot webservice, is it something more I have to set up?