2017-05-09, 19:30
(2017-05-09, 16:37)axlt2002 Wrote:(2017-04-08, 13:48)DanCooper Wrote: Yes, the uniqueid table is a part of the Kodi DB. I've tested it with a new NFO that contains multiple <uniqueid> nodes:
Call:
Code:http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"VideoLibrary.GetTVShowDetails", "params": {"properties": ["uniqueid"], "tvshowid":10}}
Result:
Code:{"id":"1","jsonrpc":"2.0","result":{"tvshowdetails":{"label":"Game of Thrones","tvshowid":10,"uniqueid":{"imdb":"tt0944947","unknown":"121361"}}}}
As you can see, the API tells you all saved IDs.
EDIT: tested with Kodi 17.1.
Hi Dan,
I'm slowly progressing on the development of my add-on. I have actually a question related to how "extract" the IMDb id for a TV Show after having received the following JSON Response (the starting .nfo file use the id/uniqueid structure we discussed previously):
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...and sorry for the stupid question, but I'm just facing JSON and python for the first time!
Sorry, I've no skills in Python :-(
But I would just do it with a regex:
Code:
imdb":"(tt\d{6}\d*)
Link