Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /play server endpoint #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Russtopia
Copy link

@Russtopia Russtopia commented Nov 23, 2023

It seemed the server mode was missing an HTTP handler for the play operation which is available in CLI mode. Tested briefly.

Example usage:

$ go-google-home/cmd/ghcli$ ./ghcli -toml default.toml server -port 8084


## Example of sending a 'play' media URL (MP3 file) to ghcli running in server
## mode.

curl --header\
 "Content-Type: application/json
 --request POST\
 --data\
   '{"text": "https://drive.google.com/u/0/uc?id=1RrbBo5BX8XqFpMZgNe_wTehnAUkPSLlB&export=download"}'\
 http://localhost:8084/play

Also works with Google translate's TTS links, which also lets one specify the accent, unlike the /speak endpoint:

$ curl --header "Content-Type: application/json" --request POST --data '{"text": "https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en-uk&q=I+love+coffee"}' http://localhost:8084/play

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.

1 participant