mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #342] Where does the reporting happen? #225
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#225
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 @michaelherger on GitHub (Jun 29, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/342
I've had a report of a user who happens to be an artist, too. He claims that when he's listening to his own music using my implementation of librespot, the tracks would not be reported. This is definitely not what I want to happen, therefore I'm a bit concerned.
And I must admit I've been wondering why my kids' listening habits hadn't polluted my profile yet... (but I was less concerned about that :-D).
Is there code in librespot which actively does report when a track has been listened to? I was assuming that telling librespot to play a track would do all the magic for me.
I'm using a slightly modified fork of librespot (https://github.com/michaelherger/librespot), and I'm not sure whether one of my modifications is causing this mis-behavior or not.
@michaelherger commented on GitHub (Aug 19, 2019):
Anyone?
@devgianlu commented on GitHub (Aug 19, 2019):
How can we test whether the playback history is being recorded or not? I am willing to fix this issue for librespot-java, but I need a way to test it properly.
@michaelherger commented on GitHub (Aug 19, 2019):
That's a good point and something I'll try to do: you can get the recently played tracks using the web API (the call is still beta... hopefully that won't confuse even more...).
https://developer.spotify.com/documentation/web-api/reference/player/get-recently-played/
@devgianlu commented on GitHub (Aug 25, 2019):
@michaelherger I've checked and it seems that tracks played from librespot aren't reported by that endpoint. I will investigate this further.
@michaelherger commented on GitHub (Aug 26, 2019):
Thanks for the confirmation!
@devgianlu commented on GitHub (Aug 29, 2019):
Unluckily I don't see any specific call to report that a track is playing. I am afraid that it is done via the
event-serviceendpoint which hasn't been reversed engineered at all. The only (mercury) packet that has the track uri in it is the following:There's no reporting in the HTTP API either. Android doesn't seem to have any of this either.
I've also noticed that the Recently played API updates quite slowly, so maybe librespot-java works with reporting? Don't know.
@ashthespy commented on GitHub (Aug 29, 2019):
@devgianlu There is also an
activity-managerendpoint that I recall seeing, but didn't investigate further.@devgianlu commented on GitHub (Aug 29, 2019):
I did not see any of that. Maybe it has been deprecated when they upgraded the protocol.
@ashthespy commented on GitHub (Aug 29, 2019):
This was from an older version indeed. I need to find my notes.
Also might be of interest:
@devgianlu commented on GitHub (Aug 29, 2019):
I think that's for episodes only.
@ashthespy commented on GitHub (Aug 29, 2019):
You are probably right again, its been a while I looked at this!
@caba8685 commented on GitHub (Nov 26, 2019):
Any updates on this?
@devgianlu commented on GitHub (Nov 26, 2019):
We are stuck on trying to find a way to check if the changes on the client work.
@sashahilton00 commented on GitHub (Nov 26, 2019):
It’s probably handled via the events service. I’d be surprised if Spotify does the play reporting client side, would make it too easy to abuse. Then again, I can’t see how they track it server side unless they’re doing some sort of calculation based on the number of chunks sent to a client
@ashthespy commented on GitHub (Nov 26, 2019):
I was thinking about this some time back, and I guess they probably have metrics based on client type, and since we report
librespotthey could just not be propagating those metrics?@devgianlu commented on GitHub (Nov 26, 2019):
From the get-recently-played docs:
I can confirm that reporting doesn't work for
librespot-java. When using the original client, as soon as the song ends, it appears in the list.@michaelherger commented on GitHub (Nov 26, 2019):
Could it be librespot downloading too fast, leaving Spotify to think we didn't listen to the track? (seems like an odd design, but who know?...)
FWIW: I've worked with many streaming services. Many of them would require you to manually report playback from the client's side. It's not uncommon.
@ashthespy commented on GitHub (Nov 26, 2019):
This duration seems to be passed to the client:
@devgianlu commented on GitHub (Nov 26, 2019):
The following
hm://event-service/v1/eventspacket seems interesting (number 15 in the attached dump):It has been sent once the track (
spotify:track:3mof6Z6vz6gonsuIEQXank) finished.[[0,254896]]is the interval of the song that has been played in milliseconds.00 5ais the length of the payload.01a5ba17d8411f92a5b6601e872da877is probably the device id.01a5ba17d8411f92a5b6601e872da877is the playback ID contained inside the player state (changes with every track),but no matter what I try, the client keeps sending 400.reporting.zip
Another example:
@devgianlu commented on GitHub (Nov 27, 2019):
I am working on reverse engineering the
event-serviceendpoint (https://github.com/librespot-org/librespot-java/pull/155). As always, I crawl for help.@devgianlu commented on GitHub (Apr 14, 2020):
More work has been done and I finally got it working. There is still some work to do as they don't pick up tracks that end because of pressing some button (aka works only with
trackdone).There are also many fields that I don't know the purpose of. Here's a breakdown of the most interesting packet:
I've enhanced the dissect script to better reverse engineer the event service: https://github.com/devgianlu/spotify-analyze
@devgianlu commented on GitHub (Apr 18, 2020):
Just a quick question on the topic. Do you think it is better to send an event with some standard values that I didn't figure out or just not send it because it is not needed?
@devgianlu commented on GitHub (Nov 1, 2020):
What do you mean?
@ashthespy commented on GitHub (Nov 1, 2020):
No, only
librespot-javadoes it..