Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

search() method in MobileClient doesn't work on non-paid accounts #474

Closed
askvictor opened this issue Jul 10, 2016 · 18 comments
Closed

search() method in MobileClient doesn't work on non-paid accounts #474

askvictor opened this issue Jul 10, 2016 · 18 comments

Comments

@askvictor
Copy link

After a successful login on the MobileClient, if I try to do a search using a non-subscription account, I get the following:

In [4]: s=api.search("neutral",100)
---------------------------------------------------------------------------
CallFailure                               Traceback (most recent call last)
<ipython-input-4-00d472560fe7> in <module>()
----> 1 s=api.search("neutral",100)

/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/mobileclient.py in search(self, query, max_results)
   1217         """
   1218 
-> 1219         res = self._make_call(mobileclient.Search, query, max_results)
   1220 
   1221         hits = res.get('entries', [])

/usr/local/lib/python2.7/dist-packages/gmusicapi/clients/shared.pyc in _make_call(self, protocol, *args, **kwargs)
     82         CallFailure may be raised."""
     83 
---> 84         return protocol.perform(self.session, self.validate, *args, **kwargs)
     85 
     86     def is_authenticated(self):

/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/shared.pyc in perform(cls, session, validate, *args, **kwargs)
    226                     err_msg += "\n(response was: %r)" % response.text
    227 
--> 228                 raise CallFailure(err_msg, call_name)
    229 
    230         try:

CallFailure: Search: 404 Client Error: Not Found for url: https://mclients.googleapis.com/sj/v2.4/query?q=neutral&max-results=100&tier=fr&hl=en_US&ct=1%2C2%2C3%2C4%2C6%2C7%2C8
(requests kwargs: {u'url': u'https://mclients.googleapis.com/sj/v2.4/query', u'headers': {u'Authorization': u'<omitted>'}, u'params': {u'q': 'neutral', u'max-results': 100, u'tier': u'fr', u'hl': u'en_US', u'ct': u'1,2,3,4,6,7,8'}, u'method': u'GET'})
(response was: u'{\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')

It works fine on a subscription account.

@thebigmunch
Copy link
Contributor

thebigmunch commented Jul 10, 2016

The same search works fine for me on a free account. If you haven't tried it again after a while, do so; sometimes Google's servers just get flaky. If it still fails, the cause could be something else.

@askvictor
Copy link
Author

Funny thing is if I log in with a subscription account, it works fine, then logout and log in with a free account, it still fails. Suspect it's not a server flake problem

@thebigmunch
Copy link
Contributor

@askvictor: Is this still happening for you?

@askvictor
Copy link
Author

@thebigmunch yep; still a problem :(

@thebigmunch
Copy link
Contributor

Can you give it a try with the current develop branch: pip install --upgrade git+https://github.com/simon-weber/gmusicapi@develop

@askvictor
Copy link
Author

askvictor commented Aug 11, 2016

No dice; tried develop with a couple of different accounts, and all the same issue. Other API calls work fine.

@foxy82
Copy link

foxy82 commented Nov 3, 2016

I'm seeing the same - I get this error:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/gmusicapi/protocol/shared.py", line 218, in perform
response.raise_for_status()
File "/usr/local/lib/python3.5/dist-packages/requests/models.py", line 862, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url:
https://mclients.googleapis.com/sj/v2.5/query?dv=0&max-
results=50&q=Happy&tier=fr&hl=en_US&ct=1%2C2%2C3%2C4%2C6%2C7%2C8%2C9

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "get_search.py", line 12, in
search_results = api.search(query)
File "/usr/local/lib/python3.5/dist-packages/gmusicapi/clients/mobileclient.py", line 1806, in search
res = self._make_call(mobileclient.Search, query, max_results)
File "/usr/local/lib/python3.5/dist-packages/gmusicapi/clients/shared.py", line 84, in _make_call
return protocol.perform(self.session, self.validate, _args, *_kwargs)
File "/usr/local/lib/python3.5/dist-packages/gmusicapi/protocol/shared.py", line 226, in perform
raise CallFailure(err_msg, call_name)
gmusicapi.exceptions.CallFailure: Search: 404 Client Error: Not Found for url: >https://mclients.googleapis.com/sj/v2.5/query?dv=0&max-
results=50&q=Happy&tier=fr&hl=en_US&ct=1%2C2%2C3%2C4%2C6%2C7%2C8%2C9
(requests kwargs: {'params': {'dv': 0, 'max-results': 50, 'q': 'Happy', 'tier': 'fr', 'hl': 'en_US', 'ct':
'1,2,3,4,6,7,8,9'}, 'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/query', 'headers':
{'Authorization': ''}})
(response was: '{"error":{"errors":[{"domain":"global","reason":"notFound","message":"Not
Found"}],"code":404,"message":"Not Found"}}')

@gowthamgts
Copy link

Am also getting the same error.

@simon-weber
Copy link
Owner

Hm, this is working fine in the build, too: https://travis-ci.org/simon-weber/gmusicapi/jobs/175548533#L514.

Can you think of something that might be different between our accounts that's keeping us from reproducing this? One thought is that it could be region-specific: do you mind sharing where your accounts were registered? So far we have coverage of US and French accounts, which both seem to work.

@foxy82
Copy link

foxy82 commented Nov 13, 2016

Hey,

I'm in the UK. Free account.

@askvictor
Copy link
Author

I'm in Australia.

@rubik
Copy link

rubik commented Dec 31, 2016

Italy, free account. I'm getting the same error.

@grappendorf
Copy link

grappendorf commented Jan 3, 2017

Germany, free account, app password => 404.

Btw. i also tried the NodeJS package playmusic and the search also returns 404. Seems to be a general problem with the Google music API for some accounts.

@simon-weber
Copy link
Owner

Weird. Can someone with the 404 try reproducing it through a US vpn? It might be your actual location, rather than where the account was registered.

Either way, it sounds like we should add this to the docs, and maybe reraise the 404 as a CallFailure with more explanation.

@ndg63276
Copy link

ndg63276 commented Jan 6, 2017

UK, free account, same error here.

@simon-weber
Copy link
Owner

Has anyone seen this recently?

@ndg63276
Copy link

Seems to work ok here. Free account, UK based.

@simon-weber
Copy link
Owner

Sounds like this was something on Google's end.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants