Hi guys,
I’m developing an add-on for the first time. The add-on is supposed to use JSON commands to obtain some information from the Kodi library as well as set/change some parameters in it.
I have actually a question related to how retrieve the IMDb id for a TV Show after having received the following JSON Response:
Code:
JSON Response: {"id":1,"jsonrpc":"2.0","result":{"limits":{"end":1,"start":0,"total":1},"tvshows":[{"label":"Stranger Things","mpaa":"TV-14","rating":9,"tvshowid":1,"uniqueid":{"imdb":"tt4574334","tmdb":"66732","tvdb":"305288"},"votes":"262868"}]}}
Basically, which is the code/syntax to save in a local variable (e.g. IMDb_id) the received tt4574334 value? I have tried the following code but the result in IMDb_id is None:
Code:
for item in jSonResponse['result']['tvshows']:
IMDb_id = item.get('uniqueid[0]')
Thanks for any help…please take into account that I’m just facing JSON and python without any expereince on them…