[GH-ISSUE #1116] API for controlling playback, authentication... #517

Closed
opened 2026-02-27 19:31:05 +03:00 by kerem · 3 comments
Owner

Originally created by @vidicunt on GitHub (Feb 2, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1116

  1. Is it possible to have an API for controlling playback, kicking users even?

  2. How would I go about filtering who can and can't connect to librespot?

Originally created by @vidicunt on GitHub (Feb 2, 2023). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1116 1. Is it possible to have an API for controlling playback, kicking users even? 2. How would I go about filtering who can and can't connect to librespot?
kerem 2026-02-27 19:31:05 +03:00
Author
Owner

@kingosticks commented on GitHub (Feb 2, 2023):

Yes it is possible, but we only implement a Spotify Connect receiver i.e. for playback. We don't implement a (remote) controller side. Related projects like spotcontrol do implement this.

Alternatively, users can control playback via Spotify's Player Web API. Librespot can provide an access token, or you can obtain one yourself using Spotify's API endpoints. I guess transferring your playback session to the device will kick off anyone already using it?

Librespot does provide a Disconnect method but you'd need to write additional code to expose it. You'd also need to write additional code to implement access control/user filtering, nothing like that exists. I don't think we have any extensions like that. If it did exist, it'd probably belong in ConnectConfig.

<!-- gh-comment-id:1414174564 --> @kingosticks commented on GitHub (Feb 2, 2023): Yes it is possible, but we only implement a Spotify Connect receiver i.e. for playback. We don't implement a (remote) controller side. Related projects like [spotcontrol](https://github.com/badfortrains/spotcontrol) do implement this. Alternatively, users can control playback via [Spotify's Player Web API](https://developer.spotify.com/documentation/web-api/reference/#/operations/start-a-users-playback). Librespot can [provide an access token](https://github.com/librespot-org/librespot/blob/dev/examples/get_token.rs#L25), or you can obtain one yourself using Spotify's API endpoints. I guess transferring your playback session to the device will kick off anyone already using it? Librespot does provide a [Disconnect](https://github.com/librespot-org/librespot/blob/3662302196c1aeb35501db717b88152c50212117/connect/src/spirc.rs#L438) method but you'd need to write additional code to expose it. You'd also need to write additional code to implement access control/user filtering, nothing like that exists. I don't think we have any extensions like that. If it did exist, it'd probably belong in `ConnectConfig`.
Author
Owner

@vidicunt commented on GitHub (Feb 4, 2023):

Thank you. I think a DBus interface or something similar would prove to be useful!

<!-- gh-comment-id:1416772219 --> @vidicunt commented on GitHub (Feb 4, 2023): Thank you. I think a DBus interface or something similar would prove to be useful!
Author
Owner

@roderickvd commented on GitHub (Feb 4, 2023):

spotifyd, a related project, exposes an MPRIS interface.

<!-- gh-comment-id:1416772783 --> @roderickvd commented on GitHub (Feb 4, 2023): spotifyd, a related project, exposes an MPRIS interface.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#517
No description provided.