forked from latts9923/script.tvtunes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.py
42 lines (33 loc) · 1.07 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
# -*- coding: utf-8 -*-
import sys
import xbmcaddon
import xbmc
# Import the common settings
from resources.lib.settings import log
from resources.lib.scraper import TvTunesScraper
ADDON = xbmcaddon.Addon(id='script.tvtunes')
#########################
# Main
#########################
if __name__ == '__main__':
log('script version %s started' % ADDON.getAddonInfo('version'))
try:
# parse sys.argv for params
try:
params = dict(arg.split("=") for arg in sys.argv[1].split("&"))
except:
params = dict(sys.argv[1].split("="))
except:
# no params passed
params = {}
log("params %s" % params)
if params.get("backend", False):
log("TvTunes: Ignoring manual call to run backend")
elif params.get("mode", False) == "solo":
themeScraper = TvTunesScraper()
del themeScraper
else:
# Close any open dialogs
xbmc.executebuiltin("Dialog.Close(all, true)", True)
log("TvTunes: Running as Addon/Plugin")
xbmc.executebuiltin("RunAddon(script.tvtunes)")