control.py 文件源码

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

项目:plugin.video.brplay 作者: olavopeixoto 项目源码 文件源码
def get_inputstream_addon():
    """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
    """
    type = 'inputstream.adaptive'
    payload = {
        'jsonrpc': '2.0',
        'id': 1,
        'method': 'Addons.GetAddonDetails',
        'params': {
            'addonid': type,
            'properties': ['enabled']
        }
    }
    response = xbmc.executeJSONRPC(json.dumps(payload))
    data = json.loads(response)
    if 'error' not in data.keys():
        return type, data['result']['addon']['enabled']
    return None, None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号