diff --git a/addon.xml b/addon.xml index d0376b8..34984bc 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index 00eb6ed..5d02c17 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +1.0.3 (2015/03/14) +- show live games in main menu + 1.0.2 (2015/03/14) - fix auth for live streaming diff --git a/default.py b/default.py index eac7485..deb8a9e 100644 --- a/default.py +++ b/default.py @@ -62,6 +62,20 @@ def build_url(query): mode = args.get('mode', None) if mode is None: + # load live games + browser.open("https://www.telekombasketball.de/feed/getTeaser.php") + response = browser.response().read() + xmlroot = ET.ElementTree(ET.fromstring(response)) + + for video in xmlroot.getiterator('VIDEO'): + if video.get('ISLIVESTREAM') == 'true' and video.get('ISLIVE') == 'true': + url = build_url({'mode': '3', 'id': video.get('ID'), 'scheduled_start': video.get('scheduled_start')}) + li = xbmcgui.ListItem(video.find('TITLE').text, iconImage=video.find('GAME_IMG').text, thumbnailImage=video.find('GAME_IMG').text) + li.setProperty('fanart_image', video.find('IMAGE_ORIGINAL').text) + li.setProperty('IsPlayable', 'true') + xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li) + + # load menu browser.open("https://www.telekombasketball.de/feed/getFilter.php") response = browser.response().read() jsonResult = json.loads(response) @@ -71,7 +85,7 @@ def build_url(query): li = xbmcgui.ListItem(rounds['text'], iconImage='DefaultFolder.png') xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li, isFolder=True) - # add specials + # load specials url = build_url({'mode': '2', 'featured': True}) li = xbmcgui.ListItem("Featured", iconImage='DefaultFolder.png') xbmcplugin.addDirectoryItem(handle=_addon_handler, url=url, listitem=li, isFolder=True)