You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
I've been using the MobileClient.get_stream_url functionality of your awesome api in my little song caching script. It was working fantastically until some time in the last month, and I suspect it's a change on Google's side. I wanted to see if anyone else was having any issues, and see if it's worth putting on my reverse engineering hat to try and figure it out. Otherwise, If someone's already working on it, please let me know if there's any way I can be of assistance.
Here's the traceback:
04-13 10:28 root INFO caching song: id Tllmyxxg5hv4wrxe7nd6i6hobvq; artist Odd Mob; album Is It A Banger? [2015]; title 01:01 - Is It A Banger?; path /Users/derwent/Music/iTunes/iTunes Media/Automatically Add to iTunes/0101 Is It A Banger.mp3
04-13 10:28 gmusicapi.Mobileclient1 DEBUG GetStreamUrl(args=['Tllmyxxg5hv4wrxe7nd6i6hobvq', '<omitted 64 char device id>', 'hi'], kwargs={'required_auth': [False, False, True, False]})
04-13 10:28 urllib3.connectionpool DEBUG https://mclients.googleapis.com:443 "GET /music/mplay?opt=hi&net=mob&pt=e&slt=1586737728993&sig=o3TLADoGRR3aNuyZsIv1KIoIISY&mjck=Tllmyxxg5hv4wrxe7nd6i6hobvq&hl=en_US&dv=0&tier=aa HTTP/1.1" 403 None
04-13 10:28 root WARNING failed to get streaming url, try updating your device id: https://github.com/simon-weber/gmusicapi/issues/590
Traceback (most recent call last):
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 216, in perform
response.raise_for_status()
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay?opt=hi&net=mob&pt=e&slt=1586737728993&sig=o3TLADoGRR3aNuyZsIv1KIoIISY&mjck=Tllmyxxg5hv4wrxe7nd6i6hobvq&hl=en_US&dv=0&tier=aa
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/derwent/Documents/GitHub/gpm-cache/gpm_cache/core.py", line 248, in cache_playlist
filename = cache_track(api, parser_args, track_info, cached_playlist)
File "/Users/derwent/Documents/GitHub/gpm-cache/gpm_cache/core.py", line 203, in cache_track
cache_url = api.get_stream_url(track_info.track_id)
File "</Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/decorator.py:decorator-gen-104>", line 2, in get_stream_url
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/utils/utils.py", line 288, in wrapper
return function(*args, **kw)
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 457, in get_stream_url
return self._make_call(mobileclient.GetStreamUrl, song_id, device_id, quality)
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/clients/mobileclient.py", line 43, in _make_call
return super()._make_call(protocol, *args, **kwargs)
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/clients/shared.py", line 83, in _make_call
return protocol.perform(self.session, self.validate, *args, **kwargs)
File "/Users/derwent/.pyenv/versions/3.7.2/lib/python3.7/site-packages/gmusicapi/protocol/shared.py", line 224, in perform
raise CallFailure(err_msg, call_name)
gmusicapi.exceptions.CallFailure: GetStreamUrl: 403 Client Error: Forbidden for url: https://mclients.googleapis.com/music/mplay?opt=hi&net=mob&pt=e&slt=1586737728993&sig=o3TLADoGRR3aNuyZsIv1KIoIISY&mjck=Tllmyxxg5hv4wrxe7nd6i6hobvq&hl=en_US&dv=0&tier=aa
(requests kwargs: {'method': 'GET', 'url': 'https://mclients.googleapis.com/music/mplay', 'allow_redirects': False, 'headers': {'X-Device-ID': '<omitted 64 char device id>', 'Authorization': '<omitted>'}, 'params': {'opt': 'hi', 'net': 'mob', 'pt': 'e', 'slt': '1586737728993', 'sig': b'o3TLADoGRR3aNuyZsIv1KIoIISY', 'mjck': 'Tllmyxxg5hv4wrxe7nd6i6hobvq', 'hl': 'en_US', 'dv': 0, 'tier': 'aa'}})
(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')
If I let it continue, it does this for every song in the playlist.
if it helps, here is the track info for the track.
The API works fine for listing playlist entries and everything else.
I don't think this is a duplicate of #590 since I'm using oauth login, and I've tried each of the possible device IDs listed in api.get_registered_devices .
I also tried deleting my oauth credentials and logging in again from scratch.
I was on gmusicapi v12.0.0, but the issue persisted when I upgraded to v13.0.0
Hm, I haven't heard of any new issues. What kind of device id are you using? CI is using an ios one (originally belonging to a real device) and still seems to be working so maybe that's worth a shot.
Thanks for the reply @simon-weber , unfortunately I don't have an iOS device :( The device ID I'm using is an android one, it's a 64 char long hex string ( 1c65...bd3c ).
Guess I'll try my luck at using the webclient API.
And that's absolutely shocking how Google is carrying on. Have you used YouTube music? I haven't personally but I'm really not looking forward to being force onto the platform. The files have a lower bitrate (256kb instead of 320kb), and there isn't an obvious way to put my own tracks and playlists on there yet. It's just infuriating that they announced they were going to switch off GPM several years ago, but still haven't finished YouTube Music, so their solution is to just let GPM rot.
OK, it seems to working again! I just went into my GPM app on my Android, looked at the name of the device that said "This Device", then looked up that name in the output of get_registered_devices. I'm pretty sure this is exactly what I was using before, but i'm just glad it's working again for now, and I don't need to boot up Android Studio to mitm the connection.
Hey there!
I've been using the
MobileClient.get_stream_url
functionality of your awesome api in my little song caching script. It was working fantastically until some time in the last month, and I suspect it's a change on Google's side. I wanted to see if anyone else was having any issues, and see if it's worth putting on my reverse engineering hat to try and figure it out. Otherwise, If someone's already working on it, please let me know if there's any way I can be of assistance.Here's the traceback:
If I let it continue, it does this for every song in the playlist.
if it helps, here is the track info for the track.
The API works fine for listing playlist entries and everything else.
I don't think this is a duplicate of #590 since I'm using oauth login, and I've tried each of the possible device IDs listed in
api.get_registered_devices
.I also tried deleting my oauth credentials and logging in again from scratch.
I was on gmusicapi v12.0.0, but the issue persisted when I upgraded to v13.0.0
tail /Users/derwent/Library/Logs/gmusicapi/gmusicapi.log
Thanks
The text was updated successfully, but these errors were encountered: