Skip to content

Instantly share code, notes, and snippets.

@Daniel15
Created October 25, 2014 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel15/ef7499c2525c618ebfda to your computer and use it in GitHub Desktop.
Save Daniel15/ef7499c2525c618ebfda to your computer and use it in GitHub Desktop.
Add Google Play Music All Access playlists to the library. Uses https://github.com/simon-weber/Unofficial-Google-Music-API
from gmusicapi import Mobileclient
api = Mobileclient()
api.login('daniel@example.com', 'hunter2')
playlist_contents = api.get_all_user_playlist_contents()
for playlist in playlist_contents:
playlist_tracks = playlist.get('tracks')
for pl_track in playlist_tracks:
track = pl_track.get('track')
api.add_aa_track(pl_track.get('trackId'))
print track.get('artist') + ' - ' + track.get('title')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment