IconPath = os.path.join(AddonPath, "resources/media/") fanart = os.path.join(AddonPath + "/fanart.jpg") def icon_path(filename): if 'http://' in filename: return filename return os.path.join(IconPath, filename) args = urlparse.parse_qs(sys.argv[2][1:]) mode = args.get('mode', None) if mode is None: addon.add_item({'mode': 'live_sport'}, {'title': 'Live Sport'}, img=icon_path('live_sport.jpg'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'live_tv'}, {'title': 'Live TV'}, img=icon_path('live_tv.jpg'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'p2p_corner'}, {'title': 'P2P Corner'}, img=icon_path('p2p_corner.jpg'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'on_demand_sport_categories'}, {'title': 'Sport On Demand'}, img=icon_path('sport_on_demand.jpg'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'reddit'}, {'title': 'Subreddits'},
fanart = os.path.join(AddonPath + "/fanart.jpg") def icon_path(filename): if "http://" in filename: return filename return os.path.join(IconPath, filename) args = urlparse.parse_qs(sys.argv[2][1:]) mode = args.get("mode", None) if mode is None: addon.add_item( {"mode": "live_sport"}, {"title": "Live Sport"}, img=icon_path("live_sport.jpg"), fanart=fanart, is_folder=True ) addon.add_item( {"mode": "live_tv"}, {"title": "Live TV"}, img=icon_path("live_tv.jpg"), fanart=fanart, is_folder=True ) addon.add_item( {"mode": "p2p_corner"}, {"title": "P2P Corner"}, img=icon_path("p2p_corner.jpg"), fanart=fanart, is_folder=True ) addon.add_item( {"mode": "on_demand_sport_categories"}, {"title": "Sport On Demand"}, img=icon_path("sport_on_demand.jpg"), fanart=fanart, is_folder=True, ) addon.add_item(
if mode is None: # site = args['site'][0] site = "livetv" exec "from resources.lib.sources.live_sport import %s" % site info = eval(site + ".info()") source = eval(site + ".main()") categories = source.categories() for cat in categories: addon.add_item( { 'mode': 'open_sport_cat', 'url': cat[0], 'site': info.mode, 'title': cat[1] }, {'title': cat[1]}, img=icon_path(cat[2]), fanart=fanart, is_folder=True) addon.end_of_directory() elif mode[0] == 'open_sport_cat': url = args['url'][0] site = args['site'][0] exec "from resources.lib.sources.live_sport import %s" % site info = eval(site + ".info()") source = eval(site + ".main()") events = source.events(url) for event in events:
fanart = os.path.join(AddonPath + "/fanart.jpg") def icon_path(filename): if 'http://' in filename: return filename return os.path.join(IconPath, filename) args = urlparse.parse_qs(sys.argv[2][1:]) mode = args.get('mode', None) if mode is None: addon.add_item({'mode': 'on_demand_tv'}, {'title': 'Televizija na zahtjev'}, img=icon_path('TV.png'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'live_tv'}, {'title': ('Televizija uživo').encode('utf-8')}, img=icon_path('TV.png'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'on_demand_radio'}, {'title': 'Radio na zahtjev'}, img=icon_path('Radio.png'), fanart=fanart, is_folder=True) addon.add_item({'mode': 'live_radio'}, {'title': ('Radio uživo').encode('utf-8')}, img=icon_path('Radio.png'), fanart=fanart,
try: from urllib.parse import urlparse, parse_qs args = parse_qs(sys.argv[2][1:]) except: args = urlparse.parse_qs(sys.argv[2][1:]) mode = args.get('mode', None) if mode is None: if control.setting('disable_live_sport') == 'false': addon.add_item({ 'mode': 'open_category', 'category': 'live_sport' }, { 'label': 'Live Sport', 'title': 'Live Sport' }, img=icon_path('live_sport.jpg'), fanart=fanart, is_folder=True) if control.setting('disable_live_tv') == 'false': addon.add_item({ 'mode': 'open_category', 'category': 'live_tv' }, { 'label': 'Live TV', 'title': 'Live TV' }, img=icon_path('live_tv.jpg'), fanart=fanart, is_folder=True)
addon_handle = int(sys.argv[1]) AddonPath = addon.get_path() IconPath = os.path.join(AddonPath , "resources/media/") fanart = os.path.join(AddonPath + "/fanart.jpg") def icon_path(filename): if 'http://' in filename: return filename return os.path.join(IconPath, filename) args = urlparse.parse_qs(sys.argv[2][1:]) mode = args.get('mode', None) if mode is None: addon.add_item({'mode': 'on_demand_tv'}, {'title':'Televizija na zahtjev'}, img=icon_path('TV.png'), fanart=fanart,is_folder=True) addon.add_item({'mode': 'live_tv'}, {'title':('Televizija uživo').encode('utf-8')}, img=icon_path('TV.png'), fanart=fanart,is_folder=True) addon.add_item({'mode': 'on_demand_radio'}, {'title':'Radio na zahtjev'}, img=icon_path('Radio.png'), fanart=fanart,is_folder=True) addon.add_item({'mode': 'live_radio'}, {'title':('Radio uživo').encode('utf-8')}, img=icon_path('Radio.png'), fanart=fanart,is_folder=True) addon.add_item({'mode': 'downloads'}, {'title':'Preuzimanja'}, img=icon_path('Downloads.png'), fanart=fanart,is_folder=True) addon.add_item({'mode': 'tools'}, {'title':'Alati'}, img=icon_path('tools.png'), fanart=fanart,is_folder=True) addon.end_of_directory() from resources.lib.modules import cache, control, changelog cache.get(changelog.get, 600000000, control.addonInfo('version'), table='changelog') elif mode[0] == 'live_tv': sources = os.listdir(AddonPath + '/resources/lib/sources/live_tv') sources.remove('__init__.py') for source in sources: