Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2013-02-01 02:59

(2013-01-31 09:44)Montellese Wrote:  
(2013-01-31 05:54)doozer Wrote:  Frodo 12.0 stable:

Via the keyboard you can hit the 'i' key and it will toggle the playback info on screen (for example the movie name and playback position etc).

Is there a way via the JSONv6 API to do the same thing?

Sending a GUI.ActivateWindow with the param 'videoosd' displays the overlay, but there is no way to remotely cancel it. Which results in any further commands being queued until you use the keyboard/mouse directly on the XBMC machine.

Anyone managed to get this working?

Thanks,
Matt.
Yeah this works with the keyboard because of the keymappings in keyboard.xml but IMO executing the "info" action (or whatever it's called) should lead to closing the info overlay if it's already open. Have you tried the "backspace" action to close the OSD / info overlay?

No, it seems that all commands are blocked until a local user (via keyboard or mouse) closes the info overlay. Feels like a bug to me Smile

Edit: Turns out you can do an "Input.ShowOSD", this toggles the display and doesn't lock up.

Thanks,
Matt.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2013-02-01 08:54

Frodo 12.0 Stable (Windows)

Sorry, if i've missed something obvious here, but i'm having a hard time figuring out how to request a list of recorded tv shows from the PVR.

I've tried sending a PVR.GetChannelGroups, but it only returns an id for all tv channels, not previously recorded items.

I'm using the PVR Demo Client add-on which shows 10 demo recordings.

Any pointers would be greatly appreciated.

Thanks,
Matt.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-02-01 09:16

Recordings are not supported yet. PVR was merged right before feature freeze so there wasn't enough time to get full support into JSON-RPC. I was only allowed to introduce basic PVR control methods to be able to retrieve channels and control PVR playback.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2013-02-01 10:32

(2013-02-01 08:54)doozer Wrote:  Frodo 12.0 Stable (Windows)

Sorry, if i've missed something obvious here, but i'm having a hard time figuring out how to request a list of recorded tv shows from the PVR.

I've tried sending a PVR.GetChannelGroups, but it only returns an id for all tv channels, not previously recorded items.

I'm using the PVR Demo Client add-on which shows 10 demo recordings.

Any pointers would be greatly appreciated.

Thanks,
Matt.

Yep, that would explain it Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-02-03 14:50

Just discovered some problems in Frodo with the usage of Sources.xml to add sources. (http://yatse.leetzone.org/redmine/issues/279)

The first problem is that you can't browse them from JSON if the sources are password protected, the getsources does not send the password (that seems logical) but then does not auto use it for browsing.
Code:
<music>
    <default>Music</default>
    <source>
      <name>Music</name>
      <path>smb://xbmc:***********@192.168.1.96/Music/</path>
    </source>
    <source>
      <name>Download</name>
      <path>smb://xbmc:***********@192.168.1.96/Download/</path>
    </source>
  </music>
If there's no way to get around this is would be cool to change the error message since "Invalid params." is not very clear about the problem Smile

The second problem is much much more important and is for me a big security flaw :
All images urls generated and send back does contains the login and password to the source if you are using folder.jpg or any local media.
Code:
"thumbnail":"image://smb%3a%2f%2fxbmc%3a***********%40192.168.1.96%2fMusic%2fMaybeshewill%2f2011%20-%20I%20was%20here%20for%20a%20moment%2c%20then%20I%20was%20gone%2fcover.jpg/"
And same goes for medias in nowplaying at least since you can't browse the source (but I guess if we could they will be there too)
Code:
"file":"smb://xbmc:***********@192.168.1.96/Music/Maybeshewill/2011 - I was here for a moment, then I was gone/04 - Critical Distance.flac"

Since those are send back on the default web server this is not cool at all.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-02-03 15:04

It's the same problem as passwords showing up in the debug log. XBMC's password handling is clunky at best right now and needs a big overhaul. Passwords should only be used internally and never passed to python or json-rpc or anything else that can be accessed from outside xbmc.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-02-03 15:12

This seems to only happens when using the sources.xml not when adding then from the interface.

Perhaps worth at least a warning on the Wiki about that ?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - vava - 2013-02-04 10:30

Hi. I just upgraded to Frodo (linux) and since HTTP RPC is now removed, looking at ways to port my supporting scripts to JSON RPC.
The biggest bummer is that I can't find the way to change GUI properties. In Eden, I was disabling shutdown timer with "SetGuiSetting(0;powermanagement.shutdowntime;0)" through HTTP RPC to make sure PC stays on when I need it. (It was usually set to 30 and XBMC would shutdown PC when no one is using it, but I set it to 0 when mythtv recording is about to start or I have ssh session open).
Now there don't seem to be a way I can do the same through JSON RPC. Am I missing something? Is write support for properties planned in the future?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - johnsills1 - 2013-02-04 20:53

(2013-02-04 10:30)vava Wrote:  Hi. I just upgraded to Frodo (linux) and since HTTP RPC is now removed, looking at ways to port my supporting scripts to JSON RPC.
The biggest bummer is that I can't find the way to change GUI properties. In Eden, I was disabling shutdown timer with "SetGuiSetting(0;powermanagement.shutdowntime;0)" through HTTP RPC to make sure PC stays on when I need it. (It was usually set to 30 and XBMC would shutdown PC when no one is using it, but I set it to 0 when mythtv recording is about to start or I have ssh session open).
Now there don't seem to be a way I can do the same through JSON RPC. Am I missing something? Is write support for properties planned in the future?

vava - I might not be able to help you with all of your needs, but you are more than welcome to browse Devices under the User for XBMC JSON (John's) and import it. I have done alot of work to find out how everything is supposed to work. With the help of many people here on the forum, I have my remote back up and running with JSON.... Hope this helps


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2013-02-05 06:13

I recall reading somewhere that that new /image method of getting cover/fan art etc would provide a resizing option... is this available in Frodo 12.0?

Any docs on it?

Thanks,
Matt.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-02-05 09:19

Nope not available yet. Hopefully it will make it into XBMC 13.0.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - doozer - 2013-02-05 11:05

(2013-02-05 09:19)Montellese Wrote:  Nope not available yet. Hopefully it will make it into XBMC 13.0.

Thanks for the quick response.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - thezoggy - 2013-02-05 17:53

If you want to use an image in the ui notification, it has to be valid xbmc resource. The problem is that users don't always run the app on the same box as xbmc (or even multi xbmc setups).. or even on the same lan.
Thus, with the current implementation -- the only reliable way to ensure that the path to the image is going to be valid is to use something outside the lan altogether, like a url to github/website.
This is not ideal for most, especially any large 3rd party app. It would be nice if we could just pass a base64 encoded image that way it doesn't matter where you notify from.. or if the user isn't connected to the internet (lan only)

Also, it would be nice to be able to update a show via its xbmc id / tvdbid or something.. rather than a path. as a show could have multiple paths.. and then obtaining the path requires looking up the show.. then getting the details for that show.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - thica - 2013-02-06 22:20

Hello,

I am looking/searching for two different solutions using json commands:

1) a command to filter the current video list to "all videos", "watched videos", "unwathced videos"

2) a command to filter the current video list to a given genre eg. "crime"

Is this possible?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2013-02-07 07:28

filter genre:
Code:
{
    'jsonrpc': '2.0',
    'id': 0,
    'method': 'VideoLibrary.GetMovies',
    'params': {
        'filter': {
            'genre': 'action'
        }
    }
}

for watched/unwathed i filter manualy..
Code:
{
    'jsonrpc': '2.0',
    'id': 0,
    'method': 'VideoLibrary.GetMovies',
    'params': {
        'properties': [
            'playcount'
        ]
    }
}

python watched:
Code:
[x for x in returned_data if x['playcount']]

python unwatched:
Code:
[x for x in returned_data if not x['playcount']]