Closed mogenson closed 7 years ago
That's odd, I haven't seen that before. Try this:
>>> import gmusicapi
>>> mc = gmusicapi.Mobileclient()
>>> mc.login(USERNAME, PASSWORD, '')
>>> [dev['id'] for dev in mc.get_registered_devices()]
['id1', 'id2', 'etc'] # These should all work.
Hopefully that'll work.
Also please show me the output from this:
>>> mc.FROM_MAC_ADDRESS
Does the same error occur?
Gave it a go and:
$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gmusicapi
>>> mc = gmusicapi.Mobileclient()
>>> mc.login('********@gmail.com', '********', '')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/gmusicapi-10.1.2-py3.5.egg/gmusicapi/clients/mobileclient.py", line 143, in login
self.android_id = self._validate_device_id(device_id, is_mac=is_mac)
File "/usr/local/lib/python3.5/dist-packages/gmusicapi-10.1.2-py3.5.egg/gmusicapi/clients/mobileclient.py", line 58, in _validate_device_id
raise InvalidDeviceId('Invalid device_id %s.' % device_id, devices)
gmusicapi.exceptions.InvalidDeviceId: Invalid device_id .Your valid device IDs are:
* < 16 digit device id >
* < another 16 digit device id >
>>>
However, I used one of the device ID's from the bottom of the python REPL and used it in gpymusic's config.json file with success. The gpymusic client can log in and play music now.
Yeah it's a bit weird that you can sometimes log in without a device id and sometimes you can't. I'm glad the exception here was helpful though, it's a good thing I added that to gmusicapi
:sweat_smile:
Could you also try manually logging in with the third argument being mc.FROM_MAC_ADDRESS
?
>>> mc.FROM_MAC_ADDRESS
<object object at 0x7f5f78542310>
>>>
Hm, yeah I guess there's no way for me to know ahead of time if a MAC address is going to work or not then. Thanks! Closing as this turns out to be a gmusicapi
issue.
On x86_64 Debian Stretch, Python 3.5.3. Ran setup.py install on master branch, as instructed in README.
When I run gpymusic-get-dev-id it fails with the following traceback error: