Replies: 4 comments 2 replies
-
Continued my exploration, but no definitive way to parse it yet. I think the protobuf file for this type of message would look something like syntax = "proto3";
package spotify;
message Track {
int32 status = 1; // Always 0 (maybe play state?)
bytes track_id_binary = 2; // 16-byte binary Spotify track ID
optional int32 context_field = 3; // Possible context/playlist ID (4 bytes)
}
message SpotifyLikeAction {
repeated Track tracks = 1; // Can contain multiple tracks
uint64 timestamp = 5; // Timestamp (0 for unlike, current time for like in seconds)
bool action_type = 6; // false = save, true = unsave
} For Steps to convert those binary track_id bytes to the Spotify ID:
Other things I found out/confirmed:
|
Beta Was this translation helpful? Give feedback.
-
Interesting discoveries! But what exactly is your issue you encounter? Is it something rudimentary in the implementation or rather a missing protobuf definition? From your log there is a You also use If so I would convert this issue into a discussion, so we can still help you but without declaring non existing proto files as bug^^; |
Beta Was this translation helpful? Give feedback.
-
Sorry for opening an issue if this isn't considered an issue. Yes it is about the parsing of the data from the I'm aware that Feel free to convert this as a discussion, I do not mind :) On another topic, if you know how to "acquire" or extract the protobuf definitions from a Spotify binary, let me know! Either here or at my email |
Beta Was this translation helpful? Give feedback.
-
Interesting how the issue is converted. Anyhow, no problem, you can see it both ways. It could be considered an bug as there is something missing, but as we do not include all proto files to keep the size somewhat down I would rather consider it more of a "need help" section which seems more appropriate as discussion. So anyways, you can look at #1424, there is the last proto dump from which the definition were updated last time. There is also a simple tool listed with which you can extract the protobuf definitions of the current clients. Maybe you can find a matching definition there. If not, we will need to add our own protobuf file with the matching definition :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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/:username
one, which is used whenever a user adds/remove a song from their liked songs.Version
Using the latest commit, 8b72954
How to reproduce
cargo run
Cargo.toml
main.rs
- the protobuf message used forhm://collection/collection/:username
is 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
librespot
on):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, 40
is common, I'm guessing that the song IDUltimately, I'm unfamiliar how this works other from my exploration of this codebase.
Beta Was this translation helpful? Give feedback.
All reactions