[PY] Best way to read JSON response?
#31
i have used it ith just xbmc/xbmc to login without issue (well, there is an error logged in the console about Basic auth realm but it still works). Is that the error you mean? Are you going to submit a pull request back to the library?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#32
Here's another simple way of creating queries:

Code:
def rpc(method, **params):
    params = json.dumps(params)
    query = '{"jsonrpc": "2.0", "method": "%s", "params": %s, "id": 1}' % (method, params)
    return json.loads(xbmc.executeJSONRPC(query))

# use like this:
response = rpc("Files.GetSources", media='video')
Reply
#33
(2014-04-03, 11:29)bossanova808 Wrote: i have used it ith just xbmc/xbmc to login without issue (well, there is an error logged in the console about Basic auth realm but it still works). Is that the error you mean? Are you going to submit a pull request back to the library?

It worked for me with "xbmc/xbmc" but if I changed the username or password in xbmc and tried the code with the new credentials I got a 401 error.

I've submitted a pull request.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
[PY] Best way to read JSON response?0