RaiPlay:
- Nuova Sezione Learning - Ricerca per Sezione - Vari Fix
This commit is contained in:
@@ -26,6 +26,7 @@ def mainlist(item):
|
||||
('Documentari {bullet bold}', ['/documentari/index.json', 'menu']),
|
||||
('Programmi TV{bullet bold}', ['/programmi/index.json', 'menu']),
|
||||
('Programmi per Bambini {bullet bold}', ['/bambini/index.json', 'menu']),
|
||||
('Learning {bullet bold}', ['/learning/index.json', 'learning']),
|
||||
('Teche Rai {bullet bold storia}', ['/techerai/index.json', 'menu']),
|
||||
('Musica e Teatro {bullet bold}', ['/performing-arts/index.json', 'menu'])
|
||||
]
|
||||
@@ -44,11 +45,24 @@ def menu(item):
|
||||
url = item.url, args = 'genre', action = 'submenu'),
|
||||
|
||||
support.Item(channel= item.channel, title = support.typo('A-Z','submenu'),
|
||||
url = item.url, args = 'az', action = 'submenu')]
|
||||
url = item.url, args = 'az', action = 'submenu'),
|
||||
support.Item(channel= item.channel, title = support.typo('Cerca','submenu'),
|
||||
url = item.url, action = 'search')]
|
||||
|
||||
return support.thumb(itemlist)
|
||||
|
||||
|
||||
def learning(item):
|
||||
support.log()
|
||||
itemlist =[]
|
||||
json = current_session.get(item.url).json()['contents']
|
||||
for key in json:
|
||||
support.log(key['name'])
|
||||
itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
||||
url = key['contents'], thumbnail = item.thumbnail, action = 'peliculas', args = item.args))
|
||||
return itemlist
|
||||
|
||||
|
||||
def submenu(item):
|
||||
support.log()
|
||||
itemlist = []
|
||||
@@ -113,6 +127,10 @@ def search(item, text):
|
||||
support.log()
|
||||
itemlist =[]
|
||||
try:
|
||||
if item.url:
|
||||
item.search = text
|
||||
itemlist = peliculas(item)
|
||||
else:
|
||||
json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json()
|
||||
for key in json:
|
||||
for key in json[key]:
|
||||
@@ -152,17 +170,17 @@ def dirette(item):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.log(item.url)
|
||||
itemlist = []
|
||||
keys = []
|
||||
key_list = []
|
||||
|
||||
# pagination options
|
||||
pag = item.page if item.page else 1
|
||||
pagination = 40
|
||||
pagination = 40 if not item.search else ''
|
||||
|
||||
# load json
|
||||
if item.args == 'az':
|
||||
if type(item.url) in [dict, list]:
|
||||
json = item.url
|
||||
for key in json:
|
||||
if item.search.lower() in key['name'].lower():
|
||||
@@ -224,7 +242,8 @@ def episodios(item):
|
||||
if res.result():
|
||||
itemlist += res.result()
|
||||
if itemlist and itemlist[0].VL:
|
||||
itemlist.reverse()
|
||||
# itemlist.reverse()
|
||||
itemlist = sorted(itemlist, key=lambda it: it.order)
|
||||
support.videolibrary(itemlist, item)
|
||||
else:
|
||||
itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||
@@ -274,9 +293,10 @@ def getUrl(pathId):
|
||||
def addinfo(key, item):
|
||||
support.log()
|
||||
info = current_session.get(getUrl(key['info_url'])).json()
|
||||
if not item.search or item.search.lower() in key['name'].lower():
|
||||
it = support.Item( channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
||||
thumbnail = getUrl(key['images']['portrait_logo']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description'])
|
||||
if key['layout'] == 'single':
|
||||
thumbnail = getUrl(key['images']['portrait_logo'] if key['images']['portrait_logo'] else key['images']['landscape']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description'])
|
||||
if 'layout' not in key or key['layout'] == 'single':
|
||||
it.action = 'findvideos'
|
||||
it.contentType = 'movie'
|
||||
it.contentTitle = it.fulltitle
|
||||
@@ -291,17 +311,23 @@ def load_episodes(key, item):
|
||||
support.log()
|
||||
itemlist=[]
|
||||
json = current_session.get(getUrl(key['path_id'])).json()['items']
|
||||
order = 0
|
||||
for key in json:
|
||||
ep = support.match(key['subtitle'], patron=r'St\s*(\d+)\s*Ep\s*(\d+)').match
|
||||
support.log(key)
|
||||
ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match
|
||||
if ep:
|
||||
title = ep[0] + 'x' + ep[1].zfill(2) + support.re.sub(r'St\s*\d+\s*Ep\s*\d+','',key['subtitle'])
|
||||
season = '1' if not ep[0] else ep[0]
|
||||
episode = ep[1].zfill(2)
|
||||
title = season + 'x' + episode + support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle'])
|
||||
order = int(season + episode)
|
||||
else:
|
||||
title = key['subtitle'].strip()
|
||||
# title = key['subtitle'].strip()
|
||||
if not title:
|
||||
title = key['name']
|
||||
itemlist.append(support.Item(channel = item.channel, title = support.typo(title, 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail,
|
||||
fanart = getUrl(key['images']['landscape']), url = key['video_url'], plot = key['description'], contentType = 'episode',
|
||||
action = 'findvideos', VL=True if ep else False))
|
||||
action = 'findvideos', VL=True if ep else False, order=order))
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ def thumb(item_or_itemlist=None, genre=False, thumb=''):
|
||||
import re
|
||||
icon_dict = {'channels_movie':['film'],
|
||||
'channels_tvshow':['serie','tv','episodi','episodio','fiction'],
|
||||
'channels_documentary':['documentari','documentario', 'documentary'],
|
||||
'channels_documentary':['documentari','documentario', 'documentary', 'learning'],
|
||||
'channels_all':['tutti'],
|
||||
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
|
||||
'now_playing':['cinema', 'in sala'],
|
||||
|
||||
Reference in New Issue
Block a user