simon-weber / gmusicapi

An unofficial client library for Google Music.
https://unofficial-google-music-api.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.48k stars 257 forks source link

Is there a way to get the current playlist which is playling on a device ? #162

Closed manatlan closed 11 years ago

manatlan commented 11 years ago

Hi, and thanks for your big works -> it's marvelous !

It seems there is no api for that, in gmusicapi ... But I would like to know if it's possible, and if it's planned ...

(Subsidiary question : is there a way to get the list of tracks of an albumid ?)

Thanks in advance ...

simon-weber commented 11 years ago

Thanks for the kind words!

I'll give you the bad news first: unfortunately, playback is completely a clientside operation, so there's no way to know what the client is playing or change it. Basically, clients just maintain a list of all possible tracks, and send requests to the server sometime before they play them. Requests are usually batched up and not published anywhere that I know of. You might be able to get realtime-ish playback history, but that's not something I've ever lookged into.

So, I'd love to support this, but it's a limitation on Google's end; I wouldn't expect this to become possible in the near future.

The good news is it's totally possible to list tracks of an album, I just haven't gotten around to completely publishing it yet. Try mobileclient.get_album in develop, which gives you data that looks like this. I'll formalize this in the next release, whenever that ends up being =)