Created
January 29, 2015 20:20
-
-
Save ThomasGaubert/262b2ec7c12171143f16 to your computer and use it in GitHub Desktop.
Get all Android device IDs tied to a Google Play Music account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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