forked from aussieaddons/plugin.video.abc_iview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.py
86 lines (79 loc) · 3.36 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# ABC iView XBMC Addon
# Copyright (C) 2012 Andy Botting
#
# This plugin includes code from python-iview
# Copyright (C) 2009-2012 by Jeremy Visser <[email protected]>
#
# This plugin is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This plugin is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this plugin. If not, see <http://www.gnu.org/licenses/>.
#
import os
import sys
import xbmcaddon
import xbmcgui
from aussieaddonscommon import utils
# Add our resources/lib to the python path
addon_dir = xbmcaddon.Addon().getAddonInfo('path')
sys.path.insert(0, os.path.join(addon_dir, 'resources', 'lib'))
import categories # noqa: E402
import play # noqa: E402
import programs # noqa: E402
import series # noqa: E402
# Print our platform/version debugging information
utils.log_kodi_platform_version()
if __name__ == '__main__':
params_str = sys.argv[2]
params = utils.get_url(params_str)
if (len(params) == 0):
categories.make_category_list()
elif 'series' in params:
xbmcgui.Dialog().ok(
'Outdated Favourites Link',
'The Kodi Favourite item being accessed was created with an '
'earlier version of the iView add-on and is no longer '
'compatible. Please remove this link and update with a new '
'one')
elif 'play' in params:
play.play(params_str)
elif 'series_url' in params:
programs.make_programs_list(params_str)
elif 'category' in params:
if params['category'] == 'settings':
xbmcaddon.Addon().openSettings()
else:
series.make_series_list(params_str)
elif 'action' in params:
if params['action'] == 'sendreport':
utils.user_report()
elif params['action'] == 'update_ia':
try:
import drmhelper
addon = drmhelper.get_addon(drm=False)
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=False)
else:
ver = addon.getAddonInfo('version')
utils.dialog_message('Up to date: Inputstream.adaptive '
'version {0} installed and enabled.'
''.format(ver))
except ImportError:
utils.log("Failed to import drmhelper")
utils.dialog_message('DRM Helper is needed for this function. '
'For more information, please visit: '
'http://aussieaddons.com/drm')