KodiHelper.py 文件源码

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

项目:plugin.video.netflix 作者: asciidisco 项目源码 文件源码
def get_inputstream_addon(self):
        """Checks if the inputstream addon is installed & enabled.
           Returns the type of the inputstream addon used and if it's enabled,
           or None if not found.

        Returns
        -------
        :obj:`tuple` of obj:`str` and bool, or None
            Inputstream addon and if it's enabled, or None
        """
        is_type = 'inputstream.adaptive'
        is_enabled = False
        payload = {
            'jsonrpc': '2.0',
            'id': 1,
            'method': 'Addons.GetAddonDetails',
            'params': {
                'addonid': is_type,
                'properties': ['enabled']
            }
        }
        response = xbmc.executeJSONRPC(json.dumps(payload))
        data = json.loads(response)
        if 'error' not in data.keys():
            if isinstance(data.get('result'), dict):
                if isinstance(data.get('result').get('addon'), dict):
                    is_enabled = data.get('result').get('addon').get('enabled')
            return (is_type, is_enabled)
        return (None, is_enabled)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号