mirror of
https://github.com/jpochyla/psst.git
synced 2026-04-27 07:25:52 +03:00
[GH-ISSUE #687] Error: missing field expiresIn at line 1 column 47 #389
Labels
No labels
api
bug
build
documentation
duplicate
enhancement
good first issue
help wanted
idea
invalid
linux
lowprio
macos
pull-request
upstream
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/psst#389
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 @danpilch on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/jpochyla/psst/issues/687
Describe the bug
full on crash
To Reproduce
start the app?
Expected behavior
normal operation
Screenshots
Environment
Additional context
Add any other context about the problem here.
@GravyPouch commented on GitHub (Aug 12, 2025):
Same issue
@jacksongoode commented on GitHub (Aug 12, 2025):
https://github.com/librespot-org/librespot/issues/1527
@rhaussmann commented on GitHub (Aug 12, 2025):
Same here.
commit hash:3989734
@ishammahajan commented on GitHub (Aug 12, 2025):
@jacksongoode seems that they have fixed the apparent bug in
github.com/librespot-org/librespot@ba3d501b08@arch-btw commented on GitHub (Aug 14, 2025):
I'm trying to get more familiar with the code here but I'm having some issue figuring it out.
It seems like the meta data server has changed, but the odd thing is, this new api url is already located in psst's code here:
github.com/jpochyla/psst@31861f47de/psst-gui/src/webapi/client.rs (L980)I think psst is using v2 or v1 of the api in some of the other code though, so it's probably still related.
@burakemres commented on GitHub (Aug 14, 2025):
Same issue here, anyone know how to fix it?
@jacksongoode commented on GitHub (Aug 15, 2025):
I'd be happy to review any fixes, currently a little busy now to attempt the fix :(
@daski-SNM commented on GitHub (Aug 15, 2025):
same my pc crashes wit regular Spotify hopefully the fix comes soon
@MrMati commented on GitHub (Aug 15, 2025):
The problem is much worse
github.com/jpochyla/psst@31861f47de/psst-core/src/session/access_token.rs (L44)returns error 403
{"code":4,"errorDescription":"Invalid request"}Librespot solves it with Login5 which we don't have implemented
librespot-org/librespot#1532
@VerizonLover commented on GitHub (Aug 15, 2025):
Seems to be related to #686
@jacksongoode commented on GitHub (Aug 17, 2025):
I think the keymaster stuff is also affected. My guess is that we might need to either, provide a fix that follows librespot. Or more dramatically but perhaps inevitably, use librespot as the backend.
@kingosticks commented on GitHub (Aug 18, 2025):
We are willing to help you guys transition and help provide missing/better APIs to make that easier, if you decide to go that way. Personally I think it makes sense, anything to minimise wasted effort due to Spotify messing about sounds nice, but I can appreciate it might be a big job.
@Hinkiii commented on GitHub (Aug 18, 2025):
Possibly off topic, but wouldn't migrating to librespot break the premium benefits that psst has?
@VerizonLover commented on GitHub (Aug 18, 2025):
Such as?
@VerizonLover commented on GitHub (Aug 28, 2025):
The "Show Similar Tracks" and "Show Track Credits" features:
@kingosticks commented on GitHub (Aug 28, 2025):
If they are missing in librespot, someone can add them, using the psst code as reference. Shouldn't be a big deal.
@gsaltar commented on GitHub (Aug 29, 2025):
I am experiencing the same issue.
I compiled it in freebsd. Below is the error I get.
[2025-08-29T20:59:26Z ERROR psst_gui::webapi::client] failed to read local tracks: No such file or directory (os error 2)@annethereshewent commented on GitHub (Sep 6, 2025):
also experiencing this issue.
@Tilogorn commented on GitHub (Sep 8, 2025):
Almost one month now since this software is not usable anymore. Psst is the only way to use Spotify on ARM (besides the browser UI or emulators) so I am pretty out of options for my Pi-driven hifi home equipment. I would've guessed a project with almost 10k stars is "too big to fail", but unfortunately I am wrong. Is there anything we can do on a non-technical side to support a fix?
@ewancg commented on GitHub (Sep 8, 2025):
Seems like librespot was able to fix it: https://github.com/librespot-org/librespot/releases/tag/v0.7.0
https://github.com/librespot-org/librespot/issues/1527#issuecomment-3218235159
@kingosticks commented on GitHub (Sep 8, 2025):
Yes, as mentioned in https://github.com/jpochyla/psst/issues/687#issuecomment-3191303937 someone would need to implement the login5 stuff to replace keymaster stuff. There's a complete implementation available in the librespot repository to help.
@gsaltar commented on GitHub (Sep 11, 2025):
Below is something I put together as an alternative Psst, while we wait on this bug to get fixed. The guide is for FreeBSD, but it should not be too hard to tweak it to make it work on Linux.
Spotify on FreeBSD Guide
Requirements
Install Dependencies
Some packages may be optional, but installing all ensures compatibility:
pkg install rust python cmake clang
alsa-lib alsa-plugins alsa-seq-server alsa-sndio alsa-utils
zita-alsa-pcmi
Versions may vary—adjust as needed for your system.
Compile librespot from Source
git clone https://github.com/librespot-org/librespot.git
cd librespot
cargo build --no-default-features --features "rustls-tls-native-roots rodio-backend"
Install spotify-qt
You can install via ports or build from source:
git clone https://github.com/kraxarn/spotify-qt.git
cd spotify-qt
mkdir build && cd build
cmake ..
make
./spotify-qt
First Run Setup
Done!
Enjoy Spotify on FreeBSD 🎶
@rhaussmann commented on GitHub (Sep 11, 2025):
Hey @jacksongoode and the other collabs, I wanted to thank you for your (volunteer!) work on Psst. I hardly have time to do my laundry, much less support/develop a complicated piece of software. Your donated time and expertise are appreciated.
I'm blocked from using the Spotify desktop at work, and Psst is a great workaround. It's also super light on resources. While I'm looking forward to getting back to Psst, I'm using ncspot in the meantime.
@Alex-G commented on GitHub (Sep 17, 2025):
@TrueBeastEmperor commented on GitHub (Sep 18, 2025):
Just now saw that I had the same problem. Bruh, I just now downloaded this so I'd specifically be able to have two clients running when needed. Anyway, before I saw this post, I made the same post just seconds ago
@Pogodaanton commented on GitHub (Sep 21, 2025):
I made a rudimentary port of the Login5 code found in librespot. There's a lot of jank to clean up still and we have to discuss the dependencies this pulls in. I'd appreciate any help from fellow developers 🫰
Below is a screenshot of the auth working in
psst-gui. Mind you, playback is not working yet.@jacksongoode commented on GitHub (Sep 21, 2025):
I think I've actually got something working playback and auth, I'll make a PR shortly.
@jacksongoode commented on GitHub (Sep 21, 2025):
For those following, please test out https://github.com/jpochyla/psst/pull/694 (the artifacts can be found at the bottom here to download)
Please add comments in the PR comment section if anything isn't working. You may have to re-authenticate with the new binary.
@VerizonLover commented on GitHub (Sep 22, 2025):
The download links for the artifacts don't show up anymore.
@a-chacon commented on GitHub (Sep 22, 2025):
@jacksongoode it works! I just download the artifacts from the end of the workflow that works for me.
@VerizonLover commented on GitHub (Sep 22, 2025):
Not here:
@jezzermeii commented on GitHub (Sep 22, 2025):
Works for me, all fixed! Thank you so much!!!
@Pogodaanton commented on GitHub (Sep 22, 2025):
Try scrolling to the bottom of the page linked by jackson (see bottom of below screenshot as reference)
@jummo commented on GitHub (Sep 24, 2025):
I can use it for a few hours, then I receive a http status: 401 error and need to logout and login again.
Any idea how to make the login persistent?
@jacksongoode commented on GitHub (Sep 24, 2025):
I think the latest build might resolve this? Please add comments on the PR linked above please :)
@jezzermeii commented on GitHub (Sep 24, 2025):
I'm now met with this, with your latest build. It used to show playlists and spotify radio playlists, as well as my recent music. It just shows loading icons now.
UPDATE:
It seems rolling back to the previous build doesn't fix this, except you no longer see the loading icons on the old build (21/09).
@jummo commented on GitHub (Sep 25, 2025):
Thanks for your reply.
I'm using the sha256:9f4e9a2fc85cd17424dea34e9ea8cdfe4abdb0d0f790ead1b32e29080449fcc9 version and after 1-2 hours I receive Failed to refresh token message.
@RensOliemans commented on GitHub (Sep 26, 2025):
Agreed, it's a shame that so much time is spent on dealing with Spotify's changes. One way to improve this would be to use librespot as backend, but wouldn't another way be to use Spotify's web api / OAuth? What are/were the considerations for using login5/keymaster at librespot @kingosticks? See https://github.com/jpochyla/psst/pull/694#issuecomment-3336534786, I'm personally not familiar with the context to be able to make a decision either way.
@kingosticks commented on GitHub (Sep 26, 2025):
If you want to access the public Web APIs (as I think is the specific case here in this issue), you need an access token. This token is scoped and needs refreshing etc. You can get an access token via their official OAuth flow using your own (stupidly restricted) client ID, or using Spotify's desktop app client ID. I don't think the refresh tokens expire, so if you store those you should essentially have a persistent login over restarts and no need to OAuth again.
If you want to play music outside of a web browser, you need to use Spotify's private Hermes/Mercury API. This is what their desktop applications use. Auth for that used to support user/pass, now it doesn't. Instead, you can auth using a valid access token (see above), and from there obtain a "StoredCredential" blob, which doesn't expire so can be stored and used for future Hermes logins. After this point, with the blob obtained, there's no requirement to OAuth again. At this point we ditch the session and login again but using our StoredCredential (we found that a session obtained using an access token had restricted capabilities. I can't remember if we proved the session lasted beyond the token lifetime or not). Using this API, you used to be able to use the keymaster endpoint to go the other way, and obtain an access token from your Hermes session. But keymaster is now dead/changed. Instead, we use our StoredCredential blob (and Spotify's client ID and an spclient token etc) with the login5 endpoint to obtain an access+refresh token; we refresh it as required. It's all slightly different for the mobile platforms.
Does that provide the context to answer your question?
EDIT: I expanded on re-login using StoredCredential.
@Pogodaanton commented on GitHub (Sep 29, 2025):
Thank you for the thorough explanation @kingosticks ! It helped me better understand what role login5 plays in the whole process.
I've tried to piece together the parts in the psst code base that reenact the auth flow described by you to better understand why my login5 port works. I thought I'd share it for the curious ones.
psst-gui/src/ui/preferences.rs:565The typical OAuth with callback ordeal.
psst-gui/src/ui/preferences.rs:590psst-core/src/connection/mod.rs:270Transport::authenticate(..)connects to Mercury with the access token acquired over OAuth and receives new credentials, which are in turn saved into the config/to disk. Given the credential type returned by Mercury is1, it's the "StoredCredential" blob we sought after.Note that after this procedure, the access token from the above OAuth flow is thrown away because we can get new ones with Keymaster/login5. (I assume that's what "we ditch the session and login again but using our StoredCredential" means)
psst-core/src/session/access_token.rs:35This is what psst used to do as well and which is why this issue exists. Using keymaster to obtain new access tokens came at no cost so to say, as all it did was ask Mercury, to which we have already established an authenticated connection as seen above.
Adding login5 to psst means we need new code for retrieving an spclient token and for using the login5 endpoint. However, we already have the right data (StoredCredential, Client ID) to plug into both.
@kingosticks commented on GitHub (Sep 29, 2025):
I was trying to say that we disconnect/destroy the original access-token-based session. We then create a new session using the newly acquired StoredCredential and do a fresh login using that. I wasn't sure if psst did that or not.
@ferivoq commented on GitHub (Oct 5, 2025):
has their been any progress to this?
@ewancg commented on GitHub (Oct 6, 2025):
The auth-login-fix branch provides functional streaming for now. seems like they have yet to crack the auto token refresh, so when the token expires, you will have to log out & back in
@jacksongoode commented on GitHub (Nov 17, 2025):
For those of your subscribed to this thread, a recent commit #693 has resolved this, please update and logout/login. Major thanks to @Pogodaanton for the fix!
@ernstki commented on GitHub (Nov 24, 2025):
A straightforward
git pullfollowed bycargo build --releasewas all it took for me.I was rather astonished by this. Maybe it's because I'd been using an alternative librespot-based client, and thus both clients shared cached credentials or something? Not worried about it, just happy that psst is back on its feet!
Outstanding, outstanding work @Pogodaanton and others. Please let me buy you a beer. :)