[GH-ISSUE #864] Tracks skipping without playing #521

Closed
opened 2026-03-02 23:48:16 +03:00 by kerem · 40 comments
Owner

Originally created by @arch-btw on GitHub (Nov 6, 2025).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/864

Describe the bug
Tracks are skipping without playing

To Reproduce
When I play a track that isn't cached then it won't play

Expected behaviour
For it to play music

Log and backtrace

2025-11-06T1606:59.417381Z ERROR librespot_playback::player: Track should be available, but no alternatives found.
2025-11-06T1606:59.417425Z  WARN librespot_playback::player: <spotify:track:*********************> is not available
2025-11-06T1606:59.417507Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: ()
2025-11-06T1606:59.422406Z ERROR librespot_playback::player: Track should be available, but no alternatives found.
2025-11-06T1606:59.422435Z  WARN librespot_playback::player: <spotify:track:*********************> is not available
2025-11-06T1606:59.834362Z  INFO client_request{request=Player(StartPlayback(Context(Playlist(PlaylistId("*********************")), Some(Uri("spotify:track:*********************"))), None))}: spotify_player::client: Successfully handled the client request, took: 1453ms
2025-11-06T1607:00.087064Z  INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 358ms
2025-11-06T1607:00.122521Z ERROR librespot_playback::player: Track should be available, but no alternatives found.
2025-11-06T1607:00.122562Z  WARN librespot_playback::player: <spotify:track:*********************> is not available
2025-11-06T1607:00.122609Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: ()
2025-11-06T1607:00.726131Z  INFO spotify_player::client: Retrieving image from url: https://i.scdn.co/image/*********************
2025-11-06T1607:00.802793Z ERROR librespot_playback::player: Track should be available, but no alternatives found.
2025-11-06T1607:00.802842Z  WARN librespot_playback::player: <spotify:track:*********************> is not available
2025-11-06T1607:00.802919Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: ()

Environment

  • OS: Arch Linux
  • Application version: Latest 0.21.1-1

Additional context

Apologies if it's just my setup, everything was playing fine yesterday though.

Originally created by @arch-btw on GitHub (Nov 6, 2025). Original GitHub issue: https://github.com/aome510/spotify-player/issues/864 **Describe the bug** Tracks are skipping without playing **To Reproduce** When I play a track that isn't cached then it won't play **Expected behaviour** For it to play music **Log and backtrace** ``` 2025-11-06T1606:59.417381Z ERROR librespot_playback::player: Track should be available, but no alternatives found. 2025-11-06T1606:59.417425Z WARN librespot_playback::player: <spotify:track:*********************> is not available 2025-11-06T1606:59.417507Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: () 2025-11-06T1606:59.422406Z ERROR librespot_playback::player: Track should be available, but no alternatives found. 2025-11-06T1606:59.422435Z WARN librespot_playback::player: <spotify:track:*********************> is not available 2025-11-06T1606:59.834362Z INFO client_request{request=Player(StartPlayback(Context(Playlist(PlaylistId("*********************")), Some(Uri("spotify:track:*********************"))), None))}: spotify_player::client: Successfully handled the client request, took: 1453ms 2025-11-06T1607:00.087064Z INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 358ms 2025-11-06T1607:00.122521Z ERROR librespot_playback::player: Track should be available, but no alternatives found. 2025-11-06T1607:00.122562Z WARN librespot_playback::player: <spotify:track:*********************> is not available 2025-11-06T1607:00.122609Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: () 2025-11-06T1607:00.726131Z INFO spotify_player::client: Retrieving image from url: https://i.scdn.co/image/********************* 2025-11-06T1607:00.802793Z ERROR librespot_playback::player: Track should be available, but no alternatives found. 2025-11-06T1607:00.802842Z WARN librespot_playback::player: <spotify:track:*********************> is not available 2025-11-06T1607:00.802919Z ERROR librespot_playback::player: Skipping to next track, unable to load track <SpotifyId("spotify:track:*********************")>: () ``` **Environment** - OS: Arch Linux - Application version: Latest 0.21.1-1 **Additional context** Apologies if it's just my setup, everything was playing fine yesterday though.
kerem 2026-03-02 23:48:16 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kubiokyay135 commented on GitHub (Nov 6, 2025):

Hello there good sir,

I actually experienced this bug a few days ago and found a work-around. From my understanding this isn't an issue with spotify-player, but instead is a bug in librespot which affects a lot of custom spotify apps. Originally ran into this with Music Assistant linked to Home Assistant earlier this year.

To fix (as a workaround), edit your hosts file on your computer and add "0.0.0.0 apresolve.spotify.com" to block the domain. This forces spotify to use an alternate cdn backend that still works properly.

<!-- gh-comment-id:3498456481 --> @kubiokyay135 commented on GitHub (Nov 6, 2025): Hello there good sir, I actually experienced this bug a few days ago and found a work-around. From my understanding this isn't an issue with spotify-player, but instead is a bug in librespot which affects a lot of custom spotify apps. Originally ran into this with Music Assistant linked to Home Assistant earlier this year. To fix (as a workaround), edit your hosts file on your computer and add "0.0.0.0 apresolve.spotify.com" to block the domain. This forces spotify to use an alternate cdn backend that still works properly.
Author
Owner

@Mega2223 commented on GitHub (Nov 6, 2025):

Apologies if it's just my setup, everything was playing fine yesterday though.

Fellow Arch User here having the exact same problem, and everything was fine yesterday too. Did you by any chance make a system update recently?

<!-- gh-comment-id:3498461711 --> @Mega2223 commented on GitHub (Nov 6, 2025): > Apologies if it's just my setup, everything was playing fine yesterday though. Fellow Arch User here having the exact same problem, and everything was fine yesterday too. Did you by any chance make a system update recently?
Author
Owner

@kubiokyay135 commented on GitHub (Nov 6, 2025):

I apologize, I guess I spoke too soon. When I first installed the app a few days ago I was getting this issue, and fixed it with the hosts file change I mentioned above. However, as of this morning it looks like that isn't working either and I'm now experiencing this bug again. Checked my logs and I'm getting the exact same errors you're getting.

Something had to have changed on Spotify's end. No changes were made on my system between yesterday and this morning, and it was working about 10hrs ago.

<!-- gh-comment-id:3498503577 --> @kubiokyay135 commented on GitHub (Nov 6, 2025): I apologize, I guess I spoke too soon. When I first installed the app a few days ago I was getting this issue, and fixed it with the hosts file change I mentioned above. However, as of this morning it looks like that isn't working either and I'm now experiencing this bug again. Checked my logs and I'm getting the exact same errors you're getting. Something had to have changed on Spotify's end. No changes were made on my system between yesterday and this morning, and it was working about 10hrs ago.
Author
Owner

@arch-btw commented on GitHub (Nov 6, 2025):

@kubiokyay135 no problem at all 👍 , and thank you for the fast reply! Unfortunately, it didn't work for me either, but I do recall that being a fix earlier this year indeed.

@Mega2223 good catch! I did do a full update earlier today. Maybe something broke along those lines.

<!-- gh-comment-id:3498510264 --> @arch-btw commented on GitHub (Nov 6, 2025): @kubiokyay135 no problem at all 👍 , and thank you for the fast reply! Unfortunately, it didn't work for me either, but I do recall that being a fix earlier this year indeed. @Mega2223 good catch! I did do a full update earlier today. Maybe something broke along those lines.
Author
Owner

@lucasadelino commented on GitHub (Nov 6, 2025):

Also broken for me after running a system update on Arch

<!-- gh-comment-id:3498575644 --> @lucasadelino commented on GitHub (Nov 6, 2025): Also broken for me after running a system update on Arch
Author
Owner

@afxfinn commented on GitHub (Nov 6, 2025):

Hi, same issue arising on my end as well, also running Arch + latest version of this, but did not do a system update recently.

Stopped working about 4 hours before posting this comment, worked fine earlier today.

<!-- gh-comment-id:3498650945 --> @afxfinn commented on GitHub (Nov 6, 2025): Hi, same issue arising on my end as well, also running Arch + latest version of this, but did _not_ do a system update recently. Stopped working about 4 hours before posting this comment, worked fine earlier today.
Author
Owner

@Simplicitie commented on GitHub (Nov 6, 2025):

Happens on MacOS too.. I was using it this morning.. paused to join a short meeting and it was broken by the time I got back. Same errors in the log file.

<!-- gh-comment-id:3498810553 --> @Simplicitie commented on GitHub (Nov 6, 2025): Happens on MacOS too.. I was using it this morning.. paused to join a short meeting and it was broken by the time I got back. Same errors in the log file.
Author
Owner

@trentcowden commented on GitHub (Nov 6, 2025):

Happening for me on MacOS as well! I can't play anything.

<!-- gh-comment-id:3498940235 --> @trentcowden commented on GitHub (Nov 6, 2025): Happening for me on MacOS as well! I can't play anything.
Author
Owner

@OneTrueJASH commented on GitHub (Nov 6, 2025):

https://github.com/librespot-org/librespot/pull/1622

<!-- gh-comment-id:3499036658 --> @OneTrueJASH commented on GitHub (Nov 6, 2025): https://github.com/librespot-org/librespot/pull/1622
Author
Owner

@aome510 commented on GitHub (Nov 6, 2025):

hi folks, just chime in this thread cause I haven't touched the project for a while. Can someone ping me once librespot releases new version with the fix so that I publish a new release?

<!-- gh-comment-id:3499196909 --> @aome510 commented on GitHub (Nov 6, 2025): hi folks, just chime in this thread cause I haven't touched the project for a while. Can someone ping me once librespot releases new version with the fix so that I publish a new release?
Author
Owner

@OneTrueJASH commented on GitHub (Nov 6, 2025):

librespot-org/librespot#1622

I've tested locally with the proposed librespot fix and can confirm it resolves the playback issue.

To get spotify-player working with PR #1622, I had to make a couple of code changes to accommodate the new librespot API. One of the commits since the last librespot release refactors how Spotify URIs are handled, replacing SpotifyId with a new SpotifyUri enum.

Changes required:

  1. spotify_player/src/streaming.rs - Updated spotify_id_to_playable_id() function:
  • Changed parameter from spotify_id::SpotifyId to SpotifyUri
  • Replaced match id.item_type with pattern matching on SpotifyUri enum variants (SpotifyUri::Track { .. }, SpotifyUri::Episode { .. })
  1. spotify_player/src/client/mod.rs - Updated lyrics() method:
  • Changed from SpotifyId::from_uri() to SpotifyUri::from_uri()
  • Added pattern matching to extract the SpotifyId from the SpotifyUri::Track { id } variant

With these changes, spotify-player builds successfully and can now play tracks without the "Track should be available, but no alternatives found" errors.

Once librespot PR #1622 is merged, spotify-player will need to adopt these API changes to remain compatible with the fix.

<!-- gh-comment-id:3499207114 --> @OneTrueJASH commented on GitHub (Nov 6, 2025): > [librespot-org/librespot#1622](https://github.com/librespot-org/librespot/pull/1622) I've tested locally with the proposed librespot fix and can confirm it resolves the playback issue. To get spotify-player working with [PR #1622](https://github.com/librespot-org/librespot/pull/1622), I had to make a couple of code changes to accommodate the new librespot API. One of the commits since the last librespot release refactors how Spotify URIs are handled, replacing `SpotifyId` with a new `SpotifyUri` enum. Changes required: 1. `spotify_player/src/streaming.rs` - Updated `spotify_id_to_playable_id()` function: - Changed parameter from `spotify_id::SpotifyId` to `SpotifyUri` - Replaced `match id.item_type` with pattern matching on `SpotifyUri` enum variants (`SpotifyUri::Track { .. }`, `SpotifyUri::Episode { .. }`) 2. `spotify_player/src/client/mod.rs` - Updated `lyrics()` method: - Changed from `SpotifyId::from_uri()` to `SpotifyUri::from_uri()` - Added pattern matching to extract the `SpotifyId` from the `SpotifyUri::Track { id }` variant With these changes, spotify-player builds successfully and can now play tracks without the "Track should be available, but no alternatives found" errors. Once librespot PR #1622 is merged, spotify-player will need to adopt these API changes to remain compatible with the fix.
Author
Owner

@aome510 commented on GitHub (Nov 6, 2025):

Once librespot PR #1622 is merged, spotify-player will need to adopt these API changes to remain compatible with the fix.

Thanks @OneTrueJASH for looking into this! If possible, once librespot releases a new version, can you put up a PR here as well?

<!-- gh-comment-id:3499233949 --> @aome510 commented on GitHub (Nov 6, 2025): > Once librespot PR #1622 is merged, spotify-player will need to adopt these API changes to remain compatible with the fix. Thanks @OneTrueJASH for looking into this! If possible, once librespot releases a new version, can you put up a PR here as well?
Author
Owner

@OneTrueJASH commented on GitHub (Nov 6, 2025):

@aome510 for sure. Glad to help out. I'll let you know when the PR is ready for review.

<!-- gh-comment-id:3499256206 --> @OneTrueJASH commented on GitHub (Nov 6, 2025): @aome510 for sure. Glad to help out. I'll let you know when the PR is ready for review.
Author
Owner

@richardhapb commented on GitHub (Nov 7, 2025):

You can use this patch while this is solved.

https://github.com/richardhapb/spotify-player/tree/patch

<!-- gh-comment-id:3500652446 --> @richardhapb commented on GitHub (Nov 7, 2025): You can use this patch while this is solved. https://github.com/richardhapb/spotify-player/tree/patch
Author
Owner

@Douglas019BR commented on GitHub (Nov 7, 2025):

You can use this patch while this is solved.

https://github.com/richardhapb/spotify-player/tree/patch

I tried this patch, but doesnt work to me, i got the same error described on this issue

<!-- gh-comment-id:3502170565 --> @Douglas019BR commented on GitHub (Nov 7, 2025): > You can use this patch while this is solved. > > https://github.com/richardhapb/spotify-player/tree/patch I tried this patch, but doesnt work to me, i got the same error described on this issue
Author
Owner

@richardhapb commented on GitHub (Nov 7, 2025):

You can use this patch while this is solved.
https://github.com/richardhapb/spotify-player/tree/patch

I tried this patch, but doesnt work to me, i got the same error described on this issue

Can you check if you are using the proper executable please?

which spotify_player

You can also test cleaning the build with Cargo beforehand.

cargo clean
cargo build --release
<!-- gh-comment-id:3502885300 --> @richardhapb commented on GitHub (Nov 7, 2025): > > You can use this patch while this is solved. > > https://github.com/richardhapb/spotify-player/tree/patch > > I tried this patch, but doesnt work to me, i got the same error described on this issue Can you check if you are using the proper executable please? ```bash which spotify_player ``` You can also test cleaning the build with Cargo beforehand. ```bash cargo clean cargo build --release ```
Author
Owner

@trentcowden commented on GitHub (Nov 7, 2025):

I also tried the patch but it didn't fix the issue for me!

I ran:

gh repo clone richardhapb/spotify-player
cd spotify-player
cargo run --release
<!-- gh-comment-id:3503670322 --> @trentcowden commented on GitHub (Nov 7, 2025): I also tried the patch but it didn't fix the issue for me! I ran: ``` gh repo clone richardhapb/spotify-player cd spotify-player cargo run --release ```
Author
Owner

@richardhapb commented on GitHub (Nov 7, 2025):

gh repo clone richardhapb/spotify-player
cd spotify-player
cargo run --release

Do this instead.

gh repo clone richardhapb/spotify-player
cd spotify-player
git switch patch
cargo run --release
<!-- gh-comment-id:3504261079 --> @richardhapb commented on GitHub (Nov 7, 2025): > gh repo clone richardhapb/spotify-player > cd spotify-player > cargo run --release Do this instead. ```bash gh repo clone richardhapb/spotify-player cd spotify-player git switch patch cargo run --release ```
Author
Owner

@OneTrueJASH commented on GitHub (Nov 7, 2025):

Update on librespot release of fixed version:
https://github.com/librespot-org/librespot/issues/1623#issuecomment-3503714872

<!-- gh-comment-id:3504310422 --> @OneTrueJASH commented on GitHub (Nov 7, 2025): Update on librespot release of fixed version: https://github.com/librespot-org/librespot/issues/1623#issuecomment-3503714872
Author
Owner

@trentcowden commented on GitHub (Nov 7, 2025):

Do this instead.

gh repo clone richardhapb/spotify-player
cd spotify-player
git switch patch
cargo run --release

That did it! Thank you much!

<!-- gh-comment-id:3504586772 --> @trentcowden commented on GitHub (Nov 7, 2025): > Do this instead. > > gh repo clone richardhapb/spotify-player > cd spotify-player > git switch patch > cargo run --release That did it! Thank you much!
Author
Owner

@mrghosti3 commented on GitHub (Nov 7, 2025):

It's now merged in librespot dev branch

<!-- gh-comment-id:3505319698 --> @mrghosti3 commented on GitHub (Nov 7, 2025): It's now merged in librespot dev branch
Author
Owner

@OneTrueJASH commented on GitHub (Nov 7, 2025):

Just waiting on a release

<!-- gh-comment-id:3505356343 --> @OneTrueJASH commented on GitHub (Nov 7, 2025): Just waiting on a release
Author
Owner

@Alexander3a commented on GitHub (Nov 8, 2025):

Update on librespot release of fixed version: librespot-org/librespot#1623 (comment)

here changed to use the official repo librespot (spotify-player changes from richardhapb)

edit: updated the patch to the new version number
if it breaks again try replacing branch = "dev" with rev = "d36f9f1907e8cc9d68a93f8ebc6b627b1bf7267d" in Cargo.toml

git clone --recurse-submodules https://github.com/aome510/spotify-player.git
cd spotify-player
git apply <path of the file below>
cargo build --release <your usual cargo install arguments/features>
cp ./target/release/spotify_player  ~/.cargo/bin/spotify_player
diff --git a/Cargo.toml b/Cargo.toml
index d656b22..7cd06cd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,3 +22,10 @@ cast_precision_loss = { level = "allow", priority = 20 }
 missing_errors_doc = { level = "allow", priority = 20 }
 similar_names = { level = "allow", priority = 20 }
 too_many_lines = { level = "allow", priority = 20 }
+
+[patch.crates-io]
+librespot-connect = { git = "https://github.com/librespot-org/librespot", branch = "dev", optional = true }
+librespot-core = { git = "https://github.com/librespot-org/librespot", branch = "dev" }
+librespot-oauth = { git = "https://github.com/librespot-org/librespot", branch = "dev" }
+librespot-playback = { git = "https://github.com/librespot-org/librespot", branch = "dev", optional = true, default-features = false, features = ["native-tls"] }
+librespot-metadata = { git = "https://github.com/librespot-org/librespot", branch = "dev" }
\ No newline at end of file
diff --git a/spotify_player/Cargo.toml b/spotify_player/Cargo.toml
index eac170d..034d88a 100644
--- a/spotify_player/Cargo.toml
+++ b/spotify_player/Cargo.toml
@@ -15,11 +15,11 @@ clap = { version = "4.5.48", features = ["derive", "string"] }
 config_parser2 = "0.1.6"
 crossterm = "0.29.0"
 dirs-next = "2.0.0"
-librespot-connect = { version = "0.7.1", optional = true }
-librespot-core = { version = "0.7.1" }
-librespot-oauth = { version = "0.7.1" }
-librespot-playback = {version = "0.7.1", optional = true, default-features = false, features = ["native-tls"]}
-librespot-metadata = { version = "0.7.1" }
+librespot-connect = { version = "0.8.0", optional = true }
+librespot-core = { version = "0.8.0" }
+librespot-oauth = { version = "0.8.0" }
+librespot-playback = {version = "0.8.0", optional = true, default-features = false, features = ["native-tls"]}
+librespot-metadata = { version = "0.8.0" }
 log = "0.4.28"
 chrono = "0.4.42"
 chrono-humanize = "0.2.3"
diff --git a/spotify_player/src/client/mod.rs b/spotify_player/src/client/mod.rs
index f57ba7c..007d9d6 100644
--- a/spotify_player/src/client/mod.rs
+++ b/spotify_player/src/client/mod.rs
@@ -19,6 +19,7 @@ use std::io::Write;
 use anyhow::Context as _;
 use anyhow::Result;
 
+use librespot_core::SpotifyUri;
 #[cfg(feature = "streaming")]
 use parking_lot::Mutex;
 
@@ -638,16 +639,21 @@ impl AppClient {
     /// Get lyrics of a given track, return None if no lyrics is available
     pub async fn lyrics(&self, track_id: TrackId<'static>) -> Result<Option<Lyrics>> {
         let session = self.session().await;
-        let id = librespot_core::spotify_id::SpotifyId::from_uri(&track_id.uri())?;
-        match librespot_metadata::Lyrics::get(&session, &id).await {
-            Ok(lyrics) => Ok(Some(lyrics.into())),
-            Err(err) => {
-                if err.to_string().to_lowercase().contains("not found") {
-                    Ok(None)
-                } else {
-                    Err(err.into())
+        let uri = SpotifyUri::from_uri(&track_id.uri())?;
+        match uri {
+            SpotifyUri::Track { id } => {
+                match librespot_metadata::Lyrics::get(&session, &id).await {
+                    Ok(lyrics) => Ok(Some(lyrics.into())),
+                    Err(err) => {
+                        if err.to_string().to_lowercase().contains("not found") {
+                            Ok(None)
+                        } else {
+                            Err(err.into())
+                        }
+                    }
                 }
             }
+            _ => Ok(None),
         }
     }
 
diff --git a/spotify_player/src/streaming.rs b/spotify_player/src/streaming.rs
index a48c386..6af82b2 100644
--- a/spotify_player/src/streaming.rs
+++ b/spotify_player/src/streaming.rs
@@ -2,8 +2,8 @@ use crate::{client::AppClient, config, state::SharedState};
 use anyhow::Context;
 use librespot_connect::{ConnectConfig, Spirc};
 use librespot_core::authentication::Credentials;
-use librespot_core::Session;
-use librespot_core::{config::DeviceType, spotify_id};
+use librespot_core::config::DeviceType;
+use librespot_core::{spotify_uri, Session, SpotifyUri};
 use librespot_playback::mixer::MixerConfig;
 use librespot_playback::{
     audio_backend,
@@ -85,17 +85,17 @@ impl PlayerEvent {
     }
 }
 
-fn spotify_id_to_playable_id(id: spotify_id::SpotifyId) -> anyhow::Result<PlayableId<'static>> {
-    match id.item_type {
-        spotify_id::SpotifyItemType::Track => {
-            let uri = id.to_uri()?;
+fn spotify_id_to_playable_id(uri: spotify_uri::SpotifyUri) -> anyhow::Result<PlayableId<'static>> {
+    match uri {
+        SpotifyUri::Track { .. } => {
+            let uri = uri.to_uri()?;
             Ok(TrackId::from_uri(&uri)?.into_static().into())
         }
-        spotify_id::SpotifyItemType::Episode => {
-            let uri = id.to_uri()?;
+        SpotifyUri::Episode { .. } => {
+            let uri = uri.to_uri()?;
             Ok(EpisodeId::from_uri(&uri)?.into_static().into())
         }
-        _ => anyhow::bail!("unexpected spotify_id {id:?}"),
+        _ => anyhow::bail!("unexpected spotify_id {uri:?}"),
     }
 }
 
@@ -106,23 +106,26 @@ impl PlayerEvent {
                 playable_id: spotify_id_to_playable_id(audio_item.track_id)?,
             }),
             player::PlayerEvent::Playing {
-                track_id,
+                track_id: track_uri,
                 position_ms,
                 ..
             } => Some(PlayerEvent::Playing {
-                playable_id: spotify_id_to_playable_id(track_id)?,
+                playable_id: spotify_id_to_playable_id(track_uri)?,
                 position_ms,
             }),
             player::PlayerEvent::Paused {
-                track_id,
+                track_id: track_uri,
                 position_ms,
                 ..
             } => Some(PlayerEvent::Paused {
-                playable_id: spotify_id_to_playable_id(track_id)?,
+                playable_id: spotify_id_to_playable_id(track_uri)?,
                 position_ms,
             }),
-            player::PlayerEvent::EndOfTrack { track_id, .. } => Some(PlayerEvent::EndOfTrack {
-                playable_id: spotify_id_to_playable_id(track_id)?,
+            player::PlayerEvent::EndOfTrack {
+                track_id: track_uri,
+                ..
+            } => Some(PlayerEvent::EndOfTrack {
+                playable_id: spotify_id_to_playable_id(track_uri)?,
             }),
             _ => None,
         })
<!-- gh-comment-id:3506300560 --> @Alexander3a commented on GitHub (Nov 8, 2025): > Update on librespot release of fixed version: [librespot-org/librespot#1623 (comment)](https://github.com/librespot-org/librespot/issues/1623#issuecomment-3503714872) here changed to use the official repo librespot (spotify-player changes from richardhapb) edit: updated the patch to the new version number if it breaks again try replacing `branch = "dev"` with `rev = "d36f9f1907e8cc9d68a93f8ebc6b627b1bf7267d"` in Cargo.toml ```bash git clone --recurse-submodules https://github.com/aome510/spotify-player.git cd spotify-player git apply <path of the file below> cargo build --release <your usual cargo install arguments/features> cp ./target/release/spotify_player ~/.cargo/bin/spotify_player ``` ```diff diff --git a/Cargo.toml b/Cargo.toml index d656b22..7cd06cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,10 @@ cast_precision_loss = { level = "allow", priority = 20 } missing_errors_doc = { level = "allow", priority = 20 } similar_names = { level = "allow", priority = 20 } too_many_lines = { level = "allow", priority = 20 } + +[patch.crates-io] +librespot-connect = { git = "https://github.com/librespot-org/librespot", branch = "dev", optional = true } +librespot-core = { git = "https://github.com/librespot-org/librespot", branch = "dev" } +librespot-oauth = { git = "https://github.com/librespot-org/librespot", branch = "dev" } +librespot-playback = { git = "https://github.com/librespot-org/librespot", branch = "dev", optional = true, default-features = false, features = ["native-tls"] } +librespot-metadata = { git = "https://github.com/librespot-org/librespot", branch = "dev" } \ No newline at end of file diff --git a/spotify_player/Cargo.toml b/spotify_player/Cargo.toml index eac170d..034d88a 100644 --- a/spotify_player/Cargo.toml +++ b/spotify_player/Cargo.toml @@ -15,11 +15,11 @@ clap = { version = "4.5.48", features = ["derive", "string"] } config_parser2 = "0.1.6" crossterm = "0.29.0" dirs-next = "2.0.0" -librespot-connect = { version = "0.7.1", optional = true } -librespot-core = { version = "0.7.1" } -librespot-oauth = { version = "0.7.1" } -librespot-playback = {version = "0.7.1", optional = true, default-features = false, features = ["native-tls"]} -librespot-metadata = { version = "0.7.1" } +librespot-connect = { version = "0.8.0", optional = true } +librespot-core = { version = "0.8.0" } +librespot-oauth = { version = "0.8.0" } +librespot-playback = {version = "0.8.0", optional = true, default-features = false, features = ["native-tls"]} +librespot-metadata = { version = "0.8.0" } log = "0.4.28" chrono = "0.4.42" chrono-humanize = "0.2.3" diff --git a/spotify_player/src/client/mod.rs b/spotify_player/src/client/mod.rs index f57ba7c..007d9d6 100644 --- a/spotify_player/src/client/mod.rs +++ b/spotify_player/src/client/mod.rs @@ -19,6 +19,7 @@ use std::io::Write; use anyhow::Context as _; use anyhow::Result; +use librespot_core::SpotifyUri; #[cfg(feature = "streaming")] use parking_lot::Mutex; @@ -638,16 +639,21 @@ impl AppClient { /// Get lyrics of a given track, return None if no lyrics is available pub async fn lyrics(&self, track_id: TrackId<'static>) -> Result<Option<Lyrics>> { let session = self.session().await; - let id = librespot_core::spotify_id::SpotifyId::from_uri(&track_id.uri())?; - match librespot_metadata::Lyrics::get(&session, &id).await { - Ok(lyrics) => Ok(Some(lyrics.into())), - Err(err) => { - if err.to_string().to_lowercase().contains("not found") { - Ok(None) - } else { - Err(err.into()) + let uri = SpotifyUri::from_uri(&track_id.uri())?; + match uri { + SpotifyUri::Track { id } => { + match librespot_metadata::Lyrics::get(&session, &id).await { + Ok(lyrics) => Ok(Some(lyrics.into())), + Err(err) => { + if err.to_string().to_lowercase().contains("not found") { + Ok(None) + } else { + Err(err.into()) + } + } } } + _ => Ok(None), } } diff --git a/spotify_player/src/streaming.rs b/spotify_player/src/streaming.rs index a48c386..6af82b2 100644 --- a/spotify_player/src/streaming.rs +++ b/spotify_player/src/streaming.rs @@ -2,8 +2,8 @@ use crate::{client::AppClient, config, state::SharedState}; use anyhow::Context; use librespot_connect::{ConnectConfig, Spirc}; use librespot_core::authentication::Credentials; -use librespot_core::Session; -use librespot_core::{config::DeviceType, spotify_id}; +use librespot_core::config::DeviceType; +use librespot_core::{spotify_uri, Session, SpotifyUri}; use librespot_playback::mixer::MixerConfig; use librespot_playback::{ audio_backend, @@ -85,17 +85,17 @@ impl PlayerEvent { } } -fn spotify_id_to_playable_id(id: spotify_id::SpotifyId) -> anyhow::Result<PlayableId<'static>> { - match id.item_type { - spotify_id::SpotifyItemType::Track => { - let uri = id.to_uri()?; +fn spotify_id_to_playable_id(uri: spotify_uri::SpotifyUri) -> anyhow::Result<PlayableId<'static>> { + match uri { + SpotifyUri::Track { .. } => { + let uri = uri.to_uri()?; Ok(TrackId::from_uri(&uri)?.into_static().into()) } - spotify_id::SpotifyItemType::Episode => { - let uri = id.to_uri()?; + SpotifyUri::Episode { .. } => { + let uri = uri.to_uri()?; Ok(EpisodeId::from_uri(&uri)?.into_static().into()) } - _ => anyhow::bail!("unexpected spotify_id {id:?}"), + _ => anyhow::bail!("unexpected spotify_id {uri:?}"), } } @@ -106,23 +106,26 @@ impl PlayerEvent { playable_id: spotify_id_to_playable_id(audio_item.track_id)?, }), player::PlayerEvent::Playing { - track_id, + track_id: track_uri, position_ms, .. } => Some(PlayerEvent::Playing { - playable_id: spotify_id_to_playable_id(track_id)?, + playable_id: spotify_id_to_playable_id(track_uri)?, position_ms, }), player::PlayerEvent::Paused { - track_id, + track_id: track_uri, position_ms, .. } => Some(PlayerEvent::Paused { - playable_id: spotify_id_to_playable_id(track_id)?, + playable_id: spotify_id_to_playable_id(track_uri)?, position_ms, }), - player::PlayerEvent::EndOfTrack { track_id, .. } => Some(PlayerEvent::EndOfTrack { - playable_id: spotify_id_to_playable_id(track_id)?, + player::PlayerEvent::EndOfTrack { + track_id: track_uri, + .. + } => Some(PlayerEvent::EndOfTrack { + playable_id: spotify_id_to_playable_id(track_uri)?, }), _ => None, }) ```
Author
Owner

@kohane27 commented on GitHub (Nov 8, 2025):

@Alexander3a Thank you so much for the step-by-step guide. I followed it and can verify that it works!

<!-- gh-comment-id:3506506475 --> @kohane27 commented on GitHub (Nov 8, 2025): @Alexander3a Thank you so much for the step-by-step guide. I followed it and can verify that it works!
Author
Owner

@martinprad0 commented on GitHub (Nov 10, 2025):

Is the patch for this issue already published? I tried rebuilding the cargo package with cargo install --git https://github.com/aome510/spotify-player --force but the issue still persists. Just so I know if I open a new issue.

<!-- gh-comment-id:3513990184 --> @martinprad0 commented on GitHub (Nov 10, 2025): Is the patch for this issue already published? I tried rebuilding the cargo package with `cargo install --git https://github.com/aome510/spotify-player --force` but the issue still persists. Just so I know if I open a new issue.
Author
Owner

@Eulenberg commented on GitHub (Nov 10, 2025):

i tryed building it like it is from souce like 10 minutes ago, issue persists, @Alexander3a patch seems no not work anymore for some reason getting the following error

   Compiling librespot-oauth v0.7.1
   Compiling librespot-metadata v0.7.1
   Compiling librespot-audio v0.7.1
   Compiling librespot-playback v0.7.1
   Compiling librespot-connect v0.7.1
   Compiling spotify_player v0.21.1 (/home/eule/src/spotify-player/spotify_player)
error[E0432]: unresolved import `librespot_core::SpotifyUri`
  --> spotify_player/src/client/mod.rs:22:5
   |
22 | use librespot_core::SpotifyUri;
   |     ^^^^^^^^^^^^^^^^----------
   |     |               |
   |     |               help: a similar name exists in the module: `SpotifyId`
   |     no `SpotifyUri` in the root

error[E0432]: unresolved imports `librespot_core::spotify_uri`, `librespot_core::SpotifyUri`
 --> spotify_player/src/streaming.rs:6:22
  |
6 | use librespot_core::{spotify_uri, Session, SpotifyUri};
  |                      ^^^^^^^^^^^           ^^^^^^^^^^ no `SpotifyUri` in the root
  |                      |
  |                      no `spotify_uri` in the root
  |
help: a similar name exists in the module
  |
6 - use librespot_core::{spotify_uri, Session, SpotifyUri};
6 + use librespot_core::{spotify_id, Session, SpotifyUri};
  |
help: a similar name exists in the module
  |
6 - use librespot_core::{spotify_uri, Session, SpotifyUri};
6 + use librespot_core::{spotify_uri, Session, SpotifyId};
  |

For more information about this error, try `rustc --explain E0432`.
error: could not compile `spotify_player` (bin "spotify_player") due to 2 previous errors```
<!-- gh-comment-id:3513999286 --> @Eulenberg commented on GitHub (Nov 10, 2025): i tryed building it like it is from souce like 10 minutes ago, issue persists, @Alexander3a patch seems no not work anymore for some reason getting the following error ```Compiling rspotify v0.15.1 Compiling librespot-oauth v0.7.1 Compiling librespot-metadata v0.7.1 Compiling librespot-audio v0.7.1 Compiling librespot-playback v0.7.1 Compiling librespot-connect v0.7.1 Compiling spotify_player v0.21.1 (/home/eule/src/spotify-player/spotify_player) error[E0432]: unresolved import `librespot_core::SpotifyUri` --> spotify_player/src/client/mod.rs:22:5 | 22 | use librespot_core::SpotifyUri; | ^^^^^^^^^^^^^^^^---------- | | | | | help: a similar name exists in the module: `SpotifyId` | no `SpotifyUri` in the root error[E0432]: unresolved imports `librespot_core::spotify_uri`, `librespot_core::SpotifyUri` --> spotify_player/src/streaming.rs:6:22 | 6 | use librespot_core::{spotify_uri, Session, SpotifyUri}; | ^^^^^^^^^^^ ^^^^^^^^^^ no `SpotifyUri` in the root | | | no `spotify_uri` in the root | help: a similar name exists in the module | 6 - use librespot_core::{spotify_uri, Session, SpotifyUri}; 6 + use librespot_core::{spotify_id, Session, SpotifyUri}; | help: a similar name exists in the module | 6 - use librespot_core::{spotify_uri, Session, SpotifyUri}; 6 + use librespot_core::{spotify_uri, Session, SpotifyId}; | For more information about this error, try `rustc --explain E0432`. error: could not compile `spotify_player` (bin "spotify_player") due to 2 previous errors```
Author
Owner

@kohane27 commented on GitHub (Nov 11, 2025):

@Eulenberg You have a build issue. Is there any error when you applied the patch? You can say the patch won't work when it compiled and the player would not play any songs.

<!-- gh-comment-id:3514474433 --> @kohane27 commented on GitHub (Nov 11, 2025): @Eulenberg You have a build issue. Is there any error when you applied the patch? You can say the patch won't work when it compiled and the player would not play any songs.
Author
Owner

@Alexander3a commented on GitHub (Nov 11, 2025):

@Eulenberg You have a build issue. Is there any error when you applied the patch? You can say the patch won't work when it compiled and the player would not play any songs.

librespot-org has updated the patch is no longer working for the newest version

i have updated the patch to target the working rev

edit: i noticed they only updated the version number so i have also updated my patch above
lets see how long till it breaks again and i cant target dev anymore

<!-- gh-comment-id:3515422358 --> @Alexander3a commented on GitHub (Nov 11, 2025): > [@Eulenberg](https://github.com/Eulenberg) You have a build issue. Is there any error when you applied the patch? You can say the patch won't work when it compiled and the player would not play any songs. librespot-org has updated the patch is no longer working for the newest version i have updated the patch to target the working rev edit: i noticed they only updated the version number so i have also updated my patch above lets see how long till it breaks again and i cant target dev anymore
Author
Owner

@antoniorodr commented on GitHub (Nov 11, 2025):

Hi!

I have the same problem too, I think. The songs will not start reproducing, but the "Spotify-player" appears as a device.

I am on macOS, installed thought homebrew

<!-- gh-comment-id:3517049469 --> @antoniorodr commented on GitHub (Nov 11, 2025): Hi! I have the same problem too, I think. The songs will not start reproducing, but the "Spotify-player" appears as a device. I am on macOS, installed thought homebrew
Author
Owner

@Eulenberg commented on GitHub (Nov 11, 2025):

@Alexander3a thank you sooo much !!!

<!-- gh-comment-id:3517053581 --> @Eulenberg commented on GitHub (Nov 11, 2025): @Alexander3a thank you sooo much !!!
Author
Owner

@wawwior commented on GitHub (Nov 11, 2025):

librespots newest release includes #1622 now

<!-- gh-comment-id:3517724053 --> @wawwior commented on GitHub (Nov 11, 2025): librespots newest release includes #1622 now
Author
Owner

@Eulenberg commented on GitHub (Nov 11, 2025):

@wawwior does this mean we can build a working binary from this source again without the patch provided by @Alexander3a ?

<!-- gh-comment-id:3517933817 --> @Eulenberg commented on GitHub (Nov 11, 2025): @wawwior does this mean we can build a working binary from this source again without the patch provided by @Alexander3a ?
Author
Owner

@wawwior commented on GitHub (Nov 11, 2025):

@Eulenberg no, not until this is updated to the new version, which is a process pretty much identical to the patch.

<!-- gh-comment-id:3518078080 --> @wawwior commented on GitHub (Nov 11, 2025): @Eulenberg no, not until this is updated to the new version, which is a process pretty much identical to the patch.
Author
Owner

@Douglas019BR commented on GitHub (Nov 11, 2025):

@Alexander3a I created a PR with your suggestion. I tested it on my machine and it works pretty well. I really want to thank you because of this—my days are much better with spotify_player :) I created the PR just so people from this issue can get back to listening to music faster, but if you prefer, I can close my PR and wait for yours.

<!-- gh-comment-id:3518101055 --> @Douglas019BR commented on GitHub (Nov 11, 2025): @Alexander3a I created a PR with your suggestion. I tested it on my machine and it works pretty well. I really want to thank you because of this—my days are much better with spotify_player :) I created the PR just so people from this issue can get back to listening to music faster, but if you prefer, I can close my PR and wait for yours.
Author
Owner

@martinprad0 commented on GitHub (Nov 14, 2025):

I know this is closed, because it was working yesterday. But today the problem emerged again, should I open a new issue?

<!-- gh-comment-id:3530261819 --> @martinprad0 commented on GitHub (Nov 14, 2025): I know this is closed, because it was working yesterday. But today the problem emerged again, should I open a new issue?
Author
Owner

@Douglas019BR commented on GitHub (Nov 14, 2025):

I know this is closed, because it was working yesterday. But today the problem emerged again, should I open a new issue?

I just tried it and it works well. Please try uninstalling the version you had installed, update the repo, and install it again. If it still doesn't work, try to capture the error log.

<!-- gh-comment-id:3533152605 --> @Douglas019BR commented on GitHub (Nov 14, 2025): > I know this is closed, because it was working yesterday. But today the problem emerged again, should I open a new issue? I just tried it and it works well. Please try uninstalling the version you had installed, update the repo, and install it again. If it still doesn't work, try to capture the error log.
Author
Owner

@aome510 commented on GitHub (Nov 14, 2025):

yes just tried it and things seem to work well for me

<!-- gh-comment-id:3533198102 --> @aome510 commented on GitHub (Nov 14, 2025): yes just tried it and things seem to work well for me
Author
Owner

@damianmr commented on GitHub (Nov 14, 2025):

yes just tried it and things seem to work well for me

Hi @aome510, is there any chance we could get a homebrew release of the latest minor 0.21.2? Homebrew is still installing 0.21.1

<!-- gh-comment-id:3533348968 --> @damianmr commented on GitHub (Nov 14, 2025): > yes just tried it and things seem to work well for me Hi @aome510, is there any chance we could get a homebrew release of the latest minor `0.21.2`? Homebrew is still installing `0.21.1`
Author
Owner

@OneTrueJASH commented on GitHub (Nov 14, 2025):

@damianmr

https://formulae.brew.sh/formula/spotify_player is showing the stable version as 0.21.2

If your Homebrew keeps installing 0.21.1, you might try targeting the specific version with your brew install command

<!-- gh-comment-id:3533448384 --> @OneTrueJASH commented on GitHub (Nov 14, 2025): @damianmr https://formulae.brew.sh/formula/spotify_player is showing the stable version as `0.21.2` If your Homebrew keeps installing `0.21.1`, you might try targeting the specific version with your `brew install` command
Author
Owner

@damianmr commented on GitHub (Nov 14, 2025):

@damianmr

https://formulae.brew.sh/formula/spotify_player is showing the stable version as 0.21.2

If your Homebrew keeps installing 0.21.1, you might try targeting the specific version with your brew install command

Sorry, I forgot to upgrade my formulas before trying 🫣 Thanks, 0.21.2 fixed the audio issue for me.

<!-- gh-comment-id:3533660504 --> @damianmr commented on GitHub (Nov 14, 2025): > [@damianmr](https://github.com/damianmr) > > https://formulae.brew.sh/formula/spotify_player is showing the stable version as `0.21.2` > > If your Homebrew keeps installing `0.21.1`, you might try targeting the specific version with your `brew install` command Sorry, I forgot to upgrade my formulas before trying 🫣 Thanks, `0.21.2` fixed the audio issue for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#521
No description provided.