clay/README.md

246 lines
7.2 KiB
Markdown
Raw Normal View History

2018-02-13 00:14:47 +02:00
![Clay Player](./images/clay-banner.png)
2018-02-12 16:19:48 +02:00
- [About](#clay-beta)
2018-01-31 11:29:46 +02:00
- [Quick start](#quick-start)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [What works](#what-works)
- [What is being developed](#what-is-being-developed)
- [Installation](#installation)
* [Method 1 (PyPi, automatic)](#method-1-pypi-automatic)
* [Method 2 (from source, manual)](#method-2-from-source-manual)
2018-02-04 13:20:21 +02:00
* [Method 3 (in Docker)](#method-3-in-docker)
2018-01-31 11:29:46 +02:00
- [Configuration](#configuration)
- [Controls](#controls)
* [General](#general)
* [Songs](#songs)
* [Playback](#playback)
* [Equalizer](#equalizer)
* [Misc](#misc)
- [Troubleshooting](#troubleshooting)
- [Credits](#credits)
2018-02-16 18:03:07 +02:00
- [Changelog](./CHANGELOG.rst)
2018-01-31 11:29:46 +02:00
2018-02-12 16:19:48 +02:00
# Clay [beta]
2017-12-28 15:09:40 +02:00
2018-02-14 22:57:01 +02:00
[![Build Status](https://travis-ci.org/and3rson/clay.svg?branch=master)](https://travis-ci.org/and3rson/clay) [![Documentation Status](https://readthedocs.org/projects/clay/badge/?version=latest)](http://clay.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/clay-player.svg)](https://badge.fury.io/py/clay-player) [![Maintainability](https://api.codeclimate.com/v1/badges/33fc2ac7949ddd9a51ee/maintainability?1)](https://codeclimate.com/github/and3rson/clay/maintainability)
2018-01-06 02:03:28 +02:00
2017-12-28 15:09:40 +02:00
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.
2018-02-12 16:19:48 +02:00
It's being actively developed, but is still in the early beta stage, so many features are missing and/or may be bugged.
2017-12-28 15:09:40 +02:00
2018-02-13 23:30:49 +02:00
We're on IRC!
- Server: irc.oftc.net
- Channel: **#clay**
2018-02-13 00:19:09 +02:00
Screenshot:
![Clay Player screenshot](./images/clay-screenshot.png)
2018-02-13 00:19:57 +02:00
Click the image below to see the screencast:
[![asciicast](https://asciinema.org/a/69ygwYGRDyB5a7pFgyrwWo1ea.png?1)](https://asciinema.org/a/69ygwYGRDyB5a7pFgyrwWo1ea)
2018-01-31 11:29:46 +02:00
# Quick start
2018-01-23 22:22:53 +02:00
```bash
sudo apt install python-gi python-gi-cairo python3-gi python3-gi-cairo vlc keybinder python-keybinder
pip install --user clay-player
2018-01-23 22:22:53 +02:00
clay
```
2018-01-06 14:06:25 +02:00
# Documentation
Documentation is ![available here](http://clay.readthedocs.io/en/latest/).
2017-12-28 15:09:40 +02:00
# Requirements
- Python 3.x (native)
- [gmusicapi] (PYPI)
- [urwid] (PYPI)
2017-12-28 15:13:31 +02:00
- [PyYAML] (PYPI)
- [PyGObject] (native, optional, used for global X keybinds)
- [Keybinder] (native, optional, used for global X keybinds)
2017-12-28 15:13:31 +02:00
- lib[VLC] (native, distributed with VLC player)
2017-12-28 15:09:40 +02:00
# What works
- Playback
2018-01-14 17:26:57 +02:00
- Music library browsing & management
2017-12-28 15:09:40 +02:00
- Playlists
2018-01-03 13:36:32 +02:00
- Radio stations
2018-01-07 00:36:21 +02:00
- Song search
2018-01-14 20:14:56 +02:00
- Filtering results
2018-01-03 13:36:32 +02:00
- Queue management
- Notifications
2018-01-29 13:53:10 +02:00
- Audio equalizer
2018-01-07 00:36:21 +02:00
- Global hotkeys
- Song file caching
2018-01-14 17:26:57 +02:00
- Configuration UI
- Token caching for faster authorizations
- Song operations (add to library, start station etc.)
- Caching (not for song data, that one is coming soon)
2018-01-29 13:53:10 +02:00
- PYPI package
2017-12-28 15:09:40 +02:00
2017-12-28 15:13:31 +02:00
# What is being developed
2017-12-28 15:09:40 +02:00
2018-01-07 00:36:21 +02:00
- Like/dislike tracks
- Playlist editing
- Artist/album search
2017-12-28 15:09:40 +02:00
- Other functionality that is supported by [gmusicapi]
# 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, and keybinder plus bindings
if you want global X keybinds.
2017-12-28 15:09:40 +02:00
2018-01-31 11:25:19 +02:00
## Method 1 (PyPi, automatic)
2017-12-28 15:09:40 +02:00
2018-01-31 11:25:19 +02:00
Just install the player using `pip`:
```bash
pip install --user clay-player
2018-01-31 11:25:19 +02:00
clay
```
2018-01-31 11:29:46 +02:00
## Method 2 (from source, manual)
2017-12-28 15:09:40 +02:00
2018-01-31 11:25:19 +02:00
1. Clone the source code.
2. Create & activate virtualenv with system packages:
2017-12-28 15:09:40 +02:00
2017-12-28 15:11:16 +02:00
```bash
virtualenv --system-site-packages --prompt="(clay) " .env
2017-12-28 15:11:16 +02:00
source .env/bin/activate
```
2017-12-28 15:09:40 +02:00
2018-01-31 11:25:19 +02:00
3. Install the requirements:
2017-12-28 15:09:40 +02:00
2017-12-28 15:11:16 +02:00
```bash
pip install -r requirements.txt
```
2017-12-28 15:09:40 +02:00
2018-01-31 11:25:19 +02:00
4. Run the player:
2017-12-28 15:09:40 +02:00
2017-12-28 15:11:16 +02:00
```bash
2017-12-30 03:22:12 +02:00
./clay/app.py
2017-12-28 15:11:16 +02:00
```
2017-12-28 15:09:40 +02:00
2018-02-04 13:20:21 +02:00
## 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)
```bash
mkdir ~/.config/clay
```
3. Build & run the image
```bash
make run
```
You *should* get the sound working. Also docker will reuse the Clay config file from host (if you have one).
2017-12-28 15:09:40 +02:00
# Configuration
2018-02-01 00:04:17 +02:00
- 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.
2018-01-31 11:29:46 +02:00
- Please be aware that this app has not been tested with 2FA yet.
2018-02-01 00:04:17 +02:00
- For people with 2FA, you can just create an app password in Google accounts page and proceed normally. (Thanks @j605)
2017-12-28 15:09:40 +02:00
# Controls
2018-01-03 13:36:32 +02:00
## General
2017-12-28 15:09:40 +02:00
- `<UP|DOWN|LEFT|RIGHT>` - nagivate around
2018-02-01 00:04:17 +02:00
- `<ALT> + 0..9` - switch active tab
2018-01-03 13:36:32 +02:00
## Songs
- `<ENTER>` - play highlighted track
2017-12-28 15:09:40 +02:00
- `<CTRL> w` - play/pause
- `<CTRL> e` - play next song
2018-01-03 13:36:32 +02:00
- `<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
2018-01-03 13:36:32 +02:00
## Playback
2017-12-28 15:09:40 +02:00
- `<CTRL> s` - toggle shuffle
- `<CTRL> r` - toggle song repeat
2018-01-03 13:36:32 +02:00
- `<SHIFT> <LEFT|RIGHT>` - seek backward/forward by 5% of the song duration
- `<CTRL> q` - seek to song beginning
2018-01-31 11:29:46 +02:00
## Equalizer
- `+` - increase amplification
- `-` - decrease amplification
2018-01-03 13:36:32 +02:00
## Misc
2018-01-31 11:29:46 +02:00
- `<ESC>` or `<CTRL> /` or <CTRL> _ - close most recent notification or popup
2018-01-03 13:36:32 +02:00
- `<CTRL> x` - exit app
2018-02-13 00:42:40 +02:00
- To filter songs just start typing words. Hit `<ESC>` to cancel.
2017-12-28 15:09:40 +02:00
## 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
2018-01-31 11:23:25 +02:00
# Troubleshooting
At some point, the app may fail. Possible reasons are app bugs,
Google Play Music API issues, [gmusicapi] bugs, [urwid] bugs etc.
2018-02-06 19:09:18 +02:00
If you encounter a problem, please feel free to submit an [issue](https://github.com/and3rson/clay/issues).
2018-01-31 11:23:25 +02:00
I'll try to figure it out ASAP.
Most issues can be reproduced only with specific data coming from Google Play Music servers.
2018-02-01 00:04:17 +02:00
Use "Debug" tab within app to select the error and hit "Enter" to copy it into clipboard.
2018-01-31 23:56:51 +02:00
This will help me to investigate this issue.
2018-01-31 11:23:25 +02:00
2017-12-28 15:09:40 +02:00
# Credits
Made by Andrew Dunai.
Regards to [gmusicapi] and [VLC] who made this possible.
2018-02-06 19:09:18 +02:00
Special thanks to the people who contribute to this project:
- [Valentijn (@ValentijnvdBeek)](https://github.com/ValentijnvdBeek)
- [Sam Kingston (@sjkingo)](https://github.com/sjkingo)
2017-12-28 15:09:40 +02:00
[gmusicapi]: https://github.com/simon-weber/gmusicapi
[VLC]: https://wiki.videolan.org/python_bindings
[urwid]: urwid.org/
[pyyaml]: https://github.com/yaml/pyyaml
[PyGObject]: https://pygobject.readthedocs.io/en/latest/getting_started.html
[Keybinder]: https://github.com/kupferlauncher/keybinder