Skip to main content

Synchronized lyrics in your terminal for the currently playing Spotify track

Project description

spotty

Synchronized lyrics in your terminal for the currently playing Spotify track.

  • Line-by-line sync using LRC timestamps from lrclib.net
  • Falls back to plain lyrics via lyrics.ovh if no synced lyrics found
  • Smooth display — progress interpolated between API polls (no jumping)
  • Auto-refreshes when track changes
  • Handles instrumental sections, multi-artist tracks, featured artists

Requirements

Installation

pip install spotty-cli

Or from source:

git clone https://github.com/Arideno/spotty
cd spotty
pip install -e .

Setup

1. Create a Spotify App

  1. Go to Spotify Developer Dashboard
  2. Click Create app
  3. Set Redirect URI to http://127.0.0.1:8888/callback
  4. Copy your Client ID

2. Configure credentials

spotty init

You will be prompted for:

Spotify Client ID: <paste your client ID>
Redirect URI [http://127.0.0.1:8888/callback]: <Enter to keep default>

Config is saved to ~/.config/spotty/config.json.

On first run after init, a browser window opens for Spotify authorization. Tokens are saved to ~/.config/spotty/tokens.json and refreshed automatically.

Usage

# Synchronized mode (default) — live updating display
spotty

# Plain lyrics — print and exit
spotty --plain

# Adjust timing if lyrics feel early or late
spotty --offset 300    # shift 300ms later
spotty --offset -200   # shift 200ms earlier

# Version
spotty --version

# Help
spotty --help

Options

Option Default Description
--plain off Show plain (non-synced) lyrics and exit
--offset MS 0 Shift lyrics by MS milliseconds. Positive = later, negative = earlier
--version Show version and exit
--help Show help and exit

Configuration

Credentials are stored in ~/.config/spotty/config.json after running spotty init.

Key Required Default Description
client_id Yes Spotify app client ID
client_secret Yes Spotify app client secret
redirect_uri No http://127.0.0.1:8888/callback OAuth callback URI — must match your Spotify app settings

To update any value, re-run spotty init.

File locations

File Purpose
~/.config/spotty/config.json Credentials
~/.config/spotty/tokens.json OAuth tokens (auto-managed)

Delete tokens.json to force re-authentication.

How it works

  1. Auth — OAuth2 PKCE flow, no client secret needed in the token exchange
  2. Now playing — polls GET /me/player/currently-playing every 500ms
  3. Lyrics — fetches LRC-timed lyrics from lrclib.net; falls back to lyrics.ovh for plain text
  4. Display — interpolates playback position between polls using the local clock for smooth highlighting

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run directly
python -m spotty.cli

Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b my-feature
  3. Make changes and add tests
  4. Run pytest — all tests must pass
  5. Open a pull request

License

MIT — see LICENSE

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

spotty_cli-0.0.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

spotty_cli-0.0.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spotty_cli-0.0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for spotty_cli-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5538641a7856fe15718aad6304242a847e0e7680827d529b98d72ffcc82bfe05
MD5 8f197002cc18ea4ee9a389976b28c727
BLAKE2b-256 285f08125395e4d1a7c5dd9c5329a624a17510c6bb52f7485ca956ff21a63a96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spotty_cli-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for spotty_cli-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fd620d3be01795ce9750c10bd1b1b2831aed9e4f837cb77d49e27655cbe0610
MD5 b233d56635072900313a76d3e6c66a49
BLAKE2b-256 db7d697b531217c203caef0b922188a72d1cac0e30b4304bf9d6e21d8fc13a92

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