Fix e migliorie per finestra server pop-up
This commit is contained in:
@@ -53,11 +53,13 @@ def peliculas(item):
|
||||
patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?'
|
||||
pagination = 25
|
||||
elif item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?'
|
||||
if item.args == 'update':
|
||||
patronBlock = r'<section id="slider">(?P<block>.*?)</section>'
|
||||
patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">'
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
if item.args == 'update':
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: – Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)'
|
||||
pagination = 25
|
||||
@@ -159,6 +161,8 @@ def newest(categoria):
|
||||
|
||||
def check(item):
|
||||
support.info()
|
||||
# support.dbg()
|
||||
from platformcode.launcher import run
|
||||
data = support.match(item.url, headers=headers).data
|
||||
if data:
|
||||
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
||||
@@ -178,7 +182,8 @@ def check(item):
|
||||
elif ck == 'film':
|
||||
item.contentType = 'movie'
|
||||
item.data = data
|
||||
return findvideos(item)
|
||||
item.action = 'findvideos'
|
||||
return run(item)
|
||||
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
@@ -187,8 +192,9 @@ def check(item):
|
||||
if not itemlist:
|
||||
item.contentType = 'movie'
|
||||
item.data = data
|
||||
return findvideos(item)
|
||||
return itemlist
|
||||
item.action = 'findvideos'
|
||||
return run(item)
|
||||
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
|
||||
@@ -67,7 +67,7 @@ def live(item):
|
||||
logger.debug()
|
||||
itemlist =[]
|
||||
for name, values in liveDict().items():
|
||||
itemlist.append(item.clone(title=typo(name,'bold'), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True))
|
||||
itemlist.append(item.clone(title=typo(name,'bold'), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='findvideos', forcethumb=True, no_return=True))
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ def episodios(item):
|
||||
fulltitle=title,
|
||||
plot=plot,
|
||||
id=episode['id'],
|
||||
action='play',
|
||||
action='findvideos',
|
||||
contentType='episode',
|
||||
season=option['id'],
|
||||
episode=episode['attributes']['episodeNumber'],
|
||||
@@ -180,7 +180,7 @@ def episodios(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
def findvideos(item):
|
||||
if item.livefilter:
|
||||
item.id = liveDict()[item.livefilter]['id']
|
||||
item.fulltitle = item.livefilter
|
||||
@@ -196,4 +196,4 @@ def play(item):
|
||||
else:
|
||||
item.url = data['streaming']['hls']['url']
|
||||
item.manifest = 'hls'
|
||||
return [item]
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
+8
-7
@@ -34,8 +34,8 @@ def mainlist(item):
|
||||
|
||||
|
||||
def live(item):
|
||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='play', forcethumb = True, no_return=True),
|
||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='play', forcethumb = True, no_return=True)]
|
||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True, no_return=True),
|
||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True, no_return=True)]
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def replay_menu(item):
|
||||
|
||||
@support.scrape
|
||||
def replay(item):
|
||||
action = 'play'
|
||||
action = 'findvideos'
|
||||
patron = r'guida-tv"><[^>]+><[^>]+>(?P<hour>[^<]+)<[^>]+><[^>]+><[^>]+>\s*<a href="(?P<url>[^"]+)"><[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"><[^>]+><[^>]+><[^>]+><[^>]+>\s*(?P<name>[^<]+)<[^>]+><[^>]+><[^>]+>(?P<plot>[^<]+)<'
|
||||
def itemHook(item):
|
||||
item.title = support.typo(item.hour + ' - ' + item.name,'bold')
|
||||
@@ -99,7 +99,7 @@ def peliculas(item):
|
||||
def episodios(item):
|
||||
data = support.match(item).data
|
||||
# debug = True
|
||||
action = 'play'
|
||||
action = 'findvideos'
|
||||
if '>puntate<' in data:
|
||||
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
||||
url = support.match(data, patron=r'>puntate<[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
||||
@@ -127,7 +127,7 @@ def episodios(item):
|
||||
return locals()
|
||||
|
||||
|
||||
def play(item):
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
if item.livefilter:
|
||||
for it in live(item):
|
||||
@@ -169,5 +169,6 @@ def play(item):
|
||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||
if match:
|
||||
url = 'https://awsvodpkg.iltrovatore.it/local/hls/,/content/entry/data/' + support.match(item, patron='/content/entry/data/(.*?).mp4').match + '.mp4.urlset/master.m3u8'
|
||||
item = item.clone(title='Direct', url=url, server='directo', action='play')
|
||||
return support.servertools.find_video_items(item, data=url)
|
||||
|
||||
item = item.clone(title='Direct', server='directo', url=url, action='play')
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
|
||||
@@ -95,7 +95,7 @@ def live(item):
|
||||
urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'],
|
||||
plot=plot,
|
||||
url=url,
|
||||
action='play',
|
||||
action='findvideos',
|
||||
thumbnail=thumb,
|
||||
forcethumb=True))
|
||||
|
||||
@@ -141,7 +141,7 @@ def peliculas(item):
|
||||
else:
|
||||
contentType = 'movie'
|
||||
video_id = it['guid']
|
||||
action = 'play'
|
||||
action = 'findvideos'
|
||||
for k, v in it['thumbnails'].items():
|
||||
if 'image_vertical' in k and not thumb:
|
||||
thumb = v['url'].replace('.jpg', '@3.jpg')
|
||||
@@ -228,13 +228,13 @@ def episodios(item):
|
||||
thumbnail=thumb,
|
||||
forcethumb=True,
|
||||
contentType='episode',
|
||||
action='play',
|
||||
action='findvideos',
|
||||
video_id=it['guid']))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
item.no_return=True
|
||||
# support.dbg()
|
||||
@@ -262,7 +262,7 @@ def play(item):
|
||||
|
||||
else:
|
||||
item.manifest = 'hls'
|
||||
return[item]
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
|
||||
elif item.video_id:
|
||||
payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}'
|
||||
@@ -288,7 +288,7 @@ def play(item):
|
||||
else:
|
||||
item.manifest = 'hls'
|
||||
|
||||
return [item]
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
|
||||
|
||||
def get_from_id(item):
|
||||
@@ -320,7 +320,7 @@ def get_programs(item):
|
||||
args['sid'] = sid
|
||||
args['sessionId'] = sid
|
||||
args['hitsPerPage'] = pagination
|
||||
args['property'] = 'search' if args.get('query') else 'play'
|
||||
args['property'] = 'search' if args.get('query') else 'findvideos'
|
||||
args['tenant'] = 'play-prod-v2'
|
||||
args['page'] = pag
|
||||
args['deviceId'] = '017ac511182d008322c989f3aac803083002507b00bd0'
|
||||
|
||||
+15
-10
@@ -7,6 +7,8 @@ from core import support, jsontools
|
||||
from platformcode import autorenumber, logger
|
||||
from collections import OrderedDict
|
||||
|
||||
from specials import videolibrary
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -64,7 +66,7 @@ def live(item):
|
||||
logger.debug()
|
||||
itemlist=[]
|
||||
for key, value in liveDict().items():
|
||||
itemlist.append(item.clone(title=support.typo(key,'bold'), contentTitle=key, fulltitle=key, show=key, url=value['url'], plot=value['plot'], action='play', forcethumb=True, no_return=True))
|
||||
itemlist.append(item.clone(title=support.typo(key,'bold'), contentTitle=key, fulltitle=key, show=key, url=value['url'], plot=value['plot'], action='findvideos', forcethumb=True, no_return=True))
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
|
||||
@@ -160,19 +162,22 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False)
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.debug()
|
||||
item.manifest = 'hls'
|
||||
mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
||||
url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + item.url
|
||||
ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
|
||||
item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False, Videolibrary=False)
|
||||
|
||||
if item.livefilter:
|
||||
d = liveDict()[item.livefilter]
|
||||
item = item.clone(title=support.typo(item.livefilter, 'bold'), fulltitle=item.livefilter, url=d['url'], plot=d['plot'], action='play', forcethumb=True, no_return=True)
|
||||
support.thumb(item, live=True)
|
||||
return [item]
|
||||
|
||||
# def play(item):
|
||||
# logger.debug()
|
||||
# item.manifest = 'hls'
|
||||
# mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
||||
# url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + item.url
|
||||
# ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
|
||||
# item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||
|
||||
|
||||
# return [item]
|
||||
+5
-5
@@ -142,7 +142,7 @@ def live(item):
|
||||
current = it['currentItem']
|
||||
next = it['nextItem']
|
||||
plot = '[B]{}[/B]\n{}\n\nA Seguire: [B]{}[/B]\n{}'.format(current['name'], current['description'], next['name'], next['description'])
|
||||
itemlist.append(item.clone(title=title, fulltitle=title, fanart=fanart, plot=plot, url=url, video_url=url + '.json', action='play'))
|
||||
itemlist.append(item.clone(title=title, fulltitle=title, fanart=fanart, plot=plot, url=url, video_url=url + '.json', action='findvideos'))
|
||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||
support.thumb(itemlist, live=True)
|
||||
return itemlist
|
||||
@@ -209,7 +209,7 @@ def replay(item):
|
||||
plot = info['description'],
|
||||
url = getUrl(it['weblink']),
|
||||
video_url = getUrl(it['path_id']),
|
||||
action = 'play',
|
||||
action = 'findvideos',
|
||||
forcethumb = True)
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ def replay(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
|
||||
res = requests.get(item.video_url).json()
|
||||
@@ -245,7 +245,7 @@ def play(item):
|
||||
|
||||
item = item.clone(server='directo', url=url, no_return=True) # , manifest='hls')
|
||||
|
||||
return [item]
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
|
||||
|
||||
def getUrl(url):
|
||||
@@ -306,7 +306,7 @@ def addinfo(items, item):
|
||||
order=n)
|
||||
|
||||
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
||||
it.action = 'play'
|
||||
it.action = 'findvideos'
|
||||
it.contentTitle = it.fulltitle
|
||||
else:
|
||||
it.action = 'episodios'
|
||||
|
||||
Reference in New Issue
Block a user