Kodi Community Forum
RPC Call to Play an Item in Favourites - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: RPC Call to Play an Item in Favourites (/showthread.php?tid=358289)



RPC Call to Play an Item in Favourites - C0NFUSER - 2020-11-09

Hi,

I am trying to find a way to remotely execute Items from my Favourites using JSON-RPC_API. More specifically I am trying to run a http call using another computer in my local network and Play a Radio station which I have it in my Favourite list. Looking at the https://kodi.wiki/view/JSON-RPC_API/v12 I cant really find anything related with that.. Is it possible? Does anyone have any similar example?

Thank you!


RE: RPC Call to Play an Item in Favourites - black_eagle - 2020-11-09

I did this years ago but I had to duplicate the favourites entries to do it.  If I was doing it now I guess I would do things differently and probably use python to parse the favourites.xml file and find the correct entry.

Anyway, you can call either a file or a plugin with

xml:

#file="smb://diamond/userdata/absolute80s.m3u"  ## Target station in m3u file
#file="plugin://plugin.audio.radio_de/station/3261" ## Target station is in plugin
result=$( curl -s --data-binary '{"jsonrpc": "2.0", "method": "Player.Open", "params":{"item":{"file": "'$file'"}}}, "id": 1}' -H 'content-type:application/json;' http://$KodiAddress:$KodiPort/jsonrpc)