Posts: 36
Joined: Apr 2018
Reputation:
0
I want to do some things in KODI via some kind of API (or commandline via ssh with keys)
rather basic ones - play/pause/stop, vol_up/vol_down/mute, but also - play a radiostation from standard extension 'radio'
I've found kodi-json python lib, but its quite old and does not work for me.
Is there any other solution, if possible - with working examples (I don't have experience with using APIs at all)?
Posts: 36
Joined: Apr 2018
Reputation:
0
Thank you. this thread explains a lot. I know how to control player itself and some others...
However I still don't know what are Radio addon commands, but will try to find it.
Posts: 36
Joined: Apr 2018
Reputation:
0
I understand.
So what about one of other ways?
1) As I understand python module "xbmc" may work only on kodi-enabled machine. May this module help me? Is it able to run radio station (defined eralier, no search of sth) in the addon? I can communicate my source machine with kodi device outside of kodi itself, even via ssh, and run python script with required command.
2) Is it possible to run required command in addon from another addon. I even have my own, it just turns on/off self-made ambilight, triggered from remote/keyboard.
Is at least one of them possible at all?
I don't have enough knowledge (yet?) to use third way - modifying radio addon to make it suitable to my needs.
Posts: 12,616
Joined: Oct 2014
Reputation:
626
The point is the API is for Kodi, not addons. So item 2 is unlikely to be any better than going direct.
But I see from the radio addon thread (which in itself is getting a bit confusing as there are 2-3 addons seemingly now sharing that thread) that Fivebanger has made some suggestions and modifications for his version of the addon.
So hopefully that should enable you to do what you want.
Another way might be to remove the addon itself completely from the equation by having Kodi directly play the stream from the radio station involved.
That should be possible via the API, although it might take a bit of digging to extract the stream url etc.