psst icon indicating copy to clipboard operation
psst copied to clipboard

Reporting played tracks to Spotify servers

Open Sinono3 opened this issue 4 years ago • 8 comments

Since Spotify tracks user listening and makes charts, song playlists and algorithms according to it, I think this feature is important, lots of people care about this.

The discussion about this on librespot isn't active, but it seems the folks over at librespot-java had success with the reporting. Maybe we could take inspiration from their implementation.

Sinono3 avatar Aug 06 '21 14:08 Sinono3

I'm not sure if that is a feature everyone would want to have. I'm using psst exactly because it doesn't track and report everything I do in it to Spotify. So I'd at least vote for a settings option to disable tracking and reporting.

violoncelloCH avatar Aug 24 '21 18:08 violoncelloCH

Spotify reporting is also useful for forwarding reports to other applications like Last.fm. I agree that this should be opt-in/opt-out.

boxdot avatar Aug 27 '21 09:08 boxdot

I would love to have this because I do really use the generated playlists they make for me, so I would like them to make it more accurate with the songs I play in Psst. As Spotify has, we could have private sessions, like in #154, to solve the worry of tracking it. But maybe have it as a permanent setting instead of being a "session."

confact avatar Sep 03 '21 07:09 confact

I too would like to turn on reporting (for last.fm purposes), but strongly agree that such a feature should have a permanent setting (either opt-in or opt-out) for those who do not wish to, or when one wants to temporarily turn it off.

bbbbbr avatar Oct 26 '21 02:10 bbbbbr

I see that the API used by psst is the official Spotify API. Is it reversed engineered? I would like to implement this feature behind an opt-in flag, but I am not entirely sure how to do it. Do I have to send play/stop/pause events via the API? Any help with the API is appreciated.

boxdot avatar Oct 28 '21 12:10 boxdot

Looks like librespot-java maybe supports this?

Original Issue https://github.com/librespot-org/librespot/issues/342#issuecomment-613425917

Implementation: https://github.com/librespot-org/librespot-java/pull/155

Callstack-ish overview of what's used to do that:

trackPlayed() https://github.com/librespot-org/librespot-java/blob/88149a2b55f13db0cd64c30c7f24978c789c02ec/player/src/main/java/xyz/gianlu/librespot/player/Player.java#L415

endMetrics() https://github.com/librespot-org/librespot-java/blob/88149a2b55f13db0cd64c30c7f24978c789c02ec/player/src/main/java/xyz/gianlu/librespot/player/Player.java#L731

sendEvents() https://github.com/librespot-org/librespot-java/blob/802ecf8cca8e30ca794f9fbd923a2486bf8630df/player/src/main/java/xyz/gianlu/librespot/player/metrics/PlaybackMetrics.java

TrackTransitionEvent() https://github.com/librespot-org/librespot-java/blob/802ecf8cca8e30ca794f9fbd923a2486bf8630df/player/src/main/java/xyz/gianlu/librespot/player/metrics/TrackTransitionEvent.java

When using the web client and watching the network traffic, it looks like it may be using a json equivalent for some of the above (state changes and events).

bbbbbr avatar Nov 03 '21 06:11 bbbbbr

i would also LOVE to have the option to enable listening activity reporting, so stuff like last.fm is able to keep tracking my music habits even though i'm not using the official spotify app last.fm is a really huge part of me and many others' music discovery (and logging) routine :( love Psst, excited to see what the future brings for you

spoergsmaal avatar Nov 20 '21 22:11 spoergsmaal

In theory this might be an option: https://github.com/InputUsername/rescrobbled

Haven't been able to test it yet since my system doesn't appear to have the required GLIBC version, and I haven't tried building it from source.

In the config file would include a line like this for psst:

player-whitelist = [ "psst" ]

bbbbbr avatar Aug 04 '22 06:08 bbbbbr