From 49d606be8db030171a3f4efeec8a067710057bac Mon Sep 17 00:00:00 2001 From: hubsif Date: Mon, 3 Sep 2018 21:34:49 +0200 Subject: [PATCH] fix playback issue with Kodi Leia (thanks to egolus) use inputstream for Kodi Leia (thanks to MRLB) submit content-type for auth --- addon.xml | 6 +++++- default.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/addon.xml b/addon.xml index 8086a6f..b2f8a3d 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,6 +19,10 @@ fanart.jpg + v1.2.2 (2018-08-27) + - fix playback issue with Kodi Leia (thanks to egolus) + - use inputstream for Kodi Leia (thanks to MRLB) + - submit content-type for auth v1.2.1 (2017-10-17) - fix some content not playing (editorialLanes with multiple videos) v1.2.0 (2017-09-26) diff --git a/default.py b/default.py index 631eb64..3e5eebc 100644 --- a/default.py +++ b/default.py @@ -68,7 +68,7 @@ def utc_offset(): def get_jwt(username, password): data = { "claims": "{'id_token':{'urn:telekom.com:all':null}}", "client_id": "10LIVESAM30000004901TSMAPP00000000000000", "grant_type": "password", "scope": "tsm offline_access", "username": username, "password": password } - response = urllib.urlopen(oauth_url + '?' + urllib.urlencode(data), "").read() + response = urllib2.urlopen(urllib2.Request(oauth_url, urllib.urlencode(data), {'Content-Type': 'application/json'})).read() jsonResult = json.loads(response) if 'access_token' in jsonResult: @@ -219,6 +219,7 @@ def geteventLane(): if event['metadata']['state'] == 'live': li.setProperty('IsPlayable', 'true') + li.setInfo('video', {}) xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li) elif not ('onlylive' in args and args['onlylive']): xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li, isFolder=True) @@ -261,6 +262,7 @@ def getevent(): li = xbmcgui.ListItem(eventVideo['title'], iconImage='https://www.telekomsport.de' + eventVideo['images']['editorial']) li.setProperty('fanart_image', 'https://www.telekomsport.de' + eventVideo['images']['editorial']) li.setProperty('IsPlayable', 'true') + li.setInfo('video', {}) xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li) xbmcplugin.endOfDirectory(_addon_handler) @@ -297,6 +299,8 @@ def getvideo(): auth = xmlroot.find('token').get('auth') listitem = xbmcgui.ListItem(path=playlisturl + "?hdnea=" + auth) + listitem.setProperty('inputstreamaddon', 'inputstream.adaptive') + listitem.setProperty('inputstream.adaptive.manifest_type', 'hls') xbmcplugin.setResolvedUrl(_addon_handler, True, listitem)