gmusicapi allows control of Google Music with Python.
from gmusicapi import Mobileclient
api = Mobileclient()
api.login('[email protected]', 'my-password')
# => True
library = api.get_all_songs()
sweet_track_ids = [track['id'] for track in library
if track['artist'] == 'The Cat Empire']
playlist_id = api.create_playlist('Rad muzak')
api.add_songs_to_playlist(playlist_id, sweet_track_ids)
gmusicapi is not supported nor endorsed by Google.
That said, it's actively maintained, and powers a bunch of cool projects:
- alternate clients, including a command line client and FUSE filesystem
- syncing tools for library management
- proxies for media players, such as gmusicproxy and gmusicprocurator, as well as plugins for Mopidy and Squeezebox.
Everything you need is at http://unofficial-google-music-api.readthedocs.org.
If the documentation doesn't answer your questions, or you just want to get in touch, either drop by #gmusicapi on Freenode or shoot me an email.
- November 2013: I started working fulltime at Venmo, meaning this project is back to night and weekend development.
- March 2014: a Google update broke much of the deprecated webclient interface and temporarily disrupted mobileclient streaming.
For fine-grained development updates, follow me on Twitter: @simonmweber.
Copyright 2014 Simon Weber. Licensed under the 3-clause BSD. See LICENSE.