• 1
  • 201
  • 202
  • 203(current)
  • 204
  • 205
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Hey,

Just checking compatibility with Gotham. I think I read about this but can't find it now. Am I right in saying access is only allowed to directories defined as sources? The reason is I use the code below to list the language files etc.

Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params" : { "directory" : "C:\\Users\\username\\AppData\\Roaming\\XBMC\\addons\\webinterface.awxi/lang", "media" : "files", "properties": [ "file" ], "sort": { "order": "ascending", "method": "file" } }, "id": 1}

A bit screwed without this access. Ta.
Image
AWXi - Ajax web interface. Wiki
Reply
Is this a no go at all?
Image
AWXi - Ajax web interface. Wiki
Reply
Try this path...

Code:
special://home/addons/webinterface.awxi/lang/

I think this should work
Reply
(2013-12-22, 14:44)Millencolin007 Wrote: Try this path...

Code:
special://home/addons/webinterface.awxi/lang/

I think this should work

Sounds like a much better approach to me because the example you provided only works on windows anyway and won't work on any other operating system.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
I use

Code:
{ "method": "Addons.GetAddonDetails", "id": 0, "jsonrpc": "2.0", "params": { "addonid": "webinterface.awxi", "properties": ["path"] } }

first to get the addon path in case someone has renamed it or done anything silly etc.

Sadly still the same; debug log:
Code:
CUtil::GetMatchingSource: no matching source found for [special://home/addons/webinterface.awxi/lang/]

I could hardcode it but dynamic loading makes more sense if possible Smile
Image
AWXi - Ajax web interface. Wiki
Reply
Yes, you are right it doesn't work anymore. I was testing against 12.3 but thought it was a nightly build

Take a look at the function RemoteAccessAllowed
https://github.com/xbmc/xbmc/blob/master...eUtils.cpp
Reply
I'm doing this way:

Code:
102. jsonGetMovieDetails = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "params": {"properties": ["title", "plot", "rating", "year", "thumbnail", "fanart", "runtime", "genre", "director", "originaltitle", "country", "trailer", "playcount", "lastplayed", "dateadded", "streamdetails"], "movieid": ' + id + '}, "id": "1"}'
103. jsonGetMovieDetailsResponse = json.loads(xbmc.executeJSONRPC(jsonGetMovieDetails))

and get error (stars at line 154): xbmc.log


Should I use json.dumps?
Reply
There are quite a few threads about this topic. JSON-RPC returns UTF-8 paths but your decoding of the string is wrong. I don't remember the solution (because I don't really know python) but I'm sure you'll be able to find the solution when searching with the error in the log.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
trash
Reply
This folder is no more accessible from JSON.
Reply
(2011-06-08, 16:40)Montellese Wrote: As an FYI the "tvshowid" parameter in VideoLibrary.GetEpisodes just became optional with the latest commit. Now you can retrieve all episodes in your library if needed. But beware if you want to use the "season" parameter, you need to define the "tvshowid" parameter as well.

Will this also be implemented for VideoLibrary.GetSeasons? So that you can get a list of all the seasons.
Reply
(2014-01-16, 12:43)Rizzo Wrote:
(2011-06-08, 16:40)Montellese Wrote: As an FYI the "tvshowid" parameter in VideoLibrary.GetEpisodes just became optional with the latest commit. Now you can retrieve all episodes in your library if needed. But beware if you want to use the "season" parameter, you need to define the "tvshowid" parameter as well.

Will this also be implemented for VideoLibrary.GetSeasons? So that you can get a list of all the seasons.

Not for Gotham as the current code in the videodatabase for seasons is very limited and only works for seasons of a specific tvshow.
But in a branch I'm currently working on (nothing to do with JSON-RPC though) I have actually refactored that code to be able to retrieve all seasons independent of the tvshow. So it's a possibility for a future release.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
(2013-11-21, 08:53)Montellese Wrote:
(2013-11-20, 14:36)mikebzh44 Wrote: Hi.

Butchabay have made some tests with my script (randomandlastitems) with Gotham and it seems that this release cannot resolve special://skin path :

http://forum.xbmc.org/showthread.php?tid...pid1508162

How to reproduce this issue (tested with Gotham 13.0-ALPHA10 Git:20131117-7f212b9) :

1 - create playlists/video/<PlaylistName>.xsp file in skin folder
2 - Try to get movie list from this playlist :

Code:
_json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded"]}, "id": 1}' %(PLAYLIST))
    _json_query = unicode(_json_query, 'utf-8', errors='ignore')
    _json_pl_response = json.loads(_json_query)
    print("##### RESPONSE=",_json_pl_response)

Error in xbmc.log :

Code:
13:23:47 T:6976   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://skin/playlists/video/Parents.xsp", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded"]}, "id": 1}
13:23:47 T:6976   DEBUG: CUtil::GetMatchingSource: no matching source found for [special://skin/playlists/video/Parents.xsp]
13:23:47 T:6976   DEBUG: Previous line repeats 4 times.
13:23:47 T:6976  NOTICE: ('##### RESPONSE=', {u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Invalid params.', u'code': -32602}})

The same playlist stored in special://profile/playlists/video/Parents.xsp is OK :

Code:
13:28:36 T:6084   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://profile/playlists/video/Parents.xsp", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded"]}, "id": 1}
13:28:36 T:6084   DEBUG: CVideoDatabase::RunQuery took 15 ms for 92 items query: select * from movieview  WHERE ((movieview.strPath LIKE '%Parents%'))
13:28:36 T:6084  NOTICE: ('##### RESPONSE=', {u'jsonrpc': u'2.0', u'id': 1, u'result': {u'files': [{u'rating': 3.799999952316284, u'art': {u'fanart': ....................
.........

Using special://skin/playlists/video/Parents.xsp file is OK in Frodo :

Code:
13:07:21 T:3380   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://skin/playlists/video/Parents.xsp", "media": "video", "properties": ["title", "originaltitle", "playcount", "year", "genre", "studio", "country", "tagline", "plot", "runtime", "file", "plotoutline", "lastplayed", "trailer", "rating", "resume", "art", "streamdetails", "mpaa", "director", "dateadded"]}, "id": 1}
13:07:21 T:3380   DEBUG: CVideoDatabase::RunQuery took 14 ms for 92 items query: select * from movieview  WHERE ((movieview.strPath LIKE '%Parents%'))

Thanks.

Probably because of the restrictions added to Files.GetDirectory for security reasons. Will see if "special://skin" is in the list of exceptions.

Has this issue been resolved? where can I find the Gotham security exceptions list? I'm currently unable to request json response from a playlist located in userdata\addon_data.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
(2014-01-17, 01:01)Lunatixz Wrote: Has this issue been resolved? where can I find the Gotham security exceptions list? I'm currently unable to request json response from a playlist located in userdata\addon_data.

Right now you can access any of the following paths (or it's sub-directories):
  • virtualpath://upnproot/
  • musicdb://
  • videodb://
  • library://video
  • sources://video
  • special://musicplaylists
  • special://profile/playlists
  • special://videoplaylists
  • addons://sources
  • upnp://
  • plugin://
  • all paths you have specified as a source (or as part of a source)

If there's any missing, please let me know which ones and provide an argument/use case why it's necessary.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Thanks! I think userdata/addon_data needs to be added. In my case, I have a plugin that generates xsp stored in addon_data, and then want to run a query on them. addon_data folder is there for various plugin files, doesn't make sense to include addon folder without its data folder.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
  • 1
  • 201
  • 202
  • 203(current)
  • 204
  • 205
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8