Skip to main content

A boring Spotify CLI client

Project description

Spotidry

Summary

Spotidry is a real dry & boring command-line client for Spotify.

My main motivation for this project is to have a simple client that allows me to save the currently-playing song to my Liked Tracks. I also added play/pause/next/previous commands.

One of the best use cases for spotidry is to integrate it into a polybar/tmux/vim status line. You can also map some key-bindings or foot-pedals to send spotidry command.

Below, is a demo video showing some basic spotidry commands, along with a tmux integration.

Installation

Install spotidry from PyPI:

pip install --user spotidry
spotidry --setup

Note: I have only tested spotidry on Linux.

Setup

Spotify API

You will need to register your app at My Dashboard to get the credentials necessary to make authorized calls (a client id and client secret). Select the Web API scope.

You can set your redirect URI to something like "http://127.0.0.1:9999"

Configuration

Configure your Spotify API variables in ~/.config/spotidry/spotidry.yaml

client_id: '<ID>'
client_secret: '<SECRET>'
redirect_uri: 'http://127.0.0.1:9999'

Tmux Integration

I'm using the popular .tmux config.

I have configured spotidry to update 1/s in ~/.tmux/.tmux.conf.local:

tmux_conf_theme_status_right='#(spotidry 2>/dev/null; sleep 1) #{prefix}#{pairing} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '

Polybar Integration

Add the following module to ~/.config/polybar/config.ini

[module/spotidry]
type = custom/script
exec = ~/.local/bin/spotidry
exec-if = test -f ~/.local/bin/spotidry
click-left = ~/.local/bin/spotidry --next 2> /dev/null
click-middle = ~/.local/bin/spotidry --save 2> /dev/null
click-right = ~/.local/bin/spotidry --play 2> /dev/null
interval = 1

Polybar screenshot

Usage

The first time you run spotidry, you will be prompted to authorize the app in your browser.

Run spotidry --help to see all commands/options.

usage: spotidry [-h] [-v] [-s] [-p] [-n] [--previous]

Spotify CLI client

options:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit
  -s, --save     toggle liked track status
  -p, --play     play/pause track
  -n, --next     play next track
  --previous     play previous track/skip to beggining of current track

Note, in order to re-authorize, delete ~/.cache/spotidry.yaml... Yes, I will provide a CLI flag for this eventually.

Roadmap

  • Save currently playing song to Liked Tracks
  • Add volume controls/status
  • Add output string customization
  • Add socks/https proxy option

Contributions

Contributions are always welcome!

Feel free to submit an issue or a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotidry-0.0.6.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotidry-0.0.6-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file spotidry-0.0.6.tar.gz.

File metadata

  • Download URL: spotidry-0.0.6.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for spotidry-0.0.6.tar.gz
Algorithm Hash digest
SHA256 b92e9b985abca0d8ddb2b4b4c0f073adf9baad412d5127a1b7447a7affab4c65
MD5 b0af50f38e0eb74ce773b80398fe5a7c
BLAKE2b-256 ccb2c4ae702b079331d863e78bcce56e5d4b496859e856a56c1aa4098ee08339

See more details on using hashes here.

File details

Details for the file spotidry-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: spotidry-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for spotidry-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 45d4abaf484b0669b71795f47b36af0e0b1bec741c276be43e6a7fbdc6dbe0c1
MD5 80113ba6412c1caaf3c9add5a9b07ebe
BLAKE2b-256 740dfea4fb53068235faeafa7f134d0be2678a4fe7b83a47ad7451e67c5e83c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page