+ [EXPERIMENTAL] function to choose if using custom or not urls channel

This commit is contained in:
cttynul
2019-06-06 18:07:31 +02:00
parent cb39735535
commit ed42c22f09
4 changed files with 27 additions and 15 deletions

View File

@@ -83,21 +83,24 @@ def get_videolibrary_support():
return True
def get_channel_url(name):
try:
try:
import json
except:
import simplejson as json
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
with open(LOCAL_FILE) as f:
data = json.load(f)
if data[name] is not None:
return data[name]
else:
return get_setting("channel_host", name)
except:
if __settings__.getSetting("use_custom_url"):
return get_setting("channel_host", name)
else:
try:
try:
import json
except:
import simplejson as json
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
with open(LOCAL_FILE) as f:
data = json.load(f)
if data[name] is not None:
return data[name]
else:
return get_setting("channel_host", name)
except:
return get_setting("channel_host", name)
def get_system_platform():
""" fonction: pour recuperer la platform que xbmc tourne """