Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

@simon-weber simon-weber commented Dec 23, 2012

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

@simon-weber simon-weber commented Jan 2, 2013

@simon-weber
Copy link
Owner Author

@simon-weber simon-weber commented Feb 2, 2013

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 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

@simon-weber simon-weber commented Feb 9, 2013

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

@fruel
Copy link

@fruel 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

@simon-weber simon-weber commented Feb 9, 2013

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

@simon-weber simon-weber closed this Feb 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.