When playing a playlist using gmusic plugin the list of playlists is presented but when you try to select an individual playlist it fails.
OS: Raspbian using Moode audio player
Client: BubbleUPNP
Latest version version of code.
The session.py is throwing an exception resulting in an empty array then trying to get playlist tracks.
To get the stack trace I removed the try block and also dumped trkl[0]
diff --git a/src/mediaserver/cdplugins/gmusic/session.py b/src/mediaserver/cdplugins/gmusic/session.py
index 29684b2..40e3d2a 100644
--- a/src/mediaserver/cdplugins/gmusic/session.py
+++ b/src/mediaserver/cdplugins/gmusic/session.py
@@ -100,10 +100,11 @@ class Session(object):
for item in data if item['id'] == playlist_id]
if not trkl:
return []
- try:
- return [self.lib_tracks[track['trackId']] for track in trkl[0]]
- except:
- return []
+ self.dmpdata("user_playlist_content", trkl[0])
+ #try:
+ return [self.lib_tracks[track['trackId']] for track in trkl[0]]
+ #except:
+ # return []
here is the log:
Jul 4 08:38:55 moto upmpdcli[25319]: user_playlist_content: [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#playlistEntry", Jul 4 08:38:55 moto upmpdcli[25319]: "deleted": false, Jul 4 08:38:55 moto upmpdcli[25319]: "trackId": "Ts4kgatazvraki5hmrafq6vvwxq", Jul 4 08:38:55 moto upmpdcli[25319]: "lastModifiedTimestamp": "1530702235510914", Jul 4 08:38:55 moto upmpdcli[25319]: "playlistId": "15b79d0e-34dd-43f4-a396-ee4a0c7b78d2", Jul 4 08:38:55 moto upmpdcli[25319]: "clientId": "58e46f75-40e5-46f3-8641-8b715b61665d", Jul 4 08:38:55 moto upmpdcli[25319]: "source": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "track": { Jul 4 08:38:55 moto upmpdcli[25319]: "albumArtRef": [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "url": "http://lh4.ggpht.com/ZX8BnZYmS3yRo8kyb1vp5T__noItI37Su2mN6cta1kkGevjkpFEPNOc5UWGFzFSDUyj5UDiE", Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#imageRef", Jul 4 08:38:55 moto upmpdcli[25319]: "aspectRatio": "1", Jul 4 08:38:55 moto upmpdcli[25319]: "autogen": false Jul 4 08:38:55 moto upmpdcli[25319]: } Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "artistId": [ Jul 4 08:38:55 moto upmpdcli[25319]: "Amye57j6ccit4r342ciwjldj6qu" Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "composer": "", Jul 4 08:38:55 moto upmpdcli[25319]: "year": 1977, Jul 4 08:38:55 moto upmpdcli[25319]: "trackAvailableForSubscription": true, Jul 4 08:38:55 moto upmpdcli[25319]: "trackType": "7", Jul 4 08:38:55 moto upmpdcli[25319]: "album": "Sweet Forgiveness", Jul 4 08:38:55 moto upmpdcli[25319]: "title": "Runaway (Remastered)", Jul 4 08:38:55 moto upmpdcli[25319]: "albumArtist": "Bonnie Raitt", Jul 4 08:38:55 moto upmpdcli[25319]: "trackNumber": 2, Jul 4 08:38:55 moto upmpdcli[25319]: "discNumber": 1, Jul 4 08:38:55 moto upmpdcli[25319]: "albumAvailableForPurchase": false, Jul 4 08:38:55 moto upmpdcli[25319]: "explicitType": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "trackAvailableForPurchase": true, Jul 4 08:38:55 moto upmpdcli[25319]: "storeId": "Ts4kgatazvraki5hmrafq6vvwxq", Jul 4 08:38:55 moto upmpdcli[25319]: "nid": "s4kgatazvraki5hmrafq6vvwxq", Jul 4 08:38:55 moto upmpdcli[25319]: "estimatedSize": "9498149", Jul 4 08:38:55 moto upmpdcli[25319]: "albumId": "B7nodbdrkl2ieeoaelboy6ccjim", Jul 4 08:38:55 moto upmpdcli[25319]: "genre": "Rock", Jul 4 08:38:55 moto upmpdcli[25319]: "artistArtRef": [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "url": "http://lh3.googleusercontent.com/WcA8tQ1hMj2VuxToD80eT_-PkWYFQvrm7hJJs-aFlsFcEhAuLEVjb9yuXlyWtruROtuHojTmoA", Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#imageRef", Jul 4 08:38:55 moto upmpdcli[25319]: "aspectRatio": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "autogen": false Jul 4 08:38:55 moto upmpdcli[25319]: } Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#track", Jul 4 08:38:55 moto upmpdcli[25319]: "artist": "Bonnie Raitt", Jul 4 08:38:55 moto upmpdcli[25319]: "durationMillis": "237000" Jul 4 08:38:55 moto upmpdcli[25319]: }, Jul 4 08:38:55 moto upmpdcli[25319]: "absolutePosition": "01729382256910270462", Jul 4 08:38:55 moto upmpdcli[25319]: "creationTimestamp": "1530702235510914", Jul 4 08:38:55 moto upmpdcli[25319]: "id": "e37d1c01-a438-3a6f-b051-53e825d4d03d" Jul 4 08:38:55 moto upmpdcli[25319]: }, Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#playlistEntry", Jul 4 08:38:55 moto upmpdcli[25319]: "deleted": false, Jul 4 08:38:55 moto upmpdcli[25319]: "trackId": "Tbl33cjiwp3oxwnc2bam4l3nrzy", Jul 4 08:38:55 moto upmpdcli[25319]: "lastModifiedTimestamp": "1530702459356877", Jul 4 08:38:55 moto upmpdcli[25319]: "playlistId": "15b79d0e-34dd-43f4-a396-ee4a0c7b78d2", Jul 4 08:38:55 moto upmpdcli[25319]: "clientId": "153423c5-1746-423b-9215-bacf495168a7", Jul 4 08:38:55 moto upmpdcli[25319]: "source": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "track": { Jul 4 08:38:55 moto upmpdcli[25319]: "albumArtRef": [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "url": "http://lh3.googleusercontent.com/rNwT0xIrs9NHsdvLyTOx3SUfpD60Qbr47XJ6x073ndtKfWcZaL0oU9WVnfReolfG8qGm_dJuLQ", Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#imageRef", Jul 4 08:38:55 moto upmpdcli[25319]: "aspectRatio": "1", Jul 4 08:38:55 moto upmpdcli[25319]: "autogen": false Jul 4 08:38:55 moto upmpdcli[25319]: } Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "artistId": [ Jul 4 08:38:55 moto upmpdcli[25319]: "Akr7r2ux5neoky3wbgrfxi6zb4u" Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "composer": "", Jul 4 08:38:55 moto upmpdcli[25319]: "year": 1991, Jul 4 08:38:55 moto upmpdcli[25319]: "trackAvailableForSubscription": true, Jul 4 08:38:55 moto upmpdcli[25319]: "trackType": "7", Jul 4 08:38:55 moto upmpdcli[25319]: "album": "The Commitments (Soundtrack)", Jul 4 08:38:55 moto upmpdcli[25319]: "title": "Try A Little Tenderness", Jul 4 08:38:55 moto upmpdcli[25319]: "albumArtist": "The Commitments", Jul 4 08:38:55 moto upmpdcli[25319]: "trackNumber": 7, Jul 4 08:38:55 moto upmpdcli[25319]: "discNumber": 1, Jul 4 08:38:55 moto upmpdcli[25319]: "albumAvailableForPurchase": false, Jul 4 08:38:55 moto upmpdcli[25319]: "explicitType": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "trackAvailableForPurchase": true, Jul 4 08:38:55 moto upmpdcli[25319]: "storeId": "Tbl33cjiwp3oxwnc2bam4l3nrzy", Jul 4 08:38:55 moto upmpdcli[25319]: "nid": "bl33cjiwp3oxwnc2bam4l3nrzy", Jul 4 08:38:55 moto upmpdcli[25319]: "estimatedSize": "10934894", Jul 4 08:38:55 moto upmpdcli[25319]: "albumId": "Bgkroyijxcfw72o5p3teq4s6kmu", Jul 4 08:38:55 moto upmpdcli[25319]: "genre": "Soundtracks", Jul 4 08:38:55 moto upmpdcli[25319]: "playCount": 1, Jul 4 08:38:55 moto upmpdcli[25319]: "artistArtRef": [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "url": "http://lh3.googleusercontent.com/Oju7EIzFI0KqWuAGxL9ZSYM6EUgNM6o8aDzTJA5ajeqriNtkAvN9IjRPWkww8aWsWXig2UPJHw", Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#imageRef", Jul 4 08:38:55 moto upmpdcli[25319]: "aspectRatio": "2", Jul 4 08:38:55 moto upmpdcli[25319]: "autogen": false Jul 4 08:38:55 moto upmpdcli[25319]: } Jul 4 08:38:55 moto upmpdcli[25319]: ], Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#track", Jul 4 08:38:55 moto upmpdcli[25319]: "artist": "The Commitments", Jul 4 08:38:55 moto upmpdcli[25319]: "durationMillis": "273000" Jul 4 08:38:55 moto upmpdcli[25319]: }, Jul 4 08:38:55 moto upmpdcli[25319]: "absolutePosition": "02017612633061982205", Jul 4 08:38:55 moto upmpdcli[25319]: "creationTimestamp": "1530702459356877", Jul 4 08:38:55 moto upmpdcli[25319]: "id": "76816520-19a0-3b3c-aa45-ef39e23ac81d" Jul 4 08:38:55 moto upmpdcli[25319]: } Jul 4 08:38:55 moto upmpdcli[25319]: ] Jul 4 08:38:55 moto upmpdcli[25319]: CMDTALK: gmusic-app.py: processmessage: processor raised: [u'Ts4kgatazvraki5hmrafq6vvwxq'] Jul 4 08:38:55 moto upmpdcli[25319]: Traceback (most recent call last): Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/pycommon/cmdtalk.py", line 172, in processmessage Jul 4 08:38:55 moto upmpdcli[25319]: outfields = processor.process(params) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/pycommon/cmdtalkplugin.py", line 54, in process Jul 4 08:38:55 moto upmpdcli[25319]: return self.dispatcher.run(params[prcnmkey], params) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/pycommon/cmdtalkplugin.py", line 37, in run Jul 4 08:38:55 moto upmpdcli[25319]: return func(params) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/gmusic/gmusic-app.py", line 167, in browse Jul 4 08:38:55 moto upmpdcli[25319]: plugin.run([idpath]) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/pycommon/routing.py", line 115, in run Jul 4 08:38:55 moto upmpdcli[25319]: self._dispatch(path) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/pycommon/routing.py", line 126, in _dispatch Jul 4 08:38:55 moto upmpdcli[25319]: view_func(**kwargs) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/gmusic/gmusic-app.py", line 277, in playlist_view Jul 4 08:38:55 moto upmpdcli[25319]: track_list(session.get_user_playlist_tracks(playlist_id)) Jul 4 08:38:55 moto upmpdcli[25319]: File "/usr/share/upmpdcli/cdplugins/gmusic/session.py", line 105, in get_user_playlist_tracks Jul 4 08:38:55 moto upmpdcli[25319]: return [self.lib_tracks[track['trackId']] for track in trkl[0]] Jul 4 08:38:55 moto upmpdcli[25319]: KeyError: u'Ts4kgatazvraki5hmrafq6vvwxq' Jul 4 08:38:55 moto upmpdcli[25319]: :4:src/mediaserver/cdplugins/cmdtalk-fixed.cpp:140::CmdTalk: Got empty line Jul 4 08:38:56 moto upmpdcli[25319]: :2:src/mediaserver/cdplugins/plgwithslave.cxx:523::PlgWithSlave::browse: slave failure
Discussion
-
medoc
2018-07-05- Description has changed:
Diff:
--- old +++ new @@ -30,6 +30,7 @@ here is the log: +~~~~ Jul 4 08:38:55 moto upmpdcli[25319]: user_playlist_content: [ Jul 4 08:38:55 moto upmpdcli[25319]: { Jul 4 08:38:55 moto upmpdcli[25319]: "kind": "sj#playlistEntry", @@ -161,3 +162,4 @@ Jul 4 08:38:55 moto upmpdcli[25319]: :4:src/mediaserver/cdplugins/cmdtalk-fixed.cpp:140::CmdTalk: Got empty line Jul 4 08:38:56 moto upmpdcli[25319]: :2:src/mediaserver/cdplugins/plgwithslave.cxx:523::PlgWithSlave::browse: slave failure +~~~~
- milestone: -->
-
medoc
2018-07-05I am not subscribed at gmusic at the moment, only had a subscription a short while while checking that things mostly worked.
After having a look at the Mopidy code, I made a change to session.py which I think should go in the direction of fixing the problem (process non-user tracks differently). Could you give it a try ?
Last edit: medoc 2018-07-05-
David Stilwell
2018-07-05I tried the latest change but still getting an empty playlist and service failure in BubbleUp. I was able to get this working by creating a track parser for playlist entries. They are formatted differently than album tracks. You have to get the trackId from the entry and the rest of the data from the track element. I'll attached the fixed version of session.py.
Attachments
-
medoc
2018-07-06Hi,
I tried to merge both track parsing methods to avoid too much code duplication (also I think that the 'artist' part was wrong in your version). Please give it a try.
-
David Stilwell
2018-07-06Works perfect, thanks so much!
You can remove trackId, it will never gets passed since it is outside the track element. It is working now because you added storeId. (ticket #16)
"trackId": "Tbl33cjiwp3oxwnc2bam4l3nrzy", "track": { "storeId": "Tbl33cjiwp3oxwnc2bam4l3nrzy", }
-
medoc
2018-07-06Agreed, it's never used currently, because tracks from the user lib have an "id" so their trackId is not used either. Anyway, lacking a description of the data, I'll keep it anyway...
-
medoc
2018-07-06And by the way, how did you set up the login part? I re-started a subscribtion, and I couldn't stream anything until I actually set an app password and gmusicdeviceid as per https://github.com/simon-weber/gmusicapi/issues/590
Did you have to go through the same hoops ? I'll need to update the doc then.
Last edit: medoc 2018-07-06-
David Stilwell
2018-07-06I had to use an app password since I was using two factor authentication. I also had to set a valid mac address.
-
medoc
2018-07-06Thanks. It seems that it is necessary now to have both an app password and an Android device id. I'll at least update the doc, and see if I can do something in the code to make things easier.
-
medoc
2018-07-06Fixed by properly parsing embedded track data in playlists.