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
评论列表
文章目录