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

MAC address is not reliable on some devices (eg VPS) #60

Closed
simon-weber opened this issue Dec 23, 2012 · 6 comments
Closed

MAC address is not reliable on some devices (eg VPS) #60

simon-weber opened this issue Dec 23, 2012 · 6 comments
Milestone

Comments

@simon-weber
Copy link
Owner

In #51, @fruel and @damariei both upload from a VPS, where the MAC address will change; this registers a device for each upload.

A more static id needs to be used. @damariei suggested the hostid, though I think this will also break if the vm migrates physical machines. Using the public-facing IP may be a better option.

A way to set a user-defined MAC might need to be used as well.

@simon-weber
Copy link
Owner Author

I'm planning to expose a way for users to set this: https://github.com/simon-weber/Unofficial-Google-Music-API/blob/protocol-fixes/gmusicapi/api.py#L126.

@simon-weber
Copy link
Owner Author

Progress: https://github.com/simon-weber/Unofficial-Google-Music-API/blob/develop/gmusicapi/api.py#L71!

Users have complete control over this process now: they can give their own id/name, or decline to register an upload device.

The defaults are much more sane now, too: there's no chance of colliding with a Music Manager, and random ids will not be created in the case a MAC can't be found.

@fruel or @damariei, can you try this out and let me know what you think?

@fruel
Copy link

fruel commented Feb 9, 2013

Works.

I uploaded 2 albums a few minutes ago from my VPS to Google Music using the latest developement version.

Login call:
logged_in = api.login(email, password, True, "D9:68:1B:C5:D6:78")

I uploaded each album separately but only one device was registered in Google Music. Perfect.

@simon-weber
Copy link
Owner Author

Awesome. Can you quickly try doing api.login(email, password) on your vps? I'm expecting it to raise CallFailure.

@fruel
Copy link

fruel commented Feb 9, 2013

Traceback (most recent call last): File "google_music.py", line 45, in
main()
File "google_music.py", line 31, in main
api, success = init(email=options.email, password=options.password)
File "google_music.py", line 18, in init
logged_in = api.login(email, password)
File "/usr/local/lib/python2.7/dist-packages/gmusicapi/api.py", line 105, in login
raise OSError('uploader_id not provided, and a valid MAC could not be found.')
OSError: uploader_id not provided, and a valid MAC could not be found.

Yeah, it works.

@simon-weber
Copy link
Owner Author

Perfect; that's exactly what I wanted to see (I meant to say OSError, not CallFailure). Again, thanks for trying it for me!

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

2 participants