-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.py
68 lines (58 loc) · 2.13 KB
/
default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
import sys
from future.moves.urllib.parse import parse_qsl
from aussieaddonscommon import utils
from resources.lib import categories
from resources.lib import matches
from resources.lib import play
from resources.lib import stream_auth
import xbmcaddon
import xbmcgui
_url = sys.argv[0]
_handle = int(sys.argv[1])
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
addonPath = xbmcaddon.Addon().getAddonInfo("path")
fanart = os.path.join(addonPath, 'fanart.jpg')
def router(paramstring):
"""
Router function that calls other functions
depending on the provided paramstring
:param paramstring:
"""
params = dict(parse_qsl(paramstring))
if params:
if params['action'] == 'listcategories':
if params['category'] == 'settings':
addon.openSettings()
else:
matches.make_matches_list(params)
elif params['action'] == 'listmatches':
play.play_video(params)
elif params['action'] == 'clearticket':
stream_auth.clear_ticket()
elif params['action'] == 'sendreport':
utils.user_report()
elif params['action'] == 'open_ia_settings':
try:
import drmhelper
if drmhelper.check_inputstream(drm=False):
ia = drmhelper.get_addon()
ia.openSettings()
else:
utils.dialog_message(
"Can't open inputstream.adaptive settings")
except Exception:
utils.dialog_message(
"Can't open inputstream.adaptive settings")
else:
categories.list_categories()
if __name__ == '__main__':
if addon.getSetting('firstrun') == 'true':
xbmcgui.Dialog().ok(addonname, ('Please enter your Netball Live '
'Pass (Telstra ID) username and '
'password to access the content '
'in this service.'))
addon.openSettings()
addon.setSetting('firstrun', 'false')
router(sys.argv[2][1:])