librespot icon indicating copy to clipboard operation
librespot copied to clipboard

Songs not showing up in Recently Played

Open agneevX opened this issue 3 years ago • 19 comments

When playing songs via Librespot, songs don't show up in Spotify's Recently Played.

This is with the following options:

--disable-discovery --username=xxx --password=xxx

Is this a known issue by any chance?

agneevX avatar Dec 22 '21 08:12 agneevX

Yes, this is a known issue that I intend to fix as part of the new-api efforts. At this point librespot does not report played tracks back to Spotify.

roderickvd avatar Dec 22 '21 08:12 roderickvd

I created this issue as a last resort, I've been engaging with the supports teams over Twitter DM and emailing Spotify Privacy because of missing data, trying to convince them its their issue to solve 😅.

Are there related issues like this?

agneevX avatar Dec 22 '21 08:12 agneevX

See https://github.com/librespot-org/librespot/discussions/626

michaelherger avatar Dec 22 '21 08:12 michaelherger

😆 well you can tell them to move on to other things.

librespot-java found it out here: https://github.com/librespot-org/librespot/discussions/626

roderickvd avatar Dec 22 '21 08:12 roderickvd

So I compiled a recent release of spotifyd and it seems to push tracks to Spotify's Recently Played. Isn't spotifyd a fork of librespot?

agneevX avatar Dec 27 '21 15:12 agneevX

Are you sure? There is no mention of "event-service" in Spotifyd's repository, which is the endpoint that's known to report played tracks back to Spotify.

Spotifyd isn't a fork, but a downstream application that pulls in librespot as a library and builds a *nix daemon and MPRIS interface on top.

roderickvd avatar Dec 27 '21 16:12 roderickvd

Yep, I spoke too soon. Turns out it added a song to Recently Played that I played for a couple of secs before selecting the Spotify Connect device.

agneevX avatar Dec 27 '21 17:12 agneevX

By the way, I think they moved events to the HTTP API so that should be easier to reverse.

devgianlu avatar Dec 27 '21 17:12 devgianlu

@devgianlu does this work with librespot-java?

agneevX avatar Dec 27 '21 17:12 agneevX

It works as long as you don't skip the song, if it ends normally it's fine.

devgianlu avatar Dec 27 '21 17:12 devgianlu

By the way, I think they moved events to the HTTP API so that should be easier to reverse.

If someone can do the man-in-the-middle and sniffing work I'd be more than happy to implement it. I'm in coding mode right now 😄 and I was planning on implementing the Mercury endpoint soon, but if anyone can figure out the HTTP one soon I'm all game to do that endpoint instead.

It works as long as you don't skip the song, if it ends normally it's fine.

Is that due to the inner workings of your player thread or some part of the message we still need to figure out?

roderickvd avatar Dec 27 '21 18:12 roderickvd

Is that due to the inner workings of your player thread or some part of the message we still need to figure out?

I've never figured out why, but that's something with the message being sent, there are different keywords for why the track started and why it ended. Ending with anything other than trackdone doesn't work. I remember I explained this somewhere.

Anyway I had a quick look at the new API some time ago and it didn't have those, might be wrong.

devgianlu avatar Dec 27 '21 19:12 devgianlu

I've never figured out why, but that's something with the message being sent, there are different keywords for why the track started and why it ended. Ending with anything other than trackdone doesn't work. I remember I explained this somewhere.

I'll read through the conversation over at librespot-java some more.

Anyway I had a quick look at the new API some time ago and it didn't have those, might be wrong.

I've got some time on my hands these weeks, so if you've got too, let me know if you would want to tackle this together.

roderickvd avatar Dec 27 '21 21:12 roderickvd

I've got some time on my hands these weeks, so if you've got too, let me know if you would want to tackle this together.

Don't really have the time to investigate myself, but I can comment/help. Do you prefer a faster messaging platform?

devgianlu avatar Dec 28 '21 18:12 devgianlu

Let me get the "old" one you already reverse engineered in first. But once I get to this I suggest we can continue on Gitter?

roderickvd avatar Dec 30 '21 18:12 roderickvd

But once I get to this I suggest we can continue on Gitter?

Sure

devgianlu avatar Dec 30 '21 18:12 devgianlu

I've got the opposite concern. I would like a private listening session option so that listening to kids music via librespot doesn't effect my profile. I obviously still want artists to get their credit but surely the API has a private session boolean that when enabled will still give artists their credit but doesn't run the tracks through the listening algorithms.

noelhibbard avatar Apr 07 '22 19:04 noelhibbard

I've got the opposite concern. I would like a private listening session option so that listening to kids music via librespot doesn't effect my profile. I obviously still want artists to get their credit but surely the API has a private session boolean that when enabled will still give artists their credit but doesn't run the tracks through the listening algorithms.

Yes, it's on the list for new-api. I haven't had much time lately, but very much intend to pick up development again.

roderickvd avatar Apr 07 '22 19:04 roderickvd