+dynamic channel url

implementing dynamic channel url, if url doesnt exists in macrojson get it from user preferences.
(dont know why EOF keeps changing and git committing +1000 files.)
This commit is contained in:
cttynul
2019-06-03 04:01:41 +02:00
parent 271ae4fd2b
commit d9e32745c9
7 changed files with 39 additions and 14 deletions

View File

@@ -82,6 +82,22 @@ def is_xbmc():
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:
return get_setting("channel_host", name)
def get_system_platform():
""" fonction: pour recuperer la platform que xbmc tourne """