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 an i3/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

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).

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} '

i3 Integration

TODO: Add sample code for i3

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

Roadmap

  • Save currently playing song to Liked Tracks
  • Add output string customization
  • Add optional socks/https proxy

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.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

spotidry-0.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spotidry-0.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for spotidry-0.0.2.tar.gz
Algorithm Hash digest
SHA256 06d609ba1b588f005f0b5a1c2c61c70eddca56b09b1bbd0423a7c7b385172057
MD5 12256b8c4cb4ff61334159aa34b60dc3
BLAKE2b-256 d78cd641b4597067ca0c4c4b23abb62eadc8ac52c33532f5f42cbf86bb161648

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotidry-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for spotidry-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31836ed438bf406ae18ebfb2616ef15413d085f1611abc73f256589e84bbb739
MD5 7781407601f921b1e863096b192188c4
BLAKE2b-256 65b6f50daac4278b578be4b3957985904934e5ff65f03a9a05e7c38f38496f72

See more details on using hashes here.

Supported by

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