I'm creating a Spotify client to listen passively on events from Spotify. It works great for most of the events, except the hm://collection/collection/:username one, which is used whenever a user adds/remove a song from their liked songs.
My logs are extremely verbose, but I've captured where the parsing issues are logged. I removed/added/removed/added the same song link=https://open.spotify.com/track/1kuPgsWuwfNVHTPDBGMMj4, uri="spotify:track:1kuPgsWuwfNVHTPDBGMMj4", uid="ea0019b856d6d45d2cc4"
// removed
Message { headers: {"MC-ETag": "64941807882", "Collection-Update-Id": "66dce80f5c4d7c20", "Collection-Source-Revision": "55320748569", "Content-Type": "application/octet-stream"}, payload: Raw([10, 24, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 0, 48, 1]), uri: "hm://collection/collection/ha9ha10" }
Error { kind: FailedPrecondition, error: Error(WireError(Utf8Error)) }
2025-05-27T03:04:23.652329Z WARN librespot_core::dealer: failure during data parsing for hm://collection/collection/ha9ha10/json: Invalid state { base64 decoding failed: Invalid symbol 125, offset 108. }
// liked
Message { headers: {"Collection-Update-Id": "9ee4a66d1fa26263", "MC-ETag": "46685679324", "Collection-Source-Revision": "64941807882", "Content-Type": "application/octet-stream"}, payload: Raw([10, 28, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 191, 215, 212, 193, 6, 48, 0]), uri: "hm://collection/collection/ha9ha10" }
Error { kind: FailedPrecondition, error: Error(WireError(Utf8Error)) }
2025-05-27T03:04:31.498298Z WARN librespot_core::dealer: failure during data parsing for hm://collection/collection/ha9ha10/json: Invalid state { base64 decoding failed: Invalid symbol 123, offset 0. }
// removed
Message { headers: {"MC-ETag": "47316492062", "Collection-Source-Revision": "46685679324", "Collection-Update-Id": "ee516cc0498e02dd", "Content-Type": "application/octet-stream"}, payload: Raw([10, 24, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 0, 48, 1]), uri: "hm://collection/collection/ha9ha10" }
Error { kind: FailedPrecondition, error: Error(WireError(Utf8Error)) }
2025-05-27T03:04:40.601061Z WARN librespot_core::dealer: failure during data parsing for hm://collection/collection/ha9ha10/json: Invalid state { base64 decoding failed: Invalid symbol 125, offset 108. }
// liked
Message { headers: {"Collection-Source-Revision": "47316492062", "Content-Type": "application/octet-stream", "MC-ETag": "56467871245", "Collection-Update-Id": "ab9637744956f5fa"}, payload: Raw([10, 28, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 202, 215, 212, 193, 6, 48, 0]), uri: "hm://collection/collection/ha9ha10" }
Error { kind: FailedPrecondition, error: Error(WireError(Utf8Error)) }
2025-05-27T03:04:42.219687Z WARN librespot_core::dealer: failure during data parsing for hm://collection/collection/ha9ha10/json: Invalid state { base64 decoding failed: Invalid symbol 123, offset 0. }
Ultimately, I'm unfamiliar how this works other from my exploration of this codebase.
Description
I'm creating a Spotify client to listen passively on events from Spotify. It works great for most of the events, except the
hm://collection/collection/:usernameone, which is used whenever a user adds/remove a song from their liked songs.Version
Using the latest commit, 8b72954
How to reproduce
cargo runCargo.tomlmain.rs- the protobuf message used forhm://collection/collection/:usernameis certainly not the right one, but it would give another error if it reached that part (I'm also unsure which protobuf schema this would relate to):Log
My logs are extremely verbose, but I've captured where the parsing issues are logged. I removed/added/removed/added the same song
link=https://open.spotify.com/track/1kuPgsWuwfNVHTPDBGMMj4, uri="spotify:track:1kuPgsWuwfNVHTPDBGMMj4", uid="ea0019b856d6d45d2cc4"Host (what you are running
librespoton):Additional context
You can see the raw data is similar throughout the requests:
[10, 24, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 0, 48, 1][10, 28, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 191, 215, 212, 193, 6, 48, 0][10, 24, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 0, 48, 1](the same)[10, 28, 8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40, 202, 215, 212, 193, 6, 48, 0]I can see the following:
8, 0, 18, 16, 43, 184, 38, 105, 23, 212, 70, 149, 146, 77, 130, 115, 44, 209, 83, 30, 40is common, I'm guessing that the song IDUltimately, I'm unfamiliar how this works other from my exploration of this codebase.