-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add zeroconf auth for spotify #55
base: main
Are you sure you want to change the base?
Conversation
I tested this PR by building from source on my Windows box and running the binary on the same host my Spotify client was running. It works! If we want to retain auth to Spotify between bot restarts, then we need to save the encrypted blob to disk (e.g. https://github.com/codetheweb/aoede/pull/55/files#diff-b072d44757027067e88a4e0972075dd9bcf9bcc9fb44dc1c28b9b84f8e7b1e03R252). Although, to reauth all you need to do is select the device in the Spotify app, so saving the blob isn't really necessary. Still needs to be tested from Docker. |
I've now successfully tested via Docker running on a ProxMox Alpine LXC within the same network segment as my Windows box running the Spotify client. I needed to add I've captured logs after setting RUST_LOG=debug, for posterity: aeode-local.log |
I built this from source and I can get the bot to join, but the audio is extremely slow and choppy. Also I can't seem to get the bot to show up in the devices list when it running on a server outside of the local network. Anyway I can help debug? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! the playback is also choppy for me, although maybe it's just a temporary issue with my wifi
let credentials = discovery.next().await.expect("Failed to get credentials"); | ||
|
||
// Save the encrypted blob for future use | ||
config.spotify_encrypted_blob = credentials.auth_data.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we save this to a new separate file?
Co-authored-by: Max Isom <[email protected]>
Co-authored-by: Max Isom <[email protected]>
I'm able to repro the choppy playback over the network. I'm puzzled as to why - I didn't modify the audio processing and my network is running over 2.5 gig lines. Will spend some time debugging later this week |
Something about the audio I noticed that might be relevant is that it sounds more like the audio is being played at a slow speed and multiple times overlapping. So I think the issue might actually have something to do with performance inside the container and not network, potentially due to the stream getting played multiple times simultaneously. |
While running this branch on my machine (Docker on Windows), I noticed that even though the user and password have been removed, they are still required in the environment. Without these variables, the container doesn't initialize properly. |
That is exactly how I'd describe it, I gave it it a shot myself and encountered this, so despite the credentials change of this PR working, the audio itself is completely unusable in the current state. |
As described in librespot-org/librespot#1308 (comment), Spotify has deprecated basic authentication for apps via username/password. Specifically, as of version 3.203.235 of the Spotify eSDK, the SpConnectionLoginPassword API has been removed.
This PR adds support for Spotify's zeroconf authentication via librespot, and updates the ReadMe with instructions.
Resolves #54.