Skip to content

Spotify plugin: support Spotify Soloist next to go-librespot, and 2000 px covers (#388) - #392

Merged
txoof merged 4 commits into
mainfrom
388-soloist
Dec 6, 2026
Merged

txoof merged 4 commits into
mainfrom
388-soloist

Conversation

@txoof

@txoof txoof commented Dec 6, 2026

Copy link
Copy Markdown
Owner

Closes #388

What changed

The Spotify plugin (librespot_client) can now read what is playing from Spotify Soloist, Spotify's own player, as well as from go-librespot. Spotify is closing the way go-librespot logs in, and some accounts can't use it any more.

  • New setting player: go-librespot (the default, so existing config files work as before) or soloist.
  • port may be left empty: it then means the player's usual port, 24879 for go-librespot and 9878 for soloist.
  • Reading soloist: soloist has a WebSocket (a two-way connection) on 127.0.0.1:9878. At each update the plugin connects, asks once for the state (get_state), reads the answer and closes. It behaves like the go-librespot route: playing or buffering shows the song, paused keeps it for idle_timeout, idle or logged out shows nothing, and no answer is an error.
  • Larger album covers for both players: Spotify's image server also has a 2000 px version of each cover (undocumented). The plugin asks for it first and falls back to the size the player gave. All cover downloads share one 25-second time budget, so a slow image server can't push an update past its 60-second limit. The cover limit is now 5 MB, the same as PaperPi's general download limit.
  • "Find go-librespot" is now "Find Spotify player": it also finds a running soloist from its command line in /proc. It reads only the name (-n) and the WebSocket address (-w). The soloist API key that is on the same command line is skipped and never kept, shown or logged (tested). It shows a warning when soloist's WebSocket is open to the whole network.
  • README: explains go-librespot's limits, and how to set up Soloist with soloist-autoupdate.
  • New dependency: websockets (pyproject.toml and uv.lock, written with uv 0.12.23). It is imported only inside the functions that use it, so the plugin still imports quickly. No other open PR changes these files.
  • LibrespotError is renamed PlayerError.

Area

plugins/librespot_client (src/paperpi/plugins/librespot_client/, tests/test_librespot_client.py) and ci (pyproject.toml, uv.lock, for the new dependency).

Tests

  • About 35 new tests in tests/test_librespot_client.py. They cover:
    • every soloist status, missing or wrong fields, logged out
    • connection errors, handshake failures and the state deadline, including against a real websockets server on a free port
    • the 2000 px cover, its fallback and the shared time budget, covers not saved on a nearly full disk
    • the helper's /proc parsing, including a test that the -k key never appears in the result
    • an old config block with only port still meaning go-librespot.
  • uv run pytest passes: 2507 passed on develpi-4 (Pi, Python 3.13)
  • uv run ruff check . passes (and ruff format --check)
  • Hardware tests run on the Pi (only if display or driver code changed): no display or driver code changed. Tried on the real IT8951 screen of develpi-4 with soloist 2.0.0.5: the cover and song information show as expected (checked by txoof). The saved covers were 1400 to 2000 px, where they used to be 640 px.

Images

No layout changed; the example pictures are the same. The visible difference is the sharper cover from the 2000 px picture.

Review

  • Review agents' comments answered. A review before this PR found that two cover downloads in a row could pass the update time limit, plus some smaller points; all are fixed in the second commit.

Only txoof approves and merges this PR.

🤖 Generated with Claude Code

txoof and others added 4 commits December 6, 2026 15:02
…h-resolution covers (#388)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er checks, soloist helper warnings (#388)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some 2000 px covers are close to 2 MB; larger ones fell back to 640 px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ist with soloist-autoupdate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@txoof
txoof merged commit 6117c7d into main Dec 6, 2026
4 checks passed
@txoof
txoof deleted the 388-soloist branch December 6, 2026 14:41
@txoof txoof mentioned this pull request Dec 6, 2026
This was referenced Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Spotify Soloist

1 participant