mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1628] Authenticate on startup? #743
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pmpinto on GitHub (Nov 8, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1628
I have been trying to set up
spotify-player, which apparently useslibrespotin the background and I wasn't able to get audio playing from the terminal window. Speakers work. Audio works. Spotify works in the official client for Linux or the phone. But getting spotify player in the terminal to actually output sound isn't working.So I then tried to set up and run
librespotmyself.I hear a "pff" sound when doing this, which tells me something is working.
But at this point:
spotify-playerhowever, does not see it;Only after I select Omarchy from my phone, is spotify player able to see it and list it as a device option.
When that happens, I'm able to select it, and the sound works!
This is the output after the previous one:
So, I wanted to check if there's a way to achieve the workflow I had in mind:
librespotin the background;spotify-playerin the foregroung;librespot;Is this possible?
And yes, I'm aware
spotify-playerrunslibrespotbut it's failing to output any audio in the first place. Not sure why. Tried plenty of stuff, incluing building my own build from the repo.@photovoltex commented on GitHub (Nov 8, 2025):
Did you try to reach out to the devs of spotify-player, yet? I think you shouldn't try to workaround, if it's not totally necessary, and rather resolve your issue with the devs of the software you are trying to use.
Btw. since around four days the latest published version of librespot can't play any tracks anymore. That's because of some changes on spotifys end. We did resolve it in our dev build but there isn't any published version yet, so build
spotify-playerwith librespot as git dependency could also resolve your issue. And it seems this issue is what you are looking for https://github.com/aome510/spotify-player/issues/864.@pmpinto commented on GitHub (Nov 10, 2025):
No I haven't. I had to start somewhere, and since spotify player uses librespot in the background as the backend I figured it would be related to librespot more than spotify player itself. But I could be wrong.
Ok. A few things pop in my head.
Although that's good to know, I had been able to play songs through librespot with the workflow I mentioned above, although not ideal.
And although I did face the "skipping songs" issue as well, I wonder if before this whole issue appeared, the workflow I'm trying to achieve would be feasable in the first place—can you confirm this?
Thanks!
@photovoltex commented on GitHub (Nov 10, 2025):
Your description is to vague to answer fully. So what I can answer:
@pmpinto commented on GitHub (Nov 10, 2025):
Looks like you are focusing on automating these tasks and that's not at all what I'm struggling with. Let's just assume I'm doing everything manually.
The issue I'm currently facing with that workflow—and again, I don't know whether or not this may have been caused by the issue you mentioned above—is the fact that the Spotify Connect device that librepsot enables/creates is passive and thus not available within spotify player.
It only becomes active when I select it from my phone's app, for instance. Which is when the auth happens in the logs:
I was hoping there was a way for this auth to happen at the same time the Spotify Connect device is created by librespot.
I'm just not sure whether this is a librespot limitation, Spotify's API limitation, spotify player limitation or whatever it may be.
@photovoltex commented on GitHub (Nov 10, 2025):
Oh... Providing more context what you are trying to achieve and where you are coming from helps a lot. You are searching for the
--cache <directory where to save the cache>option which caches your credentials and some more info.In combination with
--enable-oauthyou can also authenticate without a separate device. But authentication is only required at the beginning, afterwards it will use from the cache if applicable.@pmpinto commented on GitHub (Nov 10, 2025):
I'm glad we could reach common ground.
And indeed, following your suggestions does make it work!
If I understand this correctly, providing a
--cachedirectory allows librespot to fetch the credentials on startup. Effectively completing the necessary handshake for a Spotify Connect device to become active without any further human intervention.I was just failing to connect "authentication" and "cache" in my head.
Thanks for your time @photovoltex !