GuillemCastro / spotify-dl

A command-line utility to download songs and playlists directly from Spotify's servers
MIT License
86 stars 11 forks source link

Auth Issues with Librespot #20

Open williammuff opened 3 weeks ago

williammuff commented 3 weeks ago

Looks like Spotify has changed the way they authenticate. Is it possible to update this package to use a credentials file opposed to passing along a username/password?

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

ubranch commented 3 weeks ago

same here

williammuff commented 3 weeks ago

I was able to generate a credentials file using librespot-auth. Basically involves you running that app and then using Spotify to connect to the fake speaker it puts on your network, it captures the login blob.

ubranch commented 2 weeks ago

I was able to generate a credentials file using librespot-auth. Basically involves you running that app and then using Spotify to connect to the fake speaker it puts on your network, it captures the login blob.

can you elaborate on that, please?

williammuff commented 2 weeks ago

I actually was able to get this working. Basically you:

  1. Use librespot-auth (cargo build -> run it on the same network as a spotify app then connect to the fake speaker it emulates). It will generate a credentials.json file.
  2. I'm on Linux so i can't speak for the "default" path for windows, but i placed this file in /root/.spotify-dl/credentials.json as well as commenting out line 15 to save the creds as it was overwriting the creds from librespot-auth.
  3. I then edited line 13 in "session.rs" in spotify-dl

I may have to reauthenticate at some point (not sure as in my case it's running daily and may refresh my token/blob), but at least it's working. Seeing how minimal the code for librespot-auth is; I'm sure it wouldn't be hard to put a feature like that into this, but unclear if this developer would want to do that.

image

michaeljohnbennett commented 1 week ago

I actually was able to get this working. Basically you:

  1. Use librespot-auth (cargo build -> run it on the same network as a spotify app then connect to the fake speaker it emulates). It will generate a credentials.json file.
  2. I'm on Linux so i can't speak for the "default" path for windows, but i placed this file in /root/.spotify-dl/credentials.json as well as commenting out line 15 to save the creds as it was overwriting the creds from librespot-auth.
  3. I then edited line 13 in "session.rs" in spotify-dl

I may have to reauthenticate at some point (not sure as in my case it's running daily and may refresh my token/blob), but at least it's working. Seeing how minimal the code for librespot-auth is; I'm sure it wouldn't be hard to put a feature like that into this, but unclear if this developer would want to do that.

image

This works perfectly for me.

If you just added the code in simply as a new flag, like I have done locally, it would solve all the problems. Just get it to save in the same location as the session file and you have a foolproof solution.