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

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/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 - tim2005 - 2012-08-06

I enabled Debug logging, and found the following in the xmb.log file.
Quote:18:36:36 T:1284478048 DEBUG: JSONRPC Server: New connection detected
18:36:36 T:1284478048 INFO: JSONRPC Server: New connection added
18:36:36 T:1284478048 INFO: WebSocket [RFC6455]: invalid "Upgrade" received
18:36:36 T:1284478048 INFO: WebSocket: No frame expected in the current state
18:37:06 T:1284478048 INFO: JSONRPC Server: Disconnection detected
Looks like XBMC and .NET do implement RFC6455 in a different way. Maybe it is because in the working connection the upgrade is "websocket" and in the non-working it is "Websocket", capital use issue?


Edit/Update:
I continued my research and made a small .NET program wich does not use the WebSocket class but the TcpClient class. I copied the working HTTP request to the testapplication and let it send. I succesfully received a 'Switching protocols' response. Then I changed the HTTP request a bit, "Upgrade: websocket" became "Upgrade: Websocket" (capital W). Suddenly it does not work Smile Tried the same with the original request from .NET, modiefied it to not use a capital and then it works fine. Looks a capital issue to me.

Protocol says it should be case-insensitive, see Page 18 subject 2.
http://tools.ietf.org/html/rfc6455#page-18

Edit/Update 2:
I made a bug report for this issue in TRAC: http://trac.xbmc.org/ticket/13231


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-06

(2012-08-06, 18:39)tim2005 Wrote: I enabled Debug logging, and found the following in the xmb.log file.
Quote:18:36:36 T:1284478048 DEBUG: JSONRPC Server: New connection detected
18:36:36 T:1284478048 INFO: JSONRPC Server: New connection added
18:36:36 T:1284478048 INFO: WebSocket [RFC6455]: invalid "Upgrade" received
18:36:36 T:1284478048 INFO: WebSocket: No frame expected in the current state
18:37:06 T:1284478048 INFO: JSONRPC Server: Disconnection detected
Looks like XBMC and .NET do implement RFC6455 in a different way. Maybe it is because in the working connection the upgrade is "websocket" and in the non-working it is "Websocket", capital use issue?


Edit/Update:
I continued my research and made a small .NET program wich does not use the WebSocket class but the TcpClient class. I copied the working HTTP request to the testapplication and let it send. I succesfully received a 'Switching protocols' response. Then I changed the HTTP request a bit, "Upgrade: websocket" became "Upgrade: Websocket" (capital W). Suddenly it does not work Smile Tried the same with the original request from .NET, modiefied it to not use a capital and then it works fine. Looks a capital issue to me.

Protocol says it should be case-insensitive, see Page 18 subject 2.
http://tools.ietf.org/html/rfc6455#page-18

Edit/Update 2:
I made a bug report for this issue in TRAC: http://trac.xbmc.org/ticket/13231

Thanks for tracking this down. I already suspected that it would come down to a case-sensitivity problem. I've pushed a fix. Please let me know whether it solves the problem or not. I have to admit I'm too lazy to write a program to send a websocket header and all the existing ones in firefox, chrome do/did not have this problem.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - tim2005 - 2012-08-07

(2012-08-06, 22:01)Montellese Wrote:
(2012-08-06, 18:39)tim2005 Wrote: I enabled Debug logging, and found the following in the xmb.log file.
Quote:18:36:36 T:1284478048 DEBUG: JSONRPC Server: New connection detected
18:36:36 T:1284478048 INFO: JSONRPC Server: New connection added
18:36:36 T:1284478048 INFO: WebSocket [RFC6455]: invalid "Upgrade" received
18:36:36 T:1284478048 INFO: WebSocket: No frame expected in the current state
18:37:06 T:1284478048 INFO: JSONRPC Server: Disconnection detected
Looks like XBMC and .NET do implement RFC6455 in a different way. Maybe it is because in the working connection the upgrade is "websocket" and in the non-working it is "Websocket", capital use issue?


Edit/Update:
I continued my research and made a small .NET program wich does not use the WebSocket class but the TcpClient class. I copied the working HTTP request to the testapplication and let it send. I succesfully received a 'Switching protocols' response. Then I changed the HTTP request a bit, "Upgrade: websocket" became "Upgrade: Websocket" (capital W). Suddenly it does not work Smile Tried the same with the original request from .NET, modiefied it to not use a capital and then it works fine. Looks a capital issue to me.

Protocol says it should be case-insensitive, see Page 18 subject 2.
http://tools.ietf.org/html/rfc6455#page-18

Edit/Update 2:
I made a bug report for this issue in TRAC: http://trac.xbmc.org/ticket/13231

Thanks for tracking this down. I already suspected that it would come down to a case-sensitivity problem. I've pushed a fix. Please let me know whether it solves the problem or not. I have to admit I'm too lazy to write a program to send a websocket header and all the existing ones in firefox, chrome do/did not have this problem.

Thank you for the very fast fix, 92 minutes after submit. I am downloading the most recent night windows build containing this fix. Had to wait for it, will report back soon.

Update: The connection succeeds now Smile Great job! Keep up the good work.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2012-08-07

Using the latest windows build (20120806) VideoLibrary.GetMovieDetails returns "set": "\u0000" for every movie.
I removed the nfo files and rescraped the movies on my test setup just in case it was a conflict with old nfo files but its still happening (even for movies without sets). Am i missing something? Or is this a bug?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-07

(2012-08-07, 11:40)N3MIS15 Wrote: Using the latest windows build (20120806) VideoLibrary.GetMovieDetails returns "set": "\u0000" for every movie.
I removed the nfo files and rescraped the movies on my test setup just in case it was a conflict with old nfo files but its still happening (even for movies without sets). Am i missing something? Or is this a bug?

Thanks for the report. Stupid copy & paste errors. Fixed in https://github.com/xbmc/xbmc/commit/bf51552620d6df6d21b79ad65e5f8bb99245715f


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-08-08

I think something is borken here:
Code:
{"jsonrpc":"2.0","id":2,"method":"Player.GetProperties","params":{ "playerid":0,"properties":["time", "totaltime"] } }
Code:
{"id":2,"jsonrpc":"2.0","result": {"hours":0,"milliseconds":315,"minutes":3,"seconds":19},"totaltime":{"hours":141,"milliseconds":0,"minutes":48,"seconds":31}}}
Hours on totaltime always reports 141.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-08-08

This has been reported before. AFAIK it got broken with the AE merge because gnif has re-written the whole music player (PAPlayer) and like the missing/double notifications from the music player this seems to be broken as well. But I didn't have the time yet to look into it and I got no clue about the player implementation so might take a while to solve this.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-08-08

Okay. I've only just noticed it or I forgot about it. Would be good if we could get the AE demons out Smile




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-08-08

I can't see a ticket for this one. But first...

VideoLibrary.GetGenres doesn't appear to honour sort. Example:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetGenres", "params": { "type": "movie" }, "sort": { "method": "label" }, "id": 1}

Returns in genreid order. Unless I'm being stupid as is always possible Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2012-08-09

(2012-08-06, 13:37)Montellese Wrote: THESE CHANGES BREAK BACKWARDS COMPATIBILITY WITH VERSION 4 OF JSON-RPC API!!!
  • a lot of properties which were returned as a concatenated string with a "/" seperator are now returned as arrays of strings instead. This should make parsing the response a lot easier for clients.
I grew to like the old "/" separated arrays Wink I wish you would have made a parameter option to query using the old delimited array or rather the other way around so as not to completely break backward compatibility. I cache this data to a file in my remotes, so adding a loop for multiple parameters in each movie is more costly (thankfully this is only done once).


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-08-09

(2012-08-09, 00:55)dwagner Wrote:
(2012-08-06, 13:37)Montellese Wrote: THESE CHANGES BREAK BACKWARDS COMPATIBILITY WITH VERSION 4 OF JSON-RPC API!!!
  • a lot of properties which were returned as a concatenated string with a "/" seperator are now returned as arrays of strings instead. This should make parsing the response a lot easier for clients.
I grew to like the old "/" separated arrays Wink I wish you would have made a parameter option to query using the old delimited array or rather the other way around so as not to completely break backward compatibility. I cache this data to a file in my remotes, so adding a loop for multiple parameters in each movie is more costly (thankfully this is only done once).

Keeping both is just a no-go code wise. Just to messy.
Beside some more things will probably break in coming months


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2012-08-09

is there any way to set thumbnail/fanart for movie sets and seasons over json api?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2012-08-09

I'm getting a crash every time I try run JSONRPC.Introspect (latest build: xbmc-20120808-0531bbf-master-x86_64)

Code:
{"method":"JSONRPC.Introspect","id":1,"jsonrpc":"2.0"}

I wanted to file this in trac, but it seems I've somehow forgotten my username and password and for the life of me I can't find an option to reset it. Not to mention that clicking Help/Guide goes to a page not found.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2012-08-09

I have a question regarding the new image URL's provided by JSON API 5. Are these URL's temporary. In other words, if I query a movie save the URL, and only try retrieve the image via the image:// URL a few days and many other queries later, will it still work.

In my remote I cache all these URL's and retrieve the images only when needed.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - N3MIS15 - 2012-08-09

The introspect shows year, originaltitle and imdbnumber as valid properties for VideoLibrary.SetTVShowDetails but none of them seem to work. Are they even sure they're supposed to be in there?

Maybe 'tvdbnumber' could be used for tv shows? Or both?