def get_movie_content_by_id(self, movieid):
query = {
"jsonrpc": "2.0",
"method": "VideoLibrary.GetMovieDetails",
"params": {
"movieid": movieid,
"properties": [
"genre",
"plot",
"fanart",
"thumbnail",
"art"]
},
"id": "libMovies"
}
try:
rpc_result = xbmc.executeJSONRPC(
jsonrpccommand=json.dumps(query, encoding='utf-8'))
json_result = json.loads(rpc_result)
result = json_result.get('result', None)
if result is not None and 'moviedetails' in result:
result = result.get('moviedetails', {})
infos = {}
if 'genre' in result and len(result['genre']) > 0:
infos.update({'genre': json_result['genre']})
if 'plot' in result and len(result['plot']) > 0:
infos.update({'plot': result['plot']})
art = {}
if 'fanart' in result and len(result['fanart']) > 0:
art.update({'fanart': result['fanart']})
if 'thumbnail' in result and len(result['thumbnail']) > 0:
art.update({'thumb': result['thumbnail']})
if 'art' in json_result and len(result['art']['poster']) > 0:
art.update({'poster': result['art']['poster']})
return infos, art
return False
except Exception:
return False
评论列表
文章目录