-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.py
More file actions
68 lines (61 loc) · 2.58 KB
/
default.py
File metadata and controls
68 lines (61 loc) · 2.58 KB
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
import xbmc
import xbmcgui
import xbmcaddon
import drmhelper
from urlparse import parse_qsl
from aussieaddonscommon import utils
addon = xbmcaddon.Addon()
cwd = xbmc.translatePath(addon.getAddonInfo('path')).decode("utf-8")
BASE_RESOURCE_PATH = os.path.join(cwd, 'resources', 'lib')
sys.path.append(BASE_RESOURCE_PATH)
import menu # noqa: E402
import play # noqa: E402
def router(paramstring):
"""
Router function that calls other functions depending on the
provided paramstring
"""
params = dict(parse_qsl(paramstring))
if paramstring:
if paramstring != 'content_type=video':
if params['action'] == 'listcategories':
if params['category'] == 'All Shows':
menu.make_series_list(paramstring)
elif params['category'] == 'Live TV':
menu.make_live_list(paramstring)
else:
menu.make_series_list(paramstring)
elif params['action'] == 'listseries':
menu.make_episodes_list(paramstring)
elif params['action'] == 'listepisodes':
play.play_video(params)
elif params['action'] == 'listchannels':
play.play_video(params)
elif params['action'] == 'settings':
xbmcaddon.Addon().openSettings()
elif params['action'] == 'reinstall_widevine_cdm':
drmhelper.get_widevinecdm()
elif params['action'] == 'reinstall_ssd_wv':
drmhelper.get_ssd_wv()
elif params['action'] == 'sendreport':
utils.user_report()
elif params['action'] == 'update_ia':
addon = drmhelper.get_addon(drm=True)
if not drmhelper.is_ia_current(addon, latest=True):
if xbmcgui.Dialog().yesno(
'Upgrade?', ('Newer version of inputstream.adaptive '
'available ({0}) - would you like to '
'upgrade to this version?'.format(
drmhelper.get_latest_ia_ver()))):
drmhelper.get_ia_direct(update=True, drm=True)
else:
ver = addon.getAddonInfo('version')
utils.dialog_message('Up to date: Inputstream.adaptive '
'version {0} installed and enabled.'
''.format(ver))
else:
menu.list_categories()
if __name__ == '__main__':
router(sys.argv[2][1:])