soulfx / gmusic-playlist

playlist scripts for gmusic
MIT License
158 stars 57 forks source link

Dependency issue? #28

Closed pommedeterresautee closed 8 years ago

pommedeterresautee commented 8 years ago

Hi,

I installed manually the gmusicapi depedency as required by the readme (using he correct commit) but can t make the module work.

Below is my error message:

$ python ExportLists.py ../export/
Logging into google music...
XXX@gmail.com's password: 
Login Successful.
Traceback (most recent call last):
  File "ExportLists.py", line 17, in <module>
    api = open_api()
  File "/Users/XXX/Downloads/gmusic-playlist-master/common.py", line 151, in open_api
    dlog(u'Available track details: '+str(get_google_track_details()))
  File "/Users/XXX/Downloads/gmusic-playlist-master/common.py", line 63, in get_google_track_details
    results = api.search_all_access(sample_song,max_results=1).get('song_hits')
  File "/Users/XXX/anaconda/lib/python2.7/site-packages/gmusicapi-7.0.0.dev0-py2.7.egg/gmusicapi/clients/mobileclient.py", line 938, in search_all_access
    res = self._make_call(mobileclient.Search, query, max_results)
  File "/Users/XXX/anaconda/lib/python2.7/site-packages/gmusicapi-7.0.0.dev0-py2.7.egg/gmusicapi/clients/shared.py", line 80, in _make_call
    return protocol.perform(self.session, self.validate, *args, **kwargs)
  File "/Users/XXX/anaconda/lib/python2.7/site-packages/gmusicapi-7.0.0.dev0-py2.7.egg/gmusicapi/protocol/shared.py", line 225, in perform
    raise CallFailure(err_msg, call_name)
gmusicapi.exceptions.CallFailure: Search: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v1.11/query?q=one+u2&max-results=1
(requests kwargs: {'url': 'https://mclients.googleapis.com/sj/v1.11/query', 'headers': {'Authorization': '<omitted>'}, 'params': {'q': 'one u2', 'max-results': 1}, 'method': 'GET'})
(response was: '{\n "error": {\n  "errors": [\n   {\n    "domain": "global",\n    "reason": "notFound",\n    "message": "Not Found"\n   }\n  ],\n  "code": 404,\n  "message": "Not Found"\n }\n}\n')

Any idea?

Kind regards, Michael

soulfx commented 8 years ago

The code should work for both all access and non all access accounts. I've tested on accounts with and without to verify it works, but maybe there is a difference.

Do you have an all access subscription? if so, did you just recently get it? Can you try changing the code to look for another song besides the default? Change line 62 in common.py to a different song.

If you don't have all access can you replace calls to api.search_all_access with an empty list and see if that fixes the issue? For example at line 63 in common.py results = []

pommedeterresautee commented 8 years ago

Thank you @soulfx . Indeed I do not have all access, and I applied your solution (empty list). It worked as expected!

Kind regards, Michael