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

Some tracks don't play #148

Closed jjok closed 8 years ago

jjok commented 8 years ago

I get an error saying that I need to have All Access to play one of my tracks, when I have All Access disabled.

This doesn't happen with all tracks. I wonder if tracks that are available on All Access won't play if you don't have All Access?

2016-09-10 10:50:46,907 INFO [1075:Thread-8] mopidy_gmusic.backend: Finished refreshing Google Music playlists in 206s
2016-09-10 10:50:53,696 INFO [1075:Thread-7] mopidy_gmusic.backend: Finished refreshing Google Music library in 213s
2016-09-10 10:51:22,469 WARNING [1075:GMusicBackend-6] mopidy_gmusic.session: Google Play Music All Access is required for get_artist_info()
2016-09-10 10:51:38,794 ERROR [1075:Core-9] mopidy.core.playback: GMusicBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/playback.py", line 411, in _change
    if not backend.playback.change_track(pending_tl_track.track).get():
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy/backend.py", line 245, in change_track
    uri = self.translate_uri(track.uri)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_gmusic/playback.py", line 24, in translate_uri
    track_id, quality=quality)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_gmusic/session.py", line 32, in inner_wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_gmusic/session.py", line 90, in get_stream_url
    return self.api.get_stream_url(song_id, quality=quality)
  File "<decorator-gen-84>", line 2, in get_stream_url
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/utils/utils.py", line 296, in wrapper
    return function(*args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/mobileclient.py", line 321, in get_stream_url
    raise NotSubscribed("Store tracks require a subscription to stream.")
NotSubscribed: Store tracks require a subscription to stream. (https://goo.gl/v1wVHT)
2016-09-10 10:51:38,832 WARNING [1075:Core-9] mopidy.core.tracklist: Track is not playable: gmusic:track:Tj2zeoj26dmd4p33otwupjnzdn4
belak commented 8 years ago

For reference:

{u'album': u'American Football [Deluxe Edition]',
 u'albumArtRef': [{u'aspectRatio': u'1',
                   u'autogen': False,
                   u'kind': u'sj#imageRef',
                   u'url': u'http://lh6.ggpht.com/PqRxGvlc8CShsGvpEbUw7_0cYOEcuCC9p_66L-4LMJjNzLAhxGcncnLmGnY_n6EFpQh72FCe4F8'}],
 u'albumArtist': u'American Football',
 u'albumAvailableForPurchase': False,
 u'albumId': u'Bctqqgfgze6rxo7gaxbxjiqvwx4',
 u'artist': u'American Football',
 u'artistId': [u'Ad5idgogh22qeuhrgmtt3jobii4',
               u'Agnz2vpqyvxxv34vffo2wsz5qva',
               u'Az4ooqhdc2b7bx5ztlon7dhnu4a',
               u'Ad3tpj6wqagl2gdljdhctvnx4ou',
               u'Axjvry4wz45hdimnkjj5ya64pxe',
               u'A4sd56337v5nozzano7zeizo76i',
               u'Aknw5xn7yveyy4vgyq6o4ufuuuu'],
 u'composer': u'Michael Thomas Kinsella; Stephen Michael Holmes; Steven Joseph Lamos',
 u'discNumber': 1,
 u'durationMillis': u'268000',
 u'estimatedSize': u'10736353',
 u'explicitType': u'2',
 u'genre': u'Emo/Hardcore',
 u'kind': u'sj#track',
 u'nid': u'Tj2zeoj26dmd4p33otwupjnzdn4',
 u'primaryVideo': {u'id': u'_NfnXdXpjL0',
                   u'kind': u'sj#video',
                   u'thumbnails': [{u'height': 180,
                                    u'url': u'https://i.ytimg.com/vi/_NfnXdXpjL0/mqdefault.jpg',
                                    u'width': 320}]},
 u'storeId': u'Tj2zeoj26dmd4p33otwupjnzdn4',
 u'title': u'Never Meant',
 u'trackAvailableForPurchase': True,
 u'trackAvailableForSubscription': True,
 u'trackNumber': 1,
 u'trackType': u'7',
 u'year': 1999}

Is this a track that's been uploaded, purchased from the store, or something else?

jjok commented 8 years ago

Yes, that's the right track. All my music has been ripped and uploaded.

belak commented 8 years ago

track_id = song.get('storeId', song.get('id', song.get('nid')))

It looks like this may have been caused by my refactor... the main complication comes from the fact that I try to sanitize the track ID by converting them to the storeId if possible, but I guess that's a bad idea for reasons like this.

I'll try to get a fix out in the next day or two (hopefully today)

belak commented 8 years ago

I've pushed a potential fix to the develop branch. Could you let me know if you're still having problems?

jjok commented 8 years ago

Great! I'll give it a go. Thanks.

jjok commented 8 years ago

Yep. That seems to have worked. Well, I can play that track :)

Thanks. I'll close this for now.