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

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

Comments

Projects
None yet
2 participants
@simon-weber
Owner

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

This comment has been minimized.

Show comment
Hide comment
@simon-weber

This comment has been minimized.

Show comment
Hide comment
@simon-weber

simon-weber Feb 2, 2013

Owner

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?

Owner

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

This comment has been minimized.

Show comment
Hide comment
@fruel

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

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

This comment has been minimized.

Show comment
Hide comment
@simon-weber

simon-weber Feb 9, 2013

Owner

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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@fruel

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

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

This comment has been minimized.

Show comment
Hide comment
@simon-weber

simon-weber Feb 9, 2013

Owner

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

Owner

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