spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983 stars 79 forks source link

Realtime player state updates #492

Open lrholmes opened 7 years ago

lrholmes commented 7 years ago

I'm working on a webapp that incorporates a custom player using the new /player endpoints.

I'm wondering what your recommendations are for keeping track of the user's playback?

At the moment I've implemented a solution that works pretty well when the user stays and controls from my player, but will desynchronise if the user pauses or scrubs from the Spotify player, so I'm going to start polling the GET /player endpoint.

With regards to rate limits and general good practice, how often should I make a request to this endpoint? Every second would be ideal but with many users could that cause rate limit issues?

aidenwallis commented 5 years ago

Agreed. Fundamentally there’s not a lot of things that a single person can do in a corporate setting like this, but I don’t think the rate limit increase form is at all a bad idea at the least. But yes, let’s keep it civil, there are other human beings reading this at the end of the day.

Also afaik Ari has parted ways with Spotify, and she did her best to keep us up to date, but they struggle to reply when literally nothing has changed.

mariusclaret commented 5 years ago

I think it's very sad that there's still no response from anyone from Spotify. A simple comment that anyone there is even reading this and taking note would be such a big deal in this case.

hughrawlinson commented 5 years ago

I work at Spotify.

I'm reading this, and taking note. No updates to share at the moment. I understand the frustration that comes with wanting a feature that isn't yet available. I can promise that any updates that we have will be posted here. I can also tell you that the team is aware that this is a highly requested feature. I'll make sure to send them this thread so that they can see the enthusiasm that exists for the feature.

I think it's very sad that there's still no response from anyone from Spotify.

Please see this response from someone representing Spotify just last month.

aidenwallis commented 5 years ago

Firstly we appreciate the response.

But the current issue stands that the only two options until there is a solution is either we get some way or increasing rate-limits, or we close doors.

Honestly a lot of complaints for now would be mitigated if you simply gave us either a google form or an email to submit rate limit requests. I understand the administrative demand of doing such a thing, but that does come when you run a public API. I think it’s reasonable after 2 years that we at least get that as a temporary solution. I’m obviously not entirely sure of the burden from a technical aspect, but as you’re gladly happy to give it to corporations I can’t imagine that requests that only make up a small fraction of your total request pool getting an increase would have either a burden on your servers, or your engineering team as I’m sure you guys have ways of increasing rate-limits already.

We appreciate the reply was only one month ago, but what we’re asking for is a solution to fix us over until you have an actual solution. It’s more burden for you guys but that’s always going to exist until you guys make a better solution for us that doesn’t break dev ToS if we were to implement.

Lastly, we know this isn’t something devrel entirely control and we honestly just appreciate the support, but we need a solution.

Coding-Kiwi commented 5 years ago

I would like to add: Whats frustrating me the most is the non-transparency of the whole thing. I mean discord already uses the websockets because they pay you, or am I wrong? But the question is: what brings you more money? Big company-partnerships or the fact that with websockets you could shut down a lot of server infrastructure that is currently needed for the massive amount of polling requests. I might be completely wrong here but one thing for sure from my perspective: If spotify cant make even more money out of a feature they dont care

Coding-Kiwi commented 5 years ago

@wrathofodin I like this ^^ It's kinda like the times when the local spotify api was still a thing, sure thing spotify will patch this soon to make sure nobody is building cool applications and/or is having fun developing something that involves spotify xD

bugproof commented 5 years ago

@Coding-Kiwi you could probably make this work more automatically by setting up some kind of proxy but still, it's too hackish and would probably involve code injection too. For now, you have to manually capture the token and I think it expires after 1 hour. I think not worth the effort

Coding-Kiwi commented 5 years ago

@wrathofodin yeah I didn't plan to use it. No hate, as somebody has already pointed out: there are other human beings reading this at the end of the day. but referring to what you wrote: tbh I feel like nothing I try to program with spotify is worth the effort

lachieh commented 5 years ago

Is there any way to get the refresh token or is that interaction handled behind the curtain?

hughrawlinson commented 5 years ago

I have had to lock this thread since someone wrote details about a partner integration. I don't like to do this, but the publicly documented API is what is available, and reverse engineering is not allowed. We will still post any updates we have for this issue on this thread.