Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
show live games in main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hubsif committed Mar 14, 2015
1 parent fbde8e1 commit 8410b1a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.tk_bbl" name="Telekom Basketball" version="1.0.2" provider-name="hubsif">
<addon id="plugin.video.tk_bbl" name="Telekom Basketball" version="1.0.3" provider-name="hubsif">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.mechanize" version="0.2.5"/>
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
16 changes: 15 additions & 1 deletion default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8410b1a

Please sign in to comment.