christopher-dG / gpymusic

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

Crashing when starting song #4

Closed soppelmann closed 7 years ago

soppelmann commented 7 years ago

After searching for a song then starting it with p 4 for example returns this terminal output, this is copied and is all that I could get to display, I couldnt retrieve the beginning of the error message.

ile "/usr/local/bin/pmcli", line 50, in transition commands[command](arg) File "/usr/local/bin/pmcli", line 357, in play opt.play(infobar) File "/home/getz/.local/share/pmcli/src/music_objects.py", line 337, in play MusicObject.play(win, [(self['id'], to_string(self), self['time'])]) File "/home/getz/.local/share/pmcli/src/music_objects.py", line 42, in play url = api.get_stream_url(song[0]) File "<decorator-gen-102>", line 2, in get_stream_url File "/usr/local/lib/python3.5/dist-packages/gmusicapi/utils/utils.py", line 293, in wrapper return function(*args, **kw) File "/usr/local/lib/python3.5/dist-packages/gmusicapi/clients/mobileclient.py", line 371, in get_stream_url return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality) 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: GetStreamUrl: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay?dv=0&sig=7nxuPmyCuhPI9tkTonOkVMgKzYo&net=mob&hl=en_US&slt=1487500852934&tier=aa&mjck=T4tohzge6kd766ycj76jgbuxmdu&opt=hi&pt=e (requests kwargs: {'method': 'GET', 'params': {'dv': 0, 'sig': b'7nxuPmyCuhPI9tkTonOkVMgKzYo', 'net': 'mob', 'hl': 'en_US', 'slt': '1487500852934', 'tier': 'aa', 'mjck': 'T4tohzge6kd766ycj76jgbuxmdu', 'opt': 'hi', 'pt': 'e'}, 'url': 'https://mclients.googleapis.com/music/mplay', 'allow_redirects': False, 'headers': {'Authorization': '<omitted>', 'X-Device-ID': 'random_characters'}}) (response was: '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n')

soppelmann commented 7 years ago

Ok I figured it out, the random characters I had weren't accepted, I tried another key and it worked fine.

christopher-dG commented 7 years ago

Oh just an FYI, the device id is not actually random characters, it is a unique string that identifies a device logged into your account (or something like that). This bit of the readme tells you how to generate a proper one.

soppelmann commented 7 years ago

Oh yeah I figured that out, I just think i messed up when i copied it the first time or something. Thanks anyways, it's working now!