KODI API examples
#1
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)?
Reply
#2
This thread may be useful to you, if you haven't already found it.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
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.
Reply
#4
I saw your other thread (there was no need to start a second one, it has been merged into the main addon support thread).

But to be clear, the API is for Kodi, not for the addons. So it will possibly be the case that what you want to do is not possible.
I know there are some commands relating to addons, but it's more from the Kodi side of things than actually operating addons themselves within Kodi.

For example, we have this command which will execute the addon (ie open it), but unless it can accept a station url or some other way to tell it what to play (and indeed to play it) then you may be out of luck.

As you can see from the rest of that list of commands, the API is more designed to control Kodi itself and to play stuff in its libraries rather than on through addons, which are a bit more seperate.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#5
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.
Reply
#6
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.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#7
Thanks to @fivebanger work I've reached what I want.
Now my player may be voice controlled with some basic functions.

Here's more:
https://forum.kodi.tv/showthread.php?tid=119362&page=55
Reply

Logout Mark Read Team Forum Stats Members Help
KODI API examples0