aome510 / spotify-player

A Spotify player in the terminal with full feature parity
MIT License
3.14k stars 137 forks source link

Integrate a HTTP REST API to play Playlists #433

Closed mrfatboy closed 2 months ago

mrfatboy commented 2 months ago

I just found and installed this repo. I got it working. This project looks promising.

Are there any plans to integrate an http rest api to control spotify? I am specifically looking for a REST API that I can play spotify playlists. My use case is having a dedicated host (macmin, Rpi, etc) running this app outputting the audio to my receiver. I would like to use home automation (ie Siri, Homekit),etc to control this app via REST api.

I would like to hear your thoughts on the subject and if you have any questions.

I looked at mopidy but it looks like it ended spotify support in March 2022.

Thank you

aome510 commented 2 months ago

Are there any plans to integrate an http rest api to control spotify? I am specifically looking for a REST API that I can play spotify playlists. My use case is having a dedicated host (macmin, Rpi, etc) running this app outputting the audio to my receiver. I would like to use home automation (ie Siri, Homekit),etc to control this app via REST api.

spotify_player provides CLI commands to interact with a running application and control spotify. You can build a REST API server or whatever using provided CLI commands as the baseline. It will also be easier to do it that way as you have more control over the API architecture.

I see no point of implementing a HTTP server inside the application while there exists CLI with the same functionalities.

mrfatboy commented 2 months ago

Is there a way to play a specific playlist on Spotify, either from a personal list or a premade Spotify playlist via a cli command? How?

aome510 commented 2 months ago
> spotify_player playback start context -h
Start a context playback

Usage: spotify_player playback start context [OPTIONS] <--id <id>|--name <name>> <context_type>

Arguments:
  <context_type>  [possible values: playlist, album, artist]

Options:
  -s, --shuffle      Shuffle tracks within the launched playback
  -i, --id <id>
  -n, --name <name>
  -h, --help         Print help

So spotify_player playback start context playlist --name ...

mrfatboy commented 2 months ago

Thanks. I got it working. I have your app running on a mac mini. Spotify Conntect to a Chromecast connected to my receiver. The next step is to use Homebridge with a cli plugin to setup up several preset playlists. This whole system will by tied into Homekit so I will be able to say "Hey Siri, ". It will then turn on my receiver and issue the cli command. I think this will work. Im lucky to have the cli plugin. :)

aome510 commented 2 months ago

Thanks. I got it working. I have your app running on a mac mini. Spotify Conntect to a Chromecast connected to my receiver. The next step is to use Homebridge with a cli plugin to setup up several preset playlists. This whole system will by tied into Homekit so I will be able to say "Hey Siri, ". It will then turn on my receiver and issue the cli command. I think this will work. Im lucky to have the cli plugin. :)

Nice. It sounds like a really fun home project! I'll close this issue for now. Feel free to reopen if you encounter any other issues or have other questions.