migliorie ai canali community
This commit is contained in:
+1
-1
@@ -109,7 +109,7 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
|||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
# Asignamos "directo" en caso de que el server no se encuentre en pelisalcarta
|
# Asignamos "directo" en caso de que el server no se encuentre en pelisalcarta
|
||||||
if not item.server and item.url:
|
if not item.server and item.url:
|
||||||
item.server = "directo"
|
item.server = config.get_localized_string(30137)
|
||||||
|
|
||||||
if fnc:
|
if fnc:
|
||||||
item.title = fnc(item)
|
item.title = fnc(item)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
},
|
},
|
||||||
"free": true,
|
"free": true,
|
||||||
"id": "directo",
|
"id": "directo",
|
||||||
"name": "direct",
|
"name": "Direct",
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
+103
-86
@@ -19,7 +19,7 @@ show_seasons = config.get_setting('show_seasons','community')
|
|||||||
|
|
||||||
list_data = {}
|
list_data = {}
|
||||||
|
|
||||||
list_servers = ['directo', 'akvideo', 'verystream', 'openload']
|
list_servers = ['directo', 'akvideo', 'wstream']
|
||||||
list_quality = ['SD', '720', '1080', '4k']
|
list_quality = ['SD', '720', '1080', '4k']
|
||||||
|
|
||||||
tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228'
|
tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228'
|
||||||
@@ -64,32 +64,37 @@ def show_channels(item):
|
|||||||
path = os.path.dirname(os.path.abspath(file_path))
|
path = os.path.dirname(os.path.abspath(file_path))
|
||||||
if 'http' in path: path = path[path.find('http'):].replace('\\','/').replace(':/','://')
|
if 'http' in path: path = path[path.find('http'):].replace('\\','/').replace(':/','://')
|
||||||
if file_path.startswith('http'): file_url = httptools.downloadpage(file_path, follow_redirects=True).data
|
if file_path.startswith('http'): file_url = httptools.downloadpage(file_path, follow_redirects=True).data
|
||||||
else: file_url = open(file_path, "r").read()
|
elif os.path.isfile(file_path): file_url = open(file_path, "r").read()
|
||||||
|
else:
|
||||||
|
support.log('KEY=',key)
|
||||||
|
item.channel_id = key
|
||||||
|
remove_channel(item)
|
||||||
|
file_url=''
|
||||||
|
|
||||||
# load json
|
# load json
|
||||||
json_url = jsontools.load(file_url)
|
if file_url:
|
||||||
|
json_url = jsontools.load(file_url)
|
||||||
|
|
||||||
thumbnail = relative('thumbnail', json_url, path)
|
thumbnail = relative('thumbnail', json_url, path)
|
||||||
if not thumbnail: thumbnail = item.thumbnail
|
if not thumbnail: thumbnail = item.thumbnail
|
||||||
fanart = relative('fanart', json_url, path)
|
fanart = relative('fanart', json_url, path)
|
||||||
plot = json_url['plot'] if json_url.has_key('plot') else ''
|
plot = json_url['plot'] if json_url.has_key('plot') else ''
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=typo(channel['channel_name'],'bold'),
|
title=typo(channel['channel_name'],'bold'),
|
||||||
url=file_path,
|
url=file_path,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
fanart=fanart,
|
fanart=fanart,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
action='show_menu',
|
action='show_menu',
|
||||||
channel_id = key,
|
channel_id = key,
|
||||||
context=context,
|
context=context,
|
||||||
path=path))
|
path=path))
|
||||||
|
|
||||||
autoplay.show_option(item.channel, itemlist)
|
autoplay.show_option(item.channel, itemlist)
|
||||||
support.channel_config(item, itemlist)
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def show_menu(item):
|
def show_menu(item):
|
||||||
global list_data
|
global list_data
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -99,12 +104,14 @@ def show_menu(item):
|
|||||||
if item.menu:
|
if item.menu:
|
||||||
menu = item.menu
|
menu = item.menu
|
||||||
item.menu = None
|
item.menu = None
|
||||||
itemlist.append(item)
|
if item.url: itemlist.append(item)
|
||||||
for key in menu:
|
for key in menu:
|
||||||
|
support.log("KEY= ",key)
|
||||||
if key != 'search':
|
if key != 'search':
|
||||||
if type(menu[key]) == dict:
|
if type(menu[key]) == dict:
|
||||||
title = menu[key]['title'] if menu[key].has_key('title') else item.title
|
title = menu[key]['title'] if menu[key].has_key('title') else item.title
|
||||||
thumbnail = relative('thumbnail', menu[key], item.path)
|
thumbnail = relative('thumbnail', menu[key], item.path)
|
||||||
|
url = relative('url', menu[key], item.path) if menu[key].has_key('url') else ''
|
||||||
plot = menu[key]['plot'] if menu[key].has_key('plot') else ''
|
plot = menu[key]['plot'] if menu[key].has_key('plot') else ''
|
||||||
else:
|
else:
|
||||||
title = menu[key]
|
title = menu[key]
|
||||||
@@ -112,13 +119,13 @@ def show_menu(item):
|
|||||||
plot = ''
|
plot = ''
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=typo(title,'submenu'),
|
title=typo(title,'submenu' if not url else 'bold'),
|
||||||
url=item.url,
|
url=url if url else item.url,
|
||||||
path=item.path,
|
path=item.path,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
action='submenu',
|
action='submenu' if not url else 'show_menu',
|
||||||
filterkey=key))
|
filterkey=key if not url else '' ))
|
||||||
|
|
||||||
if menu.has_key('search'):
|
if menu.has_key('search'):
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
@@ -131,54 +138,76 @@ def show_menu(item):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
json_data = load_json(item)
|
json_data = load_json(item)
|
||||||
|
for key in json_data:
|
||||||
|
if key == 'menu':
|
||||||
|
for option in json_data['menu']:
|
||||||
|
thumbnail = relative('thumbnail', option, item.path)
|
||||||
|
fanart = relative('fanart', option, item.path)
|
||||||
|
plot = option['plot'] if option.has_key('plot') else item.plot
|
||||||
|
url = relative('link', option, item.path)
|
||||||
|
submenu = option['submenu'] if option.has_key('submenu') else []
|
||||||
|
level2 = option['level2'] if option.has_key('level2') else []
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=format_title(option['title']),
|
||||||
|
fulltitle=option['title'],
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
fanart=fanart,
|
||||||
|
plot=plot,
|
||||||
|
action='show_menu',
|
||||||
|
url=url,
|
||||||
|
path=item.path,
|
||||||
|
menu=level2))
|
||||||
|
|
||||||
if "menu" in json_data:
|
if submenu:
|
||||||
for option in json_data['menu']:
|
for key in submenu:
|
||||||
thumbnail = relative('thumbnail', option, item.path)
|
if key != 'search':
|
||||||
fanart = relative('fanart', option, item.path)
|
if type(submenu[key]) == dict:
|
||||||
plot = option['plot'] if option.has_key('plot') else item.plot
|
title = submenu[key]['title'] if submenu[key].has_key('title') else item.title
|
||||||
url = relative('link', option, item.path)
|
thumbnail = relative('thumbnail', submenu[key], item.path)
|
||||||
submenu = option['submenu'] if option.has_key('submenu') else []
|
plot = submenu[key]['plot'] if submenu[key].has_key('plot') else ''
|
||||||
level2 = option['level2'] if option.has_key('level2') else []
|
else:
|
||||||
itemlist.append(Item(channel=item.channel,
|
title = submenu[key]
|
||||||
title=format_title(option['title']),
|
thumbnail = item.thumbnail
|
||||||
fulltitle=option['title'],
|
plot = ''
|
||||||
thumbnail=thumbnail,
|
|
||||||
fanart=fanart,
|
|
||||||
plot=plot,
|
|
||||||
action='show_menu',
|
|
||||||
url=url,
|
|
||||||
path=item.path,
|
|
||||||
menu=level2))
|
|
||||||
|
|
||||||
if submenu:
|
|
||||||
for key in submenu:
|
|
||||||
if key != 'search':
|
|
||||||
if type(submenu[key]) == dict:
|
|
||||||
title = submenu[key]['title'] if submenu[key].has_key('title') else item.title
|
|
||||||
thumbnail = relative('thumbnail', submenu[key], item.path)
|
|
||||||
plot = submenu[key]['plot'] if submenu[key].has_key('plot') else ''
|
|
||||||
else:
|
|
||||||
title = submenu[key]
|
|
||||||
thumbnail = item.thumbnail
|
|
||||||
plot = ''
|
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel,
|
||||||
|
title=typo(title,'submenu'),
|
||||||
|
url=url,
|
||||||
|
path=item.path,
|
||||||
|
thumbnail=thumbnail,
|
||||||
|
plot=plot,
|
||||||
|
action='submenu',
|
||||||
|
filterkey=key))
|
||||||
|
if submenu.has_key('search'):
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=typo(title,'submenu'),
|
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
||||||
|
thumbnail=get_thumb('search.png'),
|
||||||
|
action='search',
|
||||||
url=url,
|
url=url,
|
||||||
path=item.path,
|
path=item.path))
|
||||||
thumbnail=thumbnail,
|
|
||||||
plot=plot,
|
elif 'list' in key:
|
||||||
action='submenu',
|
# select type of list
|
||||||
filterkey=key))
|
item.url = { key: json_data[key]}
|
||||||
if submenu.has_key('search'):
|
support.log(item.url)
|
||||||
itemlist.append(Item(channel=item.channel,
|
if key == "movies_list":
|
||||||
title=typo('Cerca ' + option['title'] +'...','color kod bold'),
|
item.media_type = 'movies_list'
|
||||||
thumbnail=get_thumb('search.png'),
|
item.contentType = 'movie'
|
||||||
action='search',
|
item.action = 'findvideos'
|
||||||
url=url,
|
elif key == "tvshows_list":
|
||||||
path=item.path))
|
item.media_type = 'tvshows_list'
|
||||||
# add Search
|
item.contentType = 'tvshow'
|
||||||
|
item.action = 'get_season'
|
||||||
|
elif key == "episodes_list":
|
||||||
|
item.media_type = 'episodes_list'
|
||||||
|
item.contentType = 'episode'
|
||||||
|
item.action = 'episodios'
|
||||||
|
elif key == "generic_list":
|
||||||
|
item.media_type= 'generic_list'
|
||||||
|
itemlist += list_all(item)
|
||||||
|
|
||||||
|
# add Search
|
||||||
|
if 'channel_name' in json_data:
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
title=typo('Cerca nel Canale...','color kod bold'),
|
title=typo('Cerca nel Canale...','color kod bold'),
|
||||||
thumbnail=get_thumb('search.png'),
|
thumbnail=get_thumb('search.png'),
|
||||||
@@ -186,22 +215,7 @@ def show_menu(item):
|
|||||||
url=item.url,
|
url=item.url,
|
||||||
path=item.path))
|
path=item.path))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
# select type of list
|
|
||||||
if json_data.has_key("movies_list"):
|
|
||||||
item.media_type = 'movies_list'
|
|
||||||
item.contentType = 'movie'
|
|
||||||
elif json_data.has_key("tvshows_list"):
|
|
||||||
item.media_type = 'tvshows_list'
|
|
||||||
item.contentType = 'tvshow'
|
|
||||||
elif json_data.has_key("episodes_list"):
|
|
||||||
item.media_type = 'episodes_list'
|
|
||||||
item.contentType = 'episode'
|
|
||||||
elif json_data.has_key("generic_list"):
|
|
||||||
item.media_type= 'generic_list'
|
|
||||||
|
|
||||||
return list_all(item)
|
|
||||||
|
|
||||||
|
|
||||||
def submenu(item):
|
def submenu(item):
|
||||||
@@ -263,7 +277,10 @@ def list_all(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
media_type = item.media_type
|
media_type = item.media_type
|
||||||
json_data = load_json(item)
|
if type(item.url) == dict:
|
||||||
|
json_data = item.url
|
||||||
|
else:
|
||||||
|
json_data = load_json(item)
|
||||||
contentTitle = contentSerieName = ''
|
contentTitle = contentSerieName = ''
|
||||||
infoLabels = item.infoLabels if item.infoLabels else {}
|
infoLabels = item.infoLabels if item.infoLabels else {}
|
||||||
|
|
||||||
@@ -578,10 +595,10 @@ def findvideos(item):
|
|||||||
if 'links' in item.url:
|
if 'links' in item.url:
|
||||||
for url in item.url['links']:
|
for url in item.url['links']:
|
||||||
quality, language, plot, poster = set_extra_values(url, item.path)
|
quality, language, plot, poster = set_extra_values(url, item.path)
|
||||||
title = ''
|
title = item.fulltitle + (' - '+url['title'] if url.has_key('title') else '')
|
||||||
title = set_title(title, language, quality)
|
title = set_title(title, language, quality)
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, title=format_title('%s'+title), url=url['url'], action='play', quality=quality,
|
itemlist.append(Item(channel=item.channel, title=format_title(typo('%s','color kod') + ' - ' + title), url=url['url'], action='play', quality=quality,
|
||||||
language=language, infoLabels = item.infoLabels))
|
language=language, infoLabels = item.infoLabels))
|
||||||
|
|
||||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
|||||||
Reference in New Issue
Block a user