christopher-dG / gpymusic

Google Py Music: A simple TUI client for Google Play Music
MIT License
200 stars 13 forks source link

search with no arguments crash #1

Closed jackkinsey closed 7 years ago

jackkinsey commented 7 years ago

When I run the s command with no arguments, pmcli crashes. Also, in xterm, it apparently makes the terminal stop writing newlines or something?

Searching for 'None'...Traceback (most recent call last):
Now playing: None                                          File "/usr/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 218, in perform
> s                                                                                                                                                      response.raise_for_status()
                                                                                                                                                                                      File "/usr/lib/python3.6/site-packages/requests/models.py", line 909, in raise_for_status
                                                                        raise HTTPError(http_error_msg, response=self)
                                                                                                                      requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://mclients.googleapis.com/sj/v2.5/query?ct=1%2C2%2C3%2C4%2C6%2C7%2C8%2C9&max-results=19&hl=en_US&dv=0&tier=fr

                                                                                                    During handling of the above exception, another exception occurred:

                                                                                                                                                                       Traceback (most recent call last):
                                                                                                                                                                                                           File "/usr/local/bin/pmcli", line 496, in <module>
                                                      transition(get_input())
                                                                               File "/usr/local/bin/pmcli", line 47, in transition
                                                                                                                                      commands[command](arg)
                                                                                                                                                              File "/usr/local/bin/pmcli", line 416, in search
       result = api.search(query, max_results=limit)
                                                      File "/usr/lib/python3.6/site-packages/gmusicapi/clients/mobileclient.py", line 1820, in search
                                                                                                                                                         res = self._make_call(mobileclient.Search, query, max_results)
              File "/usr/lib/python3.6/site-packages/gmusicapi/clients/shared.py", line 84, in _make_call
                                                                                                             return protocol.perform(self.session, self.validate, *args, **kwargs)
                                                                                                                                                                                    File "/usr/lib/python3.6/site-packages/gmusicapi/protocol/shared.py", line 226, in perform
                                                                       raise CallFailure(err_msg, call_name)
                                                                                                            gmusicapi.exceptions.CallFailure: Search: 400 Client Error: Bad Request for url: https://mclients.googleapis.com/sj/v2.5/query?ct=1%2C2%2C3%2C4%2C6%2C7%2C8%2C9&max-results=19&hl=en_US&dv=0&tier=fr
                                                                                                     (requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/query', 'params': {'ct': '1,2,3,4,6,7,8,9', 'q': None, 'max-results': 19, 'hl': 'en_US', 'dv': 0, 'tier': 'fr'}, 'headers': {'Authorization': '<omitted>'}})
                                                                                                                                          (response was: '{"error":{"errors":[{"domain":"global","reason":"required","message":"Required parameter: q","locationType":"parameter","location":"q"}],"code":400,"message":"Required parameter: q"}}')
christopher-dG commented 7 years ago

Thanks, this will be fixed in a moment.

christopher-dG commented 7 years ago

Fixed!