mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #797] Unable to launch spotify_player after removing cache #1408
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#1408
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 @flokleiser on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/797
I am unable to launch spotify_player after i removed the ~/.cache/spotify-player folder, it prompts me to authenticate but this does not work, i suspect it might be something that is cached in my browser?
To Reproduce
Browse to: https://accounts.spotify.com/authorize?response_type=code&... etc etc
Expected behaviour
I would like to be able to use the app again, and have the authentification work the same as when i initially installed/ran the app.
Log and backtrace
backtrace is empty due to being unable to launch it,
log: 2025-08-06T16:47:46.753948Z INFO spotify_player: Configurations: Configs { app_config: AppConfig { theme: "flo", client_id: "0f9d545c5985465180cc41c73d91c053", client_id_command: None, client_port: 8080, login_redirect_uri: "http://127.0.0.1:8080/callback", player_event_hook_command: None, playback_format: "{status} {track} • {artists} {liked}\n{metadata}", playback_metadata_fields: ["repeat", "shuffle", "volume", "device"], tracks_playback_limit: 50, proxy: None, ap_port: None, app_refresh_duration_in_ms: 32, playback_refresh_duration_in_ms: 0, page_size_in_rows: 20, play_icon: "▶", pause_icon: "▌▌", liked_icon: "♥", border_type: Rounded, progress_bar_type: Line, layout: LayoutConfig { library: LibraryLayoutConfig { playlist_percent: 70, album_percent: 29 }, playback_window_position: Top, playback_window_height: 4 }, cover_img_length: 9, cover_img_width: 5, cover_img_scale: 1.0, enable_media_control: false, enable_streaming: Always, enable_cover_image_cache: true, default_device: "spotify-player", device: DeviceConfig { name: "spotify-player", device_type: "speaker", volume: 100, bitrate: 320, audio_cache: false, normalization: false, autoplay: false }, seek_duration_secs: 7, sort_artist_albums_by_type: false }, keymap_config: KeymapConfig { keymaps: [Keymap { key_sequence: KeySequence { keys: [None(Char('<'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('>'))] }, command: PreviousTrack }, Keymap { key_sequence: KeySequence { keys: [None(Char('/'))] }, command: Search }, Keymap { key_sequence: KeySequence { keys: [None(Char(' '))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [None(Char('p'))] }, command: ResumePause }, Keymap { key_sequence: KeySequence { keys: [None(Char('R'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [None(Enter)] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('l'))] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('q'))] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('V'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Esc)] }, command: ClosePopup }, Keymap { key_sequence: KeySequence { keys: [None(Char('l'))] }, command: ChooseSelected }, Keymap { key_sequence: KeySequence { keys: [None(Char('z'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [None(Char('J'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('K'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('g'))] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(Char('G'))] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('t'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('T'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('.'))] }, command: JumpToCurrentTrackInContext }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('q'))] }, command: Queue }, Keymap { key_sequence: KeySequence { keys: [None(Char('f'))] }, command: SeekForward }, Keymap { key_sequence: KeySequence { keys: [None(Char('b'))] }, command: SeekBackward }, Keymap { key_sequence: KeySequence { keys: [None(Char('h'))] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('n'))] }, command: NextTrack }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('r'))] }, command: Repeat }, Keymap { key_sequence: KeySequence { keys: [Alt(Char('r'))] }, command: ToggleFakeTrackRepeatMode }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('s'))] }, command: Shuffle }, Keymap { key_sequence: KeySequence { keys: [None(Char('+'))] }, command: VolumeChange { offset: 5 } }, Keymap { key_sequence: KeySequence { keys: [None(Char('-'))] }, command: VolumeChange { offset: -5 } }, Keymap { key_sequence: KeySequence { keys: [None(Char('_'))] }, command: Mute }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [None(Char('Z'))] }, command: AddSelectedItemToQueue }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('g'))] }, command: JumpToHighlightTrackInContext }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char(' '))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('a'))] }, command: ShowActionsOnSelectedItem }, Keymap { key_sequence: KeySequence { keys: [None(Char('a'))] }, command: ShowActionsOnCurrentTrack }, Keymap { key_sequence: KeySequence { keys: [None(Tab)] }, command: FocusNextWindow }, Keymap { key_sequence: KeySequence { keys: [None(BackTab)] }, command: FocusPreviousWindow }, Keymap { key_sequence: KeySequence { keys: [None(Char('D'))] }, command: SwitchDevice }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('p'))] }, command: BrowseUserPlaylists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('a'))] }, command: BrowseUserFollowedArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('u')), None(Char('A'))] }, command: BrowseUserSavedAlbums }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char(' '))] }, command: CurrentlyPlayingContextPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('t'))] }, command: TopTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('r'))] }, command: RecentlyPlayedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('y'))] }, command: LikedTrackPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('L'))] }, command: LyricsPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('l'))] }, command: LibraryPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('s'))] }, command: SearchPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('b'))] }, command: BrowsePage }, Keymap { key_sequence: KeySequence { keys: [None(Backspace)] }, command: PreviousPage }, Keymap { key_sequence: KeySequence { keys: [None(Char('O'))] }, command: OpenSpotifyLinkFromClipboard }, Keymap { key_sequence: KeySequence { keys: [None(Char('?'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('h'))] }, command: OpenCommandHelp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('c'))] }, command: Quit }, Keymap { key_sequence: KeySequence { keys: [None(Char('j'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('n'))] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Down)] }, command: SelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('k'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('p'))] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(Up)] }, command: SelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageUp)] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('b'))] }, command: PageSelectPreviousOrScrollUp }, Keymap { key_sequence: KeySequence { keys: [None(PageDown)] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('f'))] }, command: PageSelectNextOrScrollDown }, Keymap { key_sequence: KeySequence { keys: [None(Home)] }, command: SelectFirstOrScrollToTop }, Keymap { key_sequence: KeySequence { keys: [None(End)] }, command: SelectLastOrScrollToBottom }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('t'))] }, command: SortTrackByTitle }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('a'))] }, command: SortTrackByArtists }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('A'))] }, command: SortTrackByAlbum }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('d'))] }, command: SortTrackByDuration }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('D'))] }, command: SortTrackByAddedDate }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('r'))] }, command: ReverseTrackOrder }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('l')), None(Char('a'))] }, command: SortLibraryAlphabetically }, Keymap { key_sequence: KeySequence { keys: [None(Char('s')), None(Char('l')), None(Char('r'))] }, command: SortLibraryByRecent }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('k'))] }, command: MovePlaylistItemUp }, Keymap { key_sequence: KeySequence { keys: [Ctrl(Char('j'))] }, command: MovePlaylistItemDown }, Keymap { key_sequence: KeySequence { keys: [None(Char('N'))] }, command: CreatePlaylist }, Keymap { key_sequence: KeySequence { keys: [None(Char('g')), None(Char('c'))] }, command: JumpToCurrentTrackInContext }], actions: [] }, theme_config: ThemeConfig { themes: [Theme { name: "default", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: Blue }, cyan: Color { color: Cyan }, green: Color { color: Green }, magenta: Color { color: Magenta }, red: Color { color: Red }, white: Color { color: Gray }, yellow: Color { color: Yellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: LightRed }, bright_magenta: Color { color: LightMagenta }, bright_green: Color { color: LightGreen }, bright_cyan: Color { color: LightCyan }, bright_blue: Color { color: LightBlue }, bright_yellow: Color { color: LightYellow } }, component_style: ComponentStyle { block_title: None, border: None, playback_status: None, playback_track: None, playback_artists: None, playback_album: None, playback_metadata: None, playback_progress_bar: None, playback_progress_bar_unfilled: None, current_playing: None, page_desc: None, playlist_desc: None, table_header: None, selection: None, secondary_row: None, like: None, lyrics_played: None, lyrics_playing: None } }, Theme { name: "flo", palette: Palette { background: None, foreground: None, black: Color { color: Black }, blue: Color { color: Blue }, cyan: Color { color: Cyan }, green: Color { color: Green }, magenta: Color { color: Magenta }, red: Color { color: Red }, white: Color { color: Gray }, yellow: Color { color: Yellow }, bright_black: Color { color: DarkGray }, bright_white: Color { color: White }, bright_red: Color { color: LightRed }, bright_magenta: Color { color: LightMagenta }, bright_green: Color { color: LightGreen }, bright_cyan: Color { color: LightCyan }, bright_blue: Color { color: LightBlue }, bright_yellow: Color { color: LightYellow } }, component_style: ComponentStyle { block_title: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [] }), border: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [Bold] }), playback_status: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: None, modifiers: [Bold] }), playback_track: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [Bold] }), playback_artists: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [Bold] }), playback_album: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: None, modifiers: [] }), playback_metadata: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: None, modifiers: [] }), playback_progress_bar: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: Some(Rgb { r: 255, g: 255, b: 255 }), modifiers: [] }), playback_progress_bar_unfilled: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: Some(Rgb { r: 90, g: 93, b: 102 }), modifiers: [] }), current_playing: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [Bold] }), page_desc: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: None, modifiers: [Bold] }), playlist_desc: Some(Style { fg: Some(Rgb { r: 90, g: 93, b: 102 }), bg: None, modifiers: [] }), table_header: Some(Style { fg: Some(Rgb { r: 255, g: 255, b: 255 }), bg: None, modifiers: [] }), selection: Some(Style { fg: None, bg: Some(Rgb { r: 90, g: 93, b: 102 }), modifiers: [Bold] }), secondary_row: None, like: None, lyrics_played: None, lyrics_playing: None } }] }, cache_folder: "/Users/flo/.cache/spotify-player" }
Environment
Additional context
I do have spotify premium and it worked perfectly fine until i stupidly decided to delete the cache because of some other bug i had while trying out cava, which seemed to break it aswell, but now i cant even launch it anymore
@aome510 commented on GitHub (Aug 6, 2025):
The reason for the re-authentication is because the cached
credentialsis stored inside the cache folder. I just tried to delete it and re-authenticate. It works fine for me. Please don't change the link output on the terminal, it's the correct link.@KUHLwasStolen commented on GitHub (Aug 6, 2025):
Also can't reproduce.
I tried both
rm -r ~/.cache/spotify-player/*andrm -r ~/.cache/spotify-player/Maybe some regional issue with Spotify in relation to the latest API changes? (complete guess)
Maybe try again after #796 is resolved which seems to be connected to said changes on Spotify's side.
@flokleiser commented on GitHub (Aug 6, 2025):
i am in switzerland, so its possible its region related (?) and yes it completely makes sense that it has to re-authenticate, i did not mean to say that it shouldnt do that xd.
edit: that bug in #796 was what i experienced before i deleted the cache, yes. i still dont really understand why its giving me the INVALID_CLIENT: Invalid redirect URI when i try to re-authenticate. i will update you once #796 gets resolved, lets pray it magically fixes the authentification issue aswell xd thanks for the quick response regardless
@flokleiser commented on GitHub (Aug 6, 2025):
maybe as a follow up question, is there a way for me to manually hard-code the credentials back into the cache folder? since it did work before, there has to be some way to get it back (unfortunately i cant restore the deleted ~/.cache/spotify-player file), is there some possibility of me just hardcoding the client_id and the secret thingy for it to work again?
@aome510 commented on GitHub (Aug 6, 2025):
I doubt that the no-sound-play issue is related to the authentication issue you're facing though. I remember people reported getting illegal scope for authentication in https://github.com/aome510/spotify-player/issues/743 before.
To clarify things a bit further, the
client_idpassed to theredirect_uriduring authentication is intended to be the Spotify's officialclient_id, i.e.65b708073fc0480ea92a077233ca87bdnot theclient_idyou created from dev dashboard. That customclient_idis required and specified inapp.tomlonly when you want to use the Spotify Connect feature.Maybe you can play around with the scopes defined in
github.com/aome510/spotify-player@b92c7379b1/spotify_player/src/auth.rs (L9-L34)to see which one is responsible for the issue you're facing.I couldn't reproduce this on my end, so it's hard for me to figure out what's going on unfortunately.
There is none afaict
@flokleiser commented on GitHub (Aug 6, 2025):
regarding the scopes, is that something i should specify in my app.toml?
@KUHLwasStolen commented on GitHub (Aug 6, 2025):
No they are hard-coded in the file above.
You have to change them, build, test, repeat, until maybe something changes.
@KUHLwasStolen commented on GitHub (Aug 6, 2025):
You can also try adding those back that I removed in #792 although I don't see how they could affect spotify-player.
@flokleiser commented on GitHub (Aug 6, 2025):
oh sorry im dumb, i didnt fully see the path of the file, ill try and play around with them. i guess this issue/question really is just about why it says INVALID_CLIENT: Invalid redirect URI, and why it worked flawlessly the first time i did that when i first installed spotify_player, what could be the reason for the invalid client? im sorry that im not making much sense, i am not a computer guy and i dont know rust or anything, im just really confused why it would throw this error now. dont spend too much time on this issue, please focus on the more relevant issues/bugs first xd ill figure it out eventually
@flokleiser commented on GitHub (Aug 7, 2025):
sorry for asking again, but what exactly is spotify_player looking for in the cache folder regarding the authentication? is there a way for me to manually authenticate myself there if the browser doesnt work due to invalid client/invalid redirect URI?
@flokleiser commented on GitHub (Aug 7, 2025):
Update: dumbest fix, i happened to have ncspot installed aswell, and in the cache for ncspot i had a librespot folder with a credentials.json file, so i simply copy pasted that into spotify_players cache folder and now everything works again
@aome510 commented on GitHub (Aug 7, 2025):
Yeah, I don't really know why. The authentication workflow hasn't been changed for a long time. Glad that you found a way to make it work again tho!