API
— High-Level API¶
-
mobileclient
(username=None, device_id=None, *, locale='en_US', session=None, token=None, token_handler=<class 'google_music.token_handlers.FileTokenHandler'>, token_handler_kwargs=None)[source]¶ Create and authenticate a Google Music mobile client.
>>> import google_music >>> mc = google_music.mobileclient('username')
- Parameters
username (str, Optional) – Your Google Music username. Used to store OAuth tokens for multiple accounts separately.
device_id (str, Optional) – A mobile device ID. Default: MAC address is used.
locale (str, Optional) – ICU locale used to localize some responses. This must be a locale supported by Android. Default:
'en_US'
.session (
GoogleMusicSession
, Optional) – A session compatible withGoogleMusicSession
.token (dict, Optional) – An OAuth token compatible with
oauthlib
.token_handler (
TokenHandler
, Optional) – A token handler class compatible withTokenHandler
for dumping and loading the OAuth token.token_handler_kwargs (dict, Optional) – Keyword arguments to pass to the
token_handler
class. These become attributes on the class instance.
- Returns
An authenticated
MobileClient
instance.- Return type
-
musicmanager
(username=None, uploader_id=None, *, session=None, token=None, token_handler=<class 'google_music.token_handlers.FileTokenHandler'>, token_handler_kwargs=None)[source]¶ Create and authenticate a Google Music Music Manager client.
>>> import google_music >>> mm = google_music.musicmanager('username')
- Parameters
username (str, Optional) – Your Google Music username. Used to store OAuth tokens for multiple accounts separately.
uploader_id (str, Optional) – A unique uploader ID. Default: MAC address and username used.
session (
GoogleMusicSession
, Optional) – A session compatible withGoogleMusicSession
.token (dict, Optional) – An OAuth token compatible with
oauthlib
.token_handler (
TokenHandler
, Optional) – A token handler class compatible withTokenHandler
for dumping and loading the OAuth token.token_handler_kwargs (dict, Optional) – Keyword arguments to pass to the
token_handler
class. These become attributes on the class instance.
- Returns
An authenticated
MusicManager
instance.- Return type