go-chromecast icon indicating copy to clipboard operation
go-chromecast copied to clipboard

json output?

Open jackmac92 opened this issue 2 years ago • 1 comments

Hey I'd like to use go-chromecast for scripting, e.g. get the current author/title of the playing video non-interactively

And extracting from json with jq would make my life much simpler.

I'm not familiar with the codebase, but if you don't have any known gotchas/concerns I'd like to take a stab at a PR with a flag for output format

jackmac92 avatar Feb 03 '23 02:02 jackmac92

Hey! That sounds like a good idea; I can't think of any immediate issues that might be of concern. There is a JSON version of the output in https://github.com/vishen/go-chromecast/blob/master/http/handlers.go for the HTTP responses, but I don't know how reusable that is (don't worry about unifying them either).

Not sure the best approach for this, so happy with whatever you come up with! It might require reworking all the output from cmd/ folder, but happy to have a more standardised approach to do this.

vishen avatar Feb 04 '23 01:02 vishen