$ pip install gmusicapi.
This will grab all the source dependencies.
If you’re upgrading from a date-versioned release (eg
$ pip uninstall gmusicapi; pip install gmusicapi instead.
- Google App Engine
- See this thread for instructions.
The only time avconv or ffmpeg is not required is when uploading mp3s without scan-and-match enabled.
If you need to install avconv/ffmpeg from source, be sure to use
$ ./configure --enable-gpl --enable-nonfree --enable-libmp3lame.
If you’re not going to be uploading music, you’ll likely
want to use the
Mobileclient: it supports streaming
and library management.
It requires plaintext auth, so your code might look something like:
from gmusicapi import Mobileclient api = Mobileclient() logged_in = api.login('firstname.lastname@example.org', 'my-password', Mobileclient.FROM_MAC_ADDRESS) # logged_in is True if login was successful
Note that 2-factor users will need to setup and provide an app-specific password.
Instead, you’ll need to authorize your account once before logging in. The easiest way is to run:
from gmusicapi import Musicmanager mm = Musicmanager() mm.perform_oauth()
If successful, this will save your credentials to disk. Then, future runs can start with:
from gmusicapi import Musicmanager mm = Musicmanager() mm.login() # mm.upload('foo.mp3') # ...
If you need both library management and uploading, just create multiple client instances.
The reference section has complete information on all clients: