gmusicapi
gmusicapi copied to clipboard
Some queries seem to be missing the first letter in their nid
So far I have noticed this with search results. A track result the nid will be missing the leading T
Same goes for artists
Huh. Are they still store tracks? Or are you seeing some new kind of track? Can you post a few example ids?
It looks like this comment may have noticed the same thing: https://github.com/simon-weber/gmusicapi/issues/358#issuecomment-304250251.
s = SearchResults(query='Audioslave')
p=s.results['playlist_hits']
g=p[0]
p=api.get_shared_playlist_contents(share_token=g['playlist']['shareToken'])
c=p[0]
k=c['track']
s=Song(k)
s._dict['nid']
'q2pi5znqumpbakzyia4d6wabsq'
g=api.get_track _info(store_track_id=t._dict['storeId'])
t._dict['albumId'].startswith('B')
False
g['albumId']
'Brx6cfl4cnd47vi5fuwu7nozzwu'
t._dict
``
{'album': 'Audioslave',
'albumArtRef': [{'aspectRatio': '1',
'autogen': False,
'kind': 'sj#imageRef',
'url': 'http://lh3.googleusercontent.com/smWyGl1oLQE6vSh4UASDLmpYDt7aqTgc0jxbcZGoUIf018KHLeAZyoSp6C-7lQYpBYrrRDzYKy4'}],
'albumArtist': 'Audioslave',
'albumAvailableForPurchase': True,
'albumId': 'rx6cfl4cnd47vi5fuwu7nozzwu',
'artist': 'Audioslave',
'artistId': ['4ii74rlqtoou3xego7kq2qlrwy'],
'composer': '',
'discNumber': 1,
'durationMillis': '277000',
'estimatedSize': '11116696',
'explicitType': '2',
'genre': 'Alt Metal',
'kind': 'sj#track',
'nid': 'abda5tzj2oc2swipsw2znml3sq',
'primaryVideo': {'id': 'vVXIK1xCRpY',
'kind': 'sj#video',
'thumbnails': [{'height': 180,
'url': 'https://i.ytimg.com/vi/vVXIK1xCRpY/mqdefault.jpg',
'width': 320}]},
'storeId': 'Tabda5tzj2oc2swipsw2znml3sq',
'title': 'Show Me How to Live',
'trackAvailableForPurchase': True,
'trackAvailableForSubscription': True,
'trackNumber': 2,
'trackType': '7',
'year': 2002}
Also sounds like #530, where some tracks are missing the leading T. Using 'storeId' instead of 'nid' has been working fine for me.
Well wouldn't we want to make as little amount of API calls as we can