alcuni fix raiplay
This commit is contained in:
+44
-30
@@ -66,7 +66,7 @@ def submenu(item):
|
|||||||
json = current_session.get(json_url).json()['contents']
|
json = current_session.get(json_url).json()['contents']
|
||||||
for key in json:
|
for key in json:
|
||||||
itemlist.append(item.clone(title = support.typo(key,'bold'), fulltitle = key,
|
itemlist.append(item.clone(title = support.typo(key,'bold'), fulltitle = key,
|
||||||
show = key, url = json[key], action = 'peliculas'))
|
show = key, data = json[key], action = 'peliculas'))
|
||||||
else:
|
else:
|
||||||
for key in json:
|
for key in json:
|
||||||
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
||||||
@@ -206,7 +206,8 @@ def peliculas(item):
|
|||||||
for key in json:
|
for key in json:
|
||||||
if len(json[key]) > 0:
|
if len(json[key]) > 0:
|
||||||
for key in json[key]:
|
for key in json[key]:
|
||||||
keys.append(key)
|
if item.search.lower() in key['name'].lower():
|
||||||
|
keys.append(key)
|
||||||
|
|
||||||
# load titles
|
# load titles
|
||||||
for i, key in enumerate(keys):
|
for i, key in enumerate(keys):
|
||||||
@@ -221,7 +222,7 @@ def peliculas(item):
|
|||||||
itemlist.append(res.result())
|
itemlist.append(res.result())
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.title)
|
itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||||
|
|
||||||
if len(keys) > pag * pagination and not item.search:
|
if not item.search and len(keys) > pag * pagination:
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), page=pag + 1, thumbnail=support.thumb()))
|
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), page=pag + 1, thumbnail=support.thumb()))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -229,9 +230,8 @@ def peliculas(item):
|
|||||||
def select(item):
|
def select(item):
|
||||||
support.info()
|
support.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# support.dbg()
|
if type(item.data) in [list, dict]:
|
||||||
if type(item.url) in [list, dict]:
|
json = item.data
|
||||||
json = item.url
|
|
||||||
else:
|
else:
|
||||||
json = current_session.get(item.url).json()
|
json = current_session.get(item.url).json()
|
||||||
if 'blocks' in json:
|
if 'blocks' in json:
|
||||||
@@ -240,29 +240,34 @@ def select(item):
|
|||||||
for key in json:
|
for key in json:
|
||||||
if item.fulltitle in key['name']: season = key['name'].replace(item.fulltitle, '').strip()
|
if item.fulltitle in key['name']: season = key['name'].replace(item.fulltitle, '').strip()
|
||||||
if not season.isdigit(): season = ''
|
if not season.isdigit(): season = ''
|
||||||
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), season = season, url = key['sets'], action = 'select'))
|
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), season = season, data = key['sets'], action = 'select'))
|
||||||
if len(itemlist) == 1:
|
if len(itemlist) == 1:
|
||||||
return select(itemlist[0])
|
return select(itemlist[0])
|
||||||
else:
|
else:
|
||||||
for key in item.url:
|
if item.data:
|
||||||
itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), data = getUrl(key['path_id']), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios'))
|
for key in item.data:
|
||||||
if len(itemlist) == 1:
|
itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), data = getUrl(key['path_id']), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios'))
|
||||||
return episodios(itemlist[0])
|
if len(itemlist) == 1:
|
||||||
|
return episodios(itemlist[0])
|
||||||
|
elif 'contents' in json:
|
||||||
|
for letter in json['contents'].keys():
|
||||||
|
if json['contents'][letter]:
|
||||||
|
itemlist.extend(peliculas(item.clone(data=json['contents'][letter])))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
support.info()
|
support.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if type(item.url) in [list, dict] and len(item.url) > 1 and ('name' in item.url[0] and 'stagione' not in item.url[0]['name'].lower()):
|
if type(item.data) in [list, dict] and len(item.data) > 1 and ('name' in item.data[0] and 'stagione' not in item.data[0]['name'].lower()):
|
||||||
for key in item.url:
|
for key in item.data:
|
||||||
itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios'))
|
itemlist.append(item.clone(title = support.typo(key['name'], 'bold'), url = getUrl(key['path_id']), contentType = 'tvshow', action = 'episodios'))
|
||||||
|
|
||||||
elif type(item.url) in [list, dict]:
|
elif type(item.data) in [list, dict]:
|
||||||
for key in item.url:
|
for key in item.data:
|
||||||
load_episodes(key, item)
|
load_episodes(key, item)
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
itlist = [executor.submit(load_episodes, key, item) for key in item.url]
|
itlist = [executor.submit(load_episodes, key, item) for key in item.data]
|
||||||
for res in futures.as_completed(itlist):
|
for res in futures.as_completed(itlist):
|
||||||
if res.result():
|
if res.result():
|
||||||
itemlist += res.result()
|
itemlist += res.result()
|
||||||
@@ -276,7 +281,7 @@ def episodios(item):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
date = ''
|
date = ''
|
||||||
if type(item.url) in [list, dict]: item.url = getUrl(item.url[0]['path_id'])
|
if type(item.data) in [list, dict]: item.data = getUrl(item.url[0]['path_id'])
|
||||||
json = current_session.get(item.url).json()['items']
|
json = current_session.get(item.url).json()['items']
|
||||||
for key in json:
|
for key in json:
|
||||||
ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match
|
ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match
|
||||||
@@ -354,20 +359,29 @@ def getUrl(pathId):
|
|||||||
|
|
||||||
def addinfo(key, item):
|
def addinfo(key, item):
|
||||||
support.info()
|
support.info()
|
||||||
info = current_session.get(getUrl(key['info_url'])).json()
|
info = current_session.get(getUrl(key['info_url'])).json() if 'info_url' in key else {}
|
||||||
if not item.search or item.search.lower() in key['name'].lower():
|
if 'images' in key:
|
||||||
it = item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
fanart = key['images']['landscape']
|
||||||
thumbnail = getUrl(key['images']['portrait_logo'] if key['images']['portrait_logo'] else key['images']['landscape']),
|
if key['images']['portrait_logo']:
|
||||||
fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description'])
|
thumb = key['images']['portrait_logo']
|
||||||
if 'layout' not in key or key['layout'] == 'single':
|
|
||||||
it.action = 'findvideos'
|
|
||||||
it.contentType = 'movie'
|
|
||||||
it.contentTitle = it.fulltitle
|
|
||||||
else:
|
else:
|
||||||
it.action = 'select'
|
thumb = key['images']['landscape']
|
||||||
it.contentType = 'tvshow'
|
else:
|
||||||
it.contentSerieName = it.fulltitle
|
thumb = ''
|
||||||
return it
|
fanart = ''
|
||||||
|
it = item.clone(title=support.typo(key.get('name', ''), 'bold'), fulltitle=key.get('name', ''),
|
||||||
|
show=key.get('name', ''), data='', thumbnail=getUrl(thumb),
|
||||||
|
fanart=getUrl(fanart), url=getUrl(key['path_id']), plot=info.get('description', ''))
|
||||||
|
|
||||||
|
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
||||||
|
it.action = 'findvideos'
|
||||||
|
it.contentType = 'movie'
|
||||||
|
it.contentTitle = it.fulltitle
|
||||||
|
else:
|
||||||
|
it.action = 'select'
|
||||||
|
it.contentType = 'tvshow'
|
||||||
|
it.contentSerieName = it.fulltitle
|
||||||
|
return it
|
||||||
|
|
||||||
|
|
||||||
def load_episodes(key, item):
|
def load_episodes(key, item):
|
||||||
|
|||||||
Reference in New Issue
Block a user