mopidy / mopidy-gmusic

DEPRECATED (Mopidy extension for playing music from Google Play Music)
https://mopidy.com
Apache License 2.0
214 stars 60 forks source link

All Access tracks that are not in the library but on a playlist are not playable #16

Closed hechtus closed 10 years ago

hechtus commented 11 years ago

Tracks from an All Access subscription that are not in the library but on (public) playlists can not be played back. Looking up these tracks must be done through the All Access API of gmusicapi.

woutervanwijk commented 11 years ago

confirmed

hechtus commented 11 years ago

As I don't have an All Access subscription (unfortunately sitting in Germany), I would highly appreciate any help on this and on issue #5.

hechtus commented 11 years ago

Could someone please report logfile snippets on this? There should be printed something like:

Failed to lookup gmusic:track:xyz
jeh commented 11 years ago

I can try to help you out with this.... I don't see anything in the log file.. the songs just don't appear in the playlist

jeh commented 11 years ago

here is what is returned by the API for a user generated playlist containing two tracks, the first is in my library, the second is not.

{
u'kind': u'sj#playlist', u'name': u'boop', u'deleted': False, u'type': u'USER_GENERATED', u'lastModifiedTimestamp': u'1381612223392995', u'recentTimestamp': u'1381612223189000', u'shareToken': u'AMaBXynzL1TLwCI4d3csS1hIKC6HVesD6c0U5xUSx2xoOcRDMy1iXhxNWa-K1wU7iCYCh-Ujp90u78DYqG3xVwMelr9YiI9F1g==', 'tracks': [

{u'kind': u'sj#playlistEntry', u'deleted': False, u'trackId': u'ce2b4d07-3553-32d0-955e-f62e7bb5fbb4', u'lastModifiedTimestamp': u'1381611151287731', u'playlistId': u'014a555c-1b8c-4a5f-b25c-c33d02b5df0b', u'clientId': u'b7149ce3-8d5f-44f4-91ca-3331e9241fba', u'source': u'1', u'absolutePosition': u'01729382256910335999', u'creationTimestamp': u'1381611151287731', u'id': u'5408f7ef-1bd4-3dce-b182-6bbc18d702a7'}, 

{u'kind': u'sj#playlistEntry', u'deleted': False, u'trackId': u'Tychwpm4n3usjm3a4yaekiijoyy', u'lastModifiedTimestamp': u'1381612231781729', u'playlistId': u'014a555c-1b8c-4a5f-b25c-c33d02b5df0b', u'clientId': u'48193b8f-8add-409e-af19-7d3e707726f5', u'source': u'2', u'track': {u'album': u'Whoomp! (There It Is)', u'kind': u'sj#track', u'storeId': u'Tychwpm4n3usjm3a4yaekiijoyy', u'artist': u'Tag Team', u'albumArtRef': [{u'url': u'http://lh6.ggpht.com/xsrwjk2Vu_WMvznEnzDy7M9HqlZve5uJtnVWOYIJgwonCduS5QFrZc5sbXSmokbA1Rb-zcYS6Hk'}], u'trackAvailableForPurchase': True, u'title': u'Whoop! (There It Is)', u'nid': u'ychwpm4n3usjm3a4yaekiijoyy', u'estimatedSize': u'9012277', u'albumId': u'Brkqegqf6rkvxakmcf2ubymdlfi', u'artistId': [u'Alzzmk5cdvw5r2gcfkdpecy7trm'], u'albumArtist': u'Tag Team', u'durationMillis': u'225000', u'composer': u'', u'genre': u'Hip-Hop/Rap', u'trackNumber': 1, u'discNumber': 1, u'artistArtRef': [{u'url': u'http://lh6.ggpht.com/9elkFUB_FmwKCwCC9NUd_6jGupmFy-xzHJpXIOOoFHkU0O7P_tALxADb9WxnRvEjlGZGRcap'}], u'trackType': u'7', u'albumAvailableForPurchase': True}, u'absolutePosition': u'01729382256910467071', u'creationTimestamp': u'1381612231781729', u'id': u'faafe553-3cdd-3c22-91f0-319c22dfb3e4'}], u'ownerProfilePhotoUrl': u'http://lh5.googleusercontent.com/-Kt8leKea5As/AAAAAAAAAAI/AAAAAAAAB1Y/XQ7zJSUW2E8/photo.jpg', u'ownerName': u'Johnathan Henton', u'accessControlled': False, u'creationTimestamp': u'1381611145081784', u'id': u'014a555c-1b8c-4a5f-b25c-c33d02b5df0b', u'description': u'test!'}
jeh commented 11 years ago

here is what is returned by the API for a public playlist that contains 18 songs.

  {u'kind': u'sj#playlist', u'name': u'A Funky 4th BBQ', u'deleted': False, u'type': u'SHARED', u'lastModifiedTimestamp': u'1375519708167341', u'recentTimestamp': u'1375519708164000', u'shareToken': u'AMaBXymQDVFkgknWPTBX29fZ5DbBHbIZU9WWBeTXTJAutuPmu-XAeZqtXtztCygdbnws_5pq1BdwMbyVdRZlBbEeGlelnr5Lew==', 'tracks': [], u'ownerName': u'Sam Chennault', u'creationTimestamp': u'1375519708167341', u'id': u'dfd1045b-bc5d-4d44-814f-aa268ed9c025', u'description': u'This is the season for cold beer and hot sauce, and to celebrate America\'s finest outdoors culinary tradition, we\'ve compiled some of our favorite funky BBQ jams. This playlist spans from \'70s funk classics such as War\'s "Low Rider" and Rick James\' "Super Freak" to the laid-back West Coast hip-hop of Snoop and Digital Underground. Light the charcoal, put on your flip-flops and press play for good times. '}
hechtus commented 11 years ago

Great, thanks. It seems that tracks not being in the library have a trackId prefixed with a 'T'. I suspected this, because it is mentioned in the API documentation. The good thing is, that also the track information is provided. So I simply have to translate this. Should be doable.

Regarding the public playlist. Did you cut out the information about all the tracks? The tracks array is empty in your post. If you left it out, do the tracks look the same as in your playlist? With the trackId prefixed with a 'T' and the whole track information provided?

jeh commented 11 years ago

No I didn't cut out the information about the tracks, there's nothing there.. I have a bunch of public playlists and they are all like that.

hechtus commented 11 years ago

Hmm, strange. This (public playlists) can definitely not being resolved with the current API. We should ask the maintainer of the API ... I will write an issue for this.

hechtus commented 11 years ago

I created branch feature/all-access-playlists and committed 057f5338039662325a245290c052ad22446226dc as a playground to solve this. You may try this branch together with the development version of gmusicapi (The current release of gmusicapi does not support fetching the album and track info of an All Access track).

jeh commented 11 years ago

this seems to work for my user created playlist that references all access tracks that are not in my library... cool!

hechtus commented 11 years ago

Great! If you experience more issues or have any ideas feel free to share them. This was a blindly written patch, I was not able to test, so any further contributions are welcome.

woutervanwijk commented 11 years ago

Seems to work ok with MusicBox now, thanks! I'll include this in the alpha2 of 0.4

hechtus commented 11 years ago

I merged the changes into the develop branch as gmusicapi 3.0.0 is out. There is still missing public playlist support. The gmusicapi now has the Mobileclient.get_shared_playlist_contents(share_token) function, but I'm not sure how to use it. Anyone who can help?

jeh commented 10 years ago

I can help you test it, but I have no idea how the API works either ;)

hechtus commented 10 years ago

It would really help if you could try the relevant Mobileclient API functions and send me the public playlist related output of those. Relevant functions are get_all_playlists() and get_shared_playlist_contents(). To protect your privacy you may also consider to send me an email instead of pasting it here. I guess, get_shared_playlist_contents() expects the share_tokens that are returned by get_all_playlists().

DelusionalLogic commented 10 years ago

This works perfectly for me.

hechtus commented 10 years ago

Can be closed. Done by @jeh.