KodiHelper.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:plugin.video.netflix 作者: asciidisco 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号