• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Awesome standalone command line player for Google Play Music.

Clay Player

Clay [beta]

Build Status Documentation Status PyPI version Maintainability

Standalone command line player for Google Play Music.

This app wouldn't be possible without the wonderful gmusicapi and VLC libraries.

This project is neither affiliated nor endorsed by Google.

It's being actively developed, but is still in the early beta stage, so many features are missing and/or may be bugged.

We're on IRC!

  • Server: irc.oftc.net
  • Channel: #clay

Screenshot:

Clay Player screenshot

Click the image below to see the screencast:

asciicast

Quick start

sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo vlc keybinder python-keybinder
pip install --user clay-player
clay

Documentation

Documentation is available here.

Requirements

  • Python 3.x (native)
  • gmusicapi (PYPI)
  • urwid (PYPI)
  • PyYAML (PYPI)
  • libVLC (native, distributed with VLC player)
  • PyGObject (optional) (native, used for global X keybinds)
  • Keybinder (optional) (native, used for global X keybinds)
  • setproctitle (optional) PYPI, used to change clay process name from 'python' to 'clay')
  • python-dbus (optional)

What works

  • Audio equalizer
  • Caching (not for song data, that one is coming soon)
  • Configurable keybinds and colours
  • Configuration UI
  • Filtering results
  • Global hotkeys
  • Like/dislike tracks
  • Liked songs playlist
  • Music library browsing & management
  • Notifications - in-app & OSD (via DBus)
  • PYPI package
  • Playback
  • Playlists
  • Queue management
  • Radio stations
  • Song file caching
  • Song operations (add to library, start station etc.)
  • Song search
  • Token caching for faster authorizations

What is being developed

  • Artist/album display
  • Artist/album search
  • Other functionality that is supported by gmusicapi
  • Playlist editing

Installation

Warning: The AUR and PyPy packages called python3-keybinder will not work with Clay since you need to use the official bindings. Since Ubuntu seperated the official bindings into a different package but with the same name as the unofficial one it can cause some confusion. So if you get a Namespace Keybinder not available warning it is probably caused by this. So, for example, on Arch Linux you need the libkeybinder3 package instead.

  1. Install Python 3, and VLC from your package manager.
  2. Optionally, you can install PyGObject, DBus for Python and keybinder plus bindings if you want global X keybinds.

Method 1 (PyPi, automatic)

Just install the player using pip:

pip install --user clay-player
clay

Method 2 (from source, manual)

  1. Clone the source code.

  2. Create & activate virtualenv with system packages:

    virtualenv --system-site-packages --prompt="(clay) " .env
    source .env/bin/activate
  3. Install the requirements:

    pip install -r requirements.txt
  4. Run the player:

    ./clay/app.py

Method 3 (in Docker)

Sometimes you want to run stuff in Docker. You can run Clay in docker as well.

There are two strict requirements:

  • You need to build the container by yourself (bacause of PulseAudio related paths & magic cookies.)
  • You must have PulseAudio running on host with module-native-protocol-tcp module enabled.

Here's how you do it:

  1. Clone the source code

  2. Create "~/.config/clay" directory (to have proper volume permissions in docker)

    mkdir ~/.config/clay
  3. Build & run the image

    make run

You should get the sound working. Also docker will reuse the Clay config file from host (if you have one).

Configuration

  • Once you launch the app, use the "Settings" page to enter your login and password.
  • You will also need to know your Device ID. Thanks to gmusicapi, the app should display possible IDs once you enter a wrong one.
  • Please be aware that this app has not been tested with 2FA yet.
  • For people with 2FA, you can just create an app password in Google accounts page and proceed normally. (Thanks @j605)

Controls

General

  • <UP|DOWN|LEFT|RIGHT> - nagivate around
  • <ALT> + 0..9 - switch active tab

Songs

  • <ENTER> - play highlighted track
  • <CTRL> w - play/pause
  • <CTRL> e - play next song
  • <CTRL> a - append highlighted song to the queue
  • <CTRL> u - remove highlighted song from the queue
  • <CTRL> p - start station from highlighted song
  • <ALT> m - show context menu for this song
  • <ALT> u - thumb up the highlighted song
  • <ALT> d - thumb down the highlighted song

Playback

  • <CTRL> s - toggle shuffle
  • <CTRL> r - toggle song repeat
  • <SHIFT> <LEFT|RIGHT> - seek backward/forward by 5% of the song duration
  • <CTRL> q - seek to song beginning

Equalizer

  • + - increase amplification
  • - - decrease amplification

Misc

  • <ESC> or <CTRL> / or _ - close most recent notification or popup
  • <CTRL> x - exit app
  • To filter songs just start typing words. Hit <ESC> to cancel.

X keybinds

NOTE: you need to pass the --with-x-keybinds flag for these to work

  • <XF86AudioPlay> - play/pause the song
  • <XF86AudioNext> - play the next song
  • <XF86AudioPrev> - play previous song

Troubleshooting

At some point, the app may fail. Possible reasons are app bugs, Google Play Music API issues, gmusicapi bugs, urwid bugs etc.

If you encounter a problem, please feel free to submit an issue. I'll try to figure it out ASAP.

Most issues can be reproduced only with specific data coming from Google Play Music servers.

Use "Debug" tab within app to select the error and hit "Enter" to copy it into clipboard. This will help me to investigate this issue.

Credits

Made by Andrew Dunai.

Regards to gmusicapi and VLC who made this possible.

People who contribute to this project:

More Repositories

1

django-searchable-select

A better and faster multiple selection widget with suggestions
Python
107
star
2

django-nameko

Django wrapper for nameko microservice framework.
Python
72
star
3

lilka

Монорепо проєкту "Лілка"
C++
55
star
4

raid

Air Raid Alerts API (Ukraine)
Go
48
star
5

nineapi

Unofficial python client library for *official* 9GAG API. (alpha)
Python
45
star
6

telemux

Flexible message router add-on for go-telegram-bot-api/telegram-bot-api. This is to go-telegram-bot-api as gorilla/mux is to net/http.
Go
42
star
7

graph-bars-font

OTF font with vertical bars for one-line ASCII spectrum analyzers, graphs, etc
Go
29
star
8

foreigner

FFI library for Godot, built with GDNative
C++
25
star
9

mqtt-home

MQTT dashboard app that stores its config in MQTT to easily share your dashboard with your family members and friends.
Java
22
star
10

flake8-colors

ANSI colors highlight for Flake8
Python
14
star
11

node-nameko-client

Node.JS client for Nameko microservice framework.
JavaScript
12
star
12

caveboard

https://youtu.be/Klj2Q3trmW8
Assembly
12
star
13

deck65

Simple SBC based on 65c02s
Assembly
11
star
14

dotfiles

My configs: (neo)vim+lua+lsp+treesitter, wayland (riverwm, yambar, sway, waybar), alacritty, tmux, bash, sonokai/molokai colors and stolen dircolors.
C++
11
star
15

enlightenment

A simple yet fast light engine for Phaser (WebGL render).
HTML
9
star
16

isc

Inter-service communication layer for Python with Django support
Python
9
star
17

telegram-numix-theme

Numix theme for Telegram Destop app. (black, orange & red colors) [BETA]
8
star
18

roulette

VNC/Telnet/RTSP pwn kit: scan & auto-bruteforce
Go
5
star
19

codename

A codename generator inspired by http://projectcodename.com
Python
5
star
20

restic

A loose & flexible REST framework for Sanic. Inspired by Django REST Framework.
Python
5
star
21

pk88

Single-board computer based on KM1810VM88 CPU (Ukrainian clone of Intel 8088).
Assembly
4
star
22

nice65

Code formatter for 6502 assembly (cc65 syntax)
Python
3
star
23

leo80

Z80-based single-board computer
Assembly
3
star
24

picplate

An image templating micro-engine to make generation of dynamic images easier.
Python
3
star
25

and3rson

2
star
26

templize

The lightest DOM-based JavaScript template engine in the world.
HTML
2
star
27

website

JavaScript
2
star
28

nyashbot

Python
2
star
29

telecast

Portable REST/JSON RPC implementation for Django/DRF. Like Fender Telecaster but way cooler.
Python
2
star
30

radical

Multi-transport RPC with asyncio & Django support.
Python
2
star
31

rkon

A lightweight Source RCON command-line client written in Python
Python
2
star
32

ginger

Ginger Is Not a GAL EmulatoR
Python
2
star
33

iorant

An unofficial client for DevRant written in ionic.js
JavaScript
1
star
34

peek

Open-source alternative to Google Keep. We DO have API.
Python
1
star
35

yagni

You are probably gonna need it: a collection of useful Python utilities aggregated over many years of development.
Python
1
star
36

vertabs

Atom plugin that provides vertical tabs over file tree (SublimeText-like)
JavaScript
1
star
37

parts

A library of my KiCad symbols, footprints and 3D models
Makefile
1
star
38

6565

6502 assembler written in 6502 C (CC65)
C
1
star
39

vkplayer

A small VK audio player I made for myself in Python & GTK3.
Python
1
star
40

rule34

Java
1
star
41

ukraine-trident

Makefile
1
star
42

hhh

Just playing around with CS:GO hacking @ Linux.
Python
1
star
43

python-de-test-task

Python Data Engineering Test Task
Python
1
star
44

fm-synth-demo

Simple FM synthesis demonstration made with Godot
1
star