def get_inputstream_version(cls):
"""
Retrieves the Inputsteam version (Defaults to 1.0.0)
:returns: string - Inputsteam version
"""
payload = {
'jsonrpc': '2.0',
'id': 1,
'method': 'Addons.GetAddonDetails',
'params': {
'addonid': 'inputstream.adaptive',
'properties': ['enabled', 'version']
}
}
# execute the request
response = xbmc.executeJSONRPC(json.dumps(payload))
responses_uni = unicode(response, 'utf-8', errors='ignore')
response_serialized = json.loads(responses_uni)
if 'error' not in response_serialized.keys():
result = response_serialized.get('result', {})
addon = result.get('addon', {})
if addon.get('enabled', False) is True:
return addon.get('version', '1.0.0')
return '1.0.0'
评论列表
文章目录