Closed jdarnold closed 9 years ago
I get the same error with certain search terms. Seems to occur when there are lots of overall results even while limiting api.search_all_access(s, 10)
. For example, error occurs with "I Got U Duke Dumont" but not with "Busy Earnin' Jungle". However the results are still usable as demonstrated below, can still add to playlists:
#!/usr/bin/python
s = "I Got U Duke Dumont" # error occurs with this search term
# s = "Busy Earnin' Jungle" # but not with this one
from gmusicapi import Mobileclient
#Google account details
email = 'YOUR EMAIL HERE'
password = 'YOUR PASSWORD HERE'
global api
api = Mobileclient()
logged_in = api.login(email, password)
# logged_in is True if login was successful
if not logged_in:
print('Failed to login to Google Play Music, check username and password\n')
sys.exit()
print('\nLogged into Google Play Music, username: "%s"' % email)
results = api.search_all_access(s, 10)['song_hits']
playlist_id = api.create_playlist("new")
for r in results:
print('\n\n')
print(r)
api.add_songs_to_playlist(playlist_id, r['track']['nid'])
I've been seeing this error too.
This seems to be showing up for searches that may be using a sub-optimal query string like a misspelled artist or title or for a search that the algorithms determined that it took a while to come up with a result. Google may be returning a suggestedQuery string so that next time if the same song is searched for again the suggestedQuery will return a quicker result, something like the 'did you mean:' thing that pops up on google's regular search.
Thanks for digging into this, folks!
Closed by #307.
A new one when searching All Access: