KodiHelper.py 文件源码

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

项目:plugin.video.netflix 作者: asciidisco 项目源码 文件源码
def get_show_content_by_id(self, showid, showseason, showepisode):
        showseason = int(showseason)
        showepisode = int(showepisode)
        props = ["season", "episode", "plot", "fanart", "art"]
        query = {
                "jsonrpc": "2.0",
                "method": "VideoLibrary.GetEpisodes",
                "params": {
                    "properties": props,
                    "tvshowid": int(showid[0])
                },
                "id": "1"
                }
        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 'episodes' in result:
                result = result['episodes']
                for episode in result:
                    in_season = episode['season'] == showseason
                    in_episode = episode['episode'] == showepisode
                    if in_season and in_episode:
                        infos = {}
                        if 'plot' in episode and len(episode['plot']) > 0:
                            infos.update({
                                'plot': episode['plot'],
                                'genre': showid[1]})
                        art = {}
                        if 'fanart' in episode and len(episode['fanart']) > 0:
                            art.update({'fanart': episode['fanart']})
                        if 'art' in episode and len(episode['art']['season.poster']) > 0:
                            art.update({
                                'thumb': episode['art']['season.poster']})
                        return infos, art
            return False
        except Exception:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号