Skip to content

Instantly share code, notes, and snippets.

@ThomasGaubert
Created January 29, 2015 20:20
Show Gist options
  • Save ThomasGaubert/262b2ec7c12171143f16 to your computer and use it in GitHub Desktop.
Save ThomasGaubert/262b2ec7c12171143f16 to your computer and use it in GitHub Desktop.
Get all Android device IDs tied to a Google Play Music account.
from gmusicapi import Webclient
# Use Google account credintials. If two factor is enabled, use application specific password.
email = '[email protected]'
password = 'password'
api = Webclient()
logged_in = api.login(email, password)
# logged_in is True if login was successful
if logged_in == True:
print "Successfully logged in"
print "Your device IDs are:"
devices = api.get_registered_devices()
print [device['id'][2:] + " (" + device['model'] + ")" for device in devices
if device['type'] == 'PHONE']
else:
print "Invalid login credintials"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment