Google Py Music

PyPI

A simple TUI client for Google Play Music

Browse and stream Google Play Music from the comfort and familiarity of your favourite terminal.

![screencast](https://fat.gfycat.com/MixedCoordinatedAmphibian.gif "Just pretend that this says Google Py Music instead of pmcli.")

Disclaimer

Google Py Music is essentiallly unmaintained; I'll address security alerts and review PRs but I won't be fixing bugs or adding anything new myself.

These days I use Spotify with spotifyd and baton. For GPM, I recommend tuijam, which has loads more features and is actively maintained!

Dependencies

All of these can usually be installed with your operating system's package manager.

Installation

The easiest way to install is with pip by running pip3 install gpymusic.

You can also install from source:

$ git clone https://github.com/christopher-dG/gpymusic
$ cd gpymusic
$ python setup.py install

A special thanks goes to ftxrc for his work on the pip installation.

Configuration

Once gpymusic is installed, run gpymusic-setup. An example config file will be placed in ~/.config/gpymusic. Additionally, you should run gpymusic-oauth-login and follow the prompts if you have a free account.

Device ID

If you don't know your device ID, run gpymusic-get-dev-id and follow the prompts to generate a list of valid device IDs.

Password

You can choose to leave the password field empty and you will be prompted for it upon starting the program. Otherwise, you can supply it for automatic logins.

If you store your password in plain text, be aware the potential consequences.

Colours

Colour themes are defined in the colour section of your config file. To enable colour, make sure enable is set to yes and set the fields to hex colours as desired. highlight affects the section headers and 'now playing' output, content{1|2} affect the main window, and background/foreground are self-explanatory.

Setting background to default allows you to use your terminal background colour, which means this allows transparency if your terminal supports it.

Note: Upon exiting the program, your terminal colours will likely be modified. Just open a new terminal session and your colours will be back to normal.

Now Playing

To log the currently playing track to a file, include a nowplaying section in your config file with enable set to yes. A filename may then be specified, or the default value of ~/.nowplaying will be used.

This file may then be used in status bars or simple notifications systems. For example, here is a simple i3blocks definition:

[music]
command=cat ~/.nowplaying
interval=5

Running Google Py Music

Once installed and configured, the program can be run from the terminal with gpymusic. While the program is running, don't resize your terminal.

Controls

When playing music:

Accounts

Google Py Music works similarly to the web interface in that users with free accounts can only arbitrarily access music that they've purchased or uploaded, whereas users with paid accounts can search for and stream anything. When playing music with a free account, the entire song is downloaded and played locally rather than streamed.

Notes for free users:

2-Factor Authentication

If your account has 2FA set up, you will need to use an app password to log in. If you're storing your password in your config file, replace it with the app password.

Crashes

If gpymusic crashes, your terminal settings will likely be messed up, in which case stty sane will restore order. Don't forget to open an issue!


Thanks for using Google Py Music!