Festify / app

:tada: Festify Host & Client
https://festify.rocks/
413 stars 73 forks source link

Sonos API #167

Open Djfe opened 6 years ago

Djfe commented 6 years ago

I know, that API is not public, but maybe using app's like the following one, you might be able to look into it ;) (it does Man-in-the-middle for ssl connections; I haven't tested whether the sonos devices do certificate pinning though) https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture

another option: https://github.com/jishi/node-sonos-http-api

Ich hab beim Recherchieren noch folgendes gefunden: https://de.community.sonos.com/rund-um-sonos-223377/schliessung-der-api-fuer-externe-sonos-controller-6742124

Falls es so also nicht mehr geht, wird es wohl bald offzielle APIs geben, die ihr vlt. nutzen könnt :) (oder nicht, weil es Geld kostet)

NeoLegends commented 6 years ago

Hey! Thanks for the hints. We're Sonos-users ourselves and have wanted Sonos integration for quite some time now. The first two options are unlikely to work for us, because you're very limited if you're running through a browser (we cannot access local network, or any kind of "raw traffic").

That said, we have our bets on the official developer platform, and we already applied for an invitation. :)

Djfe commented 6 years ago

here you can subscribe for new infos on the API ;) https://developer.sonos.com/

EDIT: I should read before replying haha

Djfe commented 6 years ago

Kinda relevant (UPNP could be possible through add-ons again in the future): https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=1247628

Until then maybe with a local application that does the UPNP: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging

NeoLegends commented 6 years ago

Until then maybe with a local application that does the UPNP: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging

Ouch, this sounds very very hacky and non-standard.

I think it'd be easier to implement this using a custom protocol over web sockets and a server. The problem with this approach, however, is that Festify is currently fully serverless (i. e. we do not manage any server machinery, everything is done for us) and we'd very much like to keep it that way because it frees us from all the maintanance overhead of provisioning, maintaining and scaling servers.

We will see what we can do regarding this, but we cannot promise anything yet. We'd favor just waiting until Sonos releases its set of APIs and see what we can do with them.

Djfe commented 6 years ago

I'm not sure if local protocols will ever be available in web browsers (unless you use the web extension api), I guess, you'll have to wait for the official api then

NeoLegends commented 6 years ago

I'm not sure if local protocols will ever be available in web browsers (unless you use the web extension api), I guess, you'll have to wait for the official api then

With custom protocol I meant "we send JSON messages over web sockets", which very much is supported right now. :)

Another thing is, we'd definetely would like Sonos playback work if you use Festify on mobile devices (which is kinda whacky because of Spotify right now, but will improve in the future). Requiring a "slave" program on a real PC would be kind of a deal breaker for that.

Djfe commented 6 years ago

I see.

Websockets sure, but for Sonos without an official api you would've needed upnp afaik, which isn't available currently.

leolabs commented 6 years ago

We've applied for the Sonos developer program and hope that we get invited. That may help in implementing this feature.

BeeMargarida commented 4 years ago

How is the status on this?

leolabs commented 4 years ago

We didn't get access to the developer program and have decided to postpone this issue for now as most Sonos speakers support AirPlay now. If you're on Windows, you could use apps like AirFoil to stream audio to your Sonos speakers :)

gieljnssns commented 4 years ago

I'm on a mac, when I use airplay, all sounds from my mac go to my sonos.

Isn't it possible to run Festify in a docker container or on a raspberry pi except from in a browser? Then you can use https://github.com/stephen/airsonos (or some fork of it) or https://github.com/philippe44/AirConnect to stream to a sonos player?

leolabs commented 4 years ago

If you want to send only a specific application's sound to an AirPlay speaker, you could try out AirFoil on macOS as well. I've tried it at my birthday party in November and it works well.

If you want to use a docker container to run Festify, you'd need to run Chrome in Docker as Festify runs entirely in the browser. That should be possible, although you'd have to access the UI through VNC. See this article for an example setup.

gieljnssns commented 4 years ago

as Festify runs entirely in the browser

Isn't it possible to make a 'server-version'? I have an intel nuc running with Home-assistant on it, and some more apps. When you have a server version, there is a never ending Festify-party at my home...

NeoLegends commented 4 years ago

This is harder than you might think due to the DRM on Spotify's music. In fact, Spotify does not at all provide a (reliable) way to stream their music in custom apps due to the issues this would bring with DRM.