librespot-org / librespot

Open Source Spotify client library
MIT License
4.7k stars 573 forks source link

API for controlling playback, authentication... #1116

Closed vidicunt closed 1 year ago

vidicunt commented 1 year ago
  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?

kingosticks commented 1 year ago

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.

vidicunt commented 1 year ago

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

roderickvd commented 1 year ago

spotifyd, a related project, exposes an MPRIS interface.