Closed winston-yallow closed 4 years ago
Spotify does have a real time [audio] streaming api, unfortunately its not official nor public and the only ways to interact with it would be through a depreciated libspotify, a mopidy server running the spotify plugin (which uses c bindings to libspotify under the hood) or one of the librespot solutions (or spotifyd).
I am currently working on an offline branch that adds spotify.audio
and aims to support real time streaming/operations, but I'm mostly gluing this together from librespot's solutions and resources so it will take some time for me to get a stable working branch to push.
regarding this issue however I'm happy with just replacing progress_ms
from the Player model with a comment describing the reason for its absence.
Glad to hear that you are working on a streaming branch! (Oh and btw thanks for this awesome and open python module :tada:)
In the Player
class I would drop the other attributes like context
, device
, item
and so on too. They all seem to be unused currently as they would require constant updates. I probably don't have time today, but I could put a PR together in the next days if dropping them all is wanted.
Sounds good, I can get these changes in today, or are you keen on PR'ing this yourself?
Go for it, I am not keen on this PR
Player.progress_ms
is only set when the player is initialised. After the initialization the value will stay the same.Expected behaviour: The
progress_ms
should always be the current valueI would propose one of the following:
progress_ms
at all. It is not really needed as the progress can easily be obtained withUser.currently_playing()['progress_ms']
@property
to fetch the current progressprogress_ms
value with a coroutine for the websocket.I think option 3 would be the best way. However it does not look like it will come soon.