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\-]+)?\)?)?'
|
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
|
pagination = 25
|
||||||
elif item.contentType == 'movie':
|
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>)?'
|
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':
|
if item.args == 'update':
|
||||||
patronBlock = r'<section id="slider">(?P<block>.*?)</section>'
|
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>[^\)]+)\)">'
|
patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">'
|
||||||
elif item.contentType == 'tvshow':
|
elif item.contentType == 'tvshow':
|
||||||
|
action = 'episodios'
|
||||||
if item.args == 'update':
|
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>)'
|
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
|
pagination = 25
|
||||||
@@ -159,6 +161,8 @@ def newest(categoria):
|
|||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
support.info()
|
support.info()
|
||||||
|
# support.dbg()
|
||||||
|
from platformcode.launcher import run
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
if data:
|
if data:
|
||||||
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
||||||
@@ -178,7 +182,8 @@ def check(item):
|
|||||||
elif ck == 'film':
|
elif ck == 'film':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.data = data
|
item.data = data
|
||||||
return findvideos(item)
|
item.action = 'findvideos'
|
||||||
|
return run(item)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
@@ -187,8 +192,9 @@ def check(item):
|
|||||||
if not itemlist:
|
if not itemlist:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.data = data
|
item.data = data
|
||||||
return findvideos(item)
|
item.action = 'findvideos'
|
||||||
return itemlist
|
return run(item)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ def live(item):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist =[]
|
itemlist =[]
|
||||||
for name, values in liveDict().items():
|
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)
|
return support.thumb(itemlist, live=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ def episodios(item):
|
|||||||
fulltitle=title,
|
fulltitle=title,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
id=episode['id'],
|
id=episode['id'],
|
||||||
action='play',
|
action='findvideos',
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
season=option['id'],
|
season=option['id'],
|
||||||
episode=episode['attributes']['episodeNumber'],
|
episode=episode['attributes']['episodeNumber'],
|
||||||
@@ -180,7 +180,7 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def findvideos(item):
|
||||||
if item.livefilter:
|
if item.livefilter:
|
||||||
item.id = liveDict()[item.livefilter]['id']
|
item.id = liveDict()[item.livefilter]['id']
|
||||||
item.fulltitle = item.livefilter
|
item.fulltitle = item.livefilter
|
||||||
@@ -196,4 +196,4 @@ def play(item):
|
|||||||
else:
|
else:
|
||||||
item.url = data['streaming']['hls']['url']
|
item.url = data['streaming']['hls']['url']
|
||||||
item.manifest = 'hls'
|
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):
|
def live(item):
|
||||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', 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='play', 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)
|
return support.thumb(itemlist, live=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ def replay_menu(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def replay(item):
|
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>[^<]+)<'
|
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):
|
def itemHook(item):
|
||||||
item.title = support.typo(item.hour + ' - ' + item.name,'bold')
|
item.title = support.typo(item.hour + ' - ' + item.name,'bold')
|
||||||
@@ -99,7 +99,7 @@ def peliculas(item):
|
|||||||
def episodios(item):
|
def episodios(item):
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
# debug = True
|
# debug = True
|
||||||
action = 'play'
|
action = 'findvideos'
|
||||||
if '>puntate<' in data:
|
if '>puntate<' in data:
|
||||||
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
||||||
url = support.match(data, patron=r'>puntate<[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
url = support.match(data, patron=r'>puntate<[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
||||||
@@ -127,7 +127,7 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def findvideos(item):
|
||||||
support.info()
|
support.info()
|
||||||
if item.livefilter:
|
if item.livefilter:
|
||||||
for it in live(item):
|
for it in live(item):
|
||||||
@@ -169,5 +169,6 @@ def play(item):
|
|||||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||||
if 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'
|
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'],
|
urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'],
|
||||||
plot=plot,
|
plot=plot,
|
||||||
url=url,
|
url=url,
|
||||||
action='play',
|
action='findvideos',
|
||||||
thumbnail=thumb,
|
thumbnail=thumb,
|
||||||
forcethumb=True))
|
forcethumb=True))
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
contentType = 'movie'
|
contentType = 'movie'
|
||||||
video_id = it['guid']
|
video_id = it['guid']
|
||||||
action = 'play'
|
action = 'findvideos'
|
||||||
for k, v in it['thumbnails'].items():
|
for k, v in it['thumbnails'].items():
|
||||||
if 'image_vertical' in k and not thumb:
|
if 'image_vertical' in k and not thumb:
|
||||||
thumb = v['url'].replace('.jpg', '@3.jpg')
|
thumb = v['url'].replace('.jpg', '@3.jpg')
|
||||||
@@ -228,13 +228,13 @@ def episodios(item):
|
|||||||
thumbnail=thumb,
|
thumbnail=thumb,
|
||||||
forcethumb=True,
|
forcethumb=True,
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
action='play',
|
action='findvideos',
|
||||||
video_id=it['guid']))
|
video_id=it['guid']))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
item.no_return=True
|
item.no_return=True
|
||||||
# support.dbg()
|
# support.dbg()
|
||||||
@@ -262,7 +262,7 @@ def play(item):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
item.manifest = 'hls'
|
item.manifest = 'hls'
|
||||||
return[item]
|
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||||
|
|
||||||
elif item.video_id:
|
elif item.video_id:
|
||||||
payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}'
|
payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}'
|
||||||
@@ -288,7 +288,7 @@ def play(item):
|
|||||||
else:
|
else:
|
||||||
item.manifest = 'hls'
|
item.manifest = 'hls'
|
||||||
|
|
||||||
return [item]
|
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||||
|
|
||||||
|
|
||||||
def get_from_id(item):
|
def get_from_id(item):
|
||||||
@@ -320,7 +320,7 @@ def get_programs(item):
|
|||||||
args['sid'] = sid
|
args['sid'] = sid
|
||||||
args['sessionId'] = sid
|
args['sessionId'] = sid
|
||||||
args['hitsPerPage'] = pagination
|
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['tenant'] = 'play-prod-v2'
|
||||||
args['page'] = pag
|
args['page'] = pag
|
||||||
args['deviceId'] = '017ac511182d008322c989f3aac803083002507b00bd0'
|
args['deviceId'] = '017ac511182d008322c989f3aac803083002507b00bd0'
|
||||||
|
|||||||
+15
-10
@@ -7,6 +7,8 @@ from core import support, jsontools
|
|||||||
from platformcode import autorenumber, logger
|
from platformcode import autorenumber, logger
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
from specials import videolibrary
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ def live(item):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
for key, value in liveDict().items():
|
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)
|
return support.thumb(itemlist, live=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -160,19 +162,22 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False)
|
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
|
||||||
logger.debug()
|
logger.debug()
|
||||||
item.manifest = 'hls'
|
item.manifest = 'hls'
|
||||||
mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
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
|
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
|
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']
|
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]
|
# def play(item):
|
||||||
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)
|
# logger.debug()
|
||||||
support.thumb(item, live=True)
|
# item.manifest = 'hls'
|
||||||
return [item]
|
# 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']
|
current = it['currentItem']
|
||||||
next = it['nextItem']
|
next = it['nextItem']
|
||||||
plot = '[B]{}[/B]\n{}\n\nA Seguire: [B]{}[/B]\n{}'.format(current['name'], current['description'], next['name'], next['description'])
|
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))
|
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||||
support.thumb(itemlist, live=True)
|
support.thumb(itemlist, live=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -209,7 +209,7 @@ def replay(item):
|
|||||||
plot = info['description'],
|
plot = info['description'],
|
||||||
url = getUrl(it['weblink']),
|
url = getUrl(it['weblink']),
|
||||||
video_url = getUrl(it['path_id']),
|
video_url = getUrl(it['path_id']),
|
||||||
action = 'play',
|
action = 'findvideos',
|
||||||
forcethumb = True)
|
forcethumb = True)
|
||||||
|
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ def replay(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
res = requests.get(item.video_url).json()
|
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')
|
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):
|
def getUrl(url):
|
||||||
@@ -306,7 +306,7 @@ def addinfo(items, item):
|
|||||||
order=n)
|
order=n)
|
||||||
|
|
||||||
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
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
|
it.contentTitle = it.fulltitle
|
||||||
else:
|
else:
|
||||||
it.action = 'episodios'
|
it.action = 'episodios'
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ def run(item=None):
|
|||||||
|
|
||||||
# Special play action
|
# Special play action
|
||||||
if item.action == "play":
|
if item.action == "play":
|
||||||
|
# from core.support import dbg;dbg()
|
||||||
# define la info para trakt
|
# define la info para trakt
|
||||||
try:
|
try:
|
||||||
from core import trakt_tools
|
from core import trakt_tools
|
||||||
@@ -460,6 +461,8 @@ def findvideos(item):
|
|||||||
|
|
||||||
if not itemlist:
|
if not itemlist:
|
||||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60347))
|
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60347))
|
||||||
|
elif len(itemlist) == 1 or len(itemlist) > 1 and not itemlist[1].server:
|
||||||
|
run(itemlist[0].clone(no_return=True))
|
||||||
else:
|
else:
|
||||||
platformtools.serverWindow(item, itemlist)
|
platformtools.serverWindow(item, itemlist)
|
||||||
|
|
||||||
|
|||||||
@@ -1384,9 +1384,8 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
|||||||
if (player_mode == 3 and mediaurl.startswith("rtmp")): player_mode = 0
|
if (player_mode == 3 and mediaurl.startswith("rtmp")): player_mode = 0
|
||||||
elif "megacrypter.com" in mediaurl: player_mode = 3
|
elif "megacrypter.com" in mediaurl: player_mode = 3
|
||||||
logger.info("mediaurl=" + mediaurl)
|
logger.info("mediaurl=" + mediaurl)
|
||||||
|
prevent_busy()
|
||||||
if player_mode in [0,1]:
|
if player_mode in [0,1]:
|
||||||
prevent_busy()
|
|
||||||
if player_mode in [1]:
|
if player_mode in [1]:
|
||||||
item.played_time = resume_playback(get_played_time(item))
|
item.played_time = resume_playback(get_played_time(item))
|
||||||
|
|
||||||
@@ -1421,13 +1420,14 @@ def set_player(item, xlistitem, mediaurl, view, strm):
|
|||||||
|
|
||||||
# if it is a video library file send to mark as seen
|
# if it is a video library file send to mark as seen
|
||||||
if strm or item.strm_path: item.options['strm'] = True
|
if strm or item.strm_path: item.options['strm'] = True
|
||||||
# if player_mode == 1: item.options['continue'] = True
|
|
||||||
if not mediaurl.startswith('plugin'):
|
if not mediaurl.startswith('plugin'):
|
||||||
from platformcode import xbmc_videolibrary
|
from platformcode import xbmc_videolibrary
|
||||||
xbmc_videolibrary.mark_auto_as_watched(item)
|
xbmc_videolibrary.mark_auto_as_watched(item)
|
||||||
|
|
||||||
# for cases where the audio playback window appears in place of the video one
|
# for cases where the audio playback window appears in place of the video one
|
||||||
if item.focusOnVideoPlayer:
|
if item.focusOnVideoPlayer:
|
||||||
|
from core.support import dbg;dbg()
|
||||||
while is_playing() and xbmcgui.getCurrentWindowId() != 12006:
|
while is_playing() and xbmcgui.getCurrentWindowId() != 12006:
|
||||||
continue
|
continue
|
||||||
xbmc.sleep(500)
|
xbmc.sleep(500)
|
||||||
@@ -1882,10 +1882,10 @@ def serverWindow(item, itemlist):
|
|||||||
while not xbmc.Monitor().abortRequested():
|
while not xbmc.Monitor().abortRequested():
|
||||||
played = True
|
played = True
|
||||||
if not is_playing():
|
if not is_playing():
|
||||||
if config.get_setting('next_ep') == 3:
|
# if config.get_setting('next_ep') == 3:
|
||||||
xbmc.sleep(500)
|
# xbmc.sleep(500)
|
||||||
if is_playing():
|
# if is_playing():
|
||||||
return
|
# return
|
||||||
if config.get_setting('autoplay') or reopen:
|
if config.get_setting('autoplay') or reopen:
|
||||||
xbmc.sleep(200)
|
xbmc.sleep(200)
|
||||||
if not db['controls'].get('reopen', False):
|
if not db['controls'].get('reopen', False):
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ def mark_auto_as_watched(item):
|
|||||||
marked = False
|
marked = False
|
||||||
sync = False
|
sync = False
|
||||||
next_episode = None
|
next_episode = None
|
||||||
show_server = True
|
|
||||||
mark_time = 0
|
mark_time = 0
|
||||||
|
|
||||||
percentage = float(config.get_setting("watched_setting")) / 100
|
percentage = float(config.get_setting("watched_setting")) / 100
|
||||||
@@ -68,7 +67,6 @@ def mark_auto_as_watched(item):
|
|||||||
item.played_time = 0
|
item.played_time = 0
|
||||||
platformtools.set_played_time(item)
|
platformtools.set_played_time(item)
|
||||||
if item.options['strm'] : sync = True
|
if item.options['strm'] : sync = True
|
||||||
show_server = False
|
|
||||||
from specials import videolibrary
|
from specials import videolibrary
|
||||||
videolibrary.mark_content_as_watched2(item)
|
videolibrary.mark_content_as_watched2(item)
|
||||||
if not next_episode:
|
if not next_episode:
|
||||||
@@ -93,6 +91,7 @@ def mark_auto_as_watched(item):
|
|||||||
else:
|
else:
|
||||||
item.played_time = 0
|
item.played_time = 0
|
||||||
db['controls']['reopen'] = False
|
db['controls']['reopen'] = False
|
||||||
|
db.close()
|
||||||
platformtools.set_played_time(item)
|
platformtools.set_played_time(item)
|
||||||
|
|
||||||
# Silent sync with Trakt
|
# Silent sync with Trakt
|
||||||
@@ -101,19 +100,10 @@ def mark_auto_as_watched(item):
|
|||||||
while platformtools.is_playing():
|
while platformtools.is_playing():
|
||||||
xbmc.sleep(100)
|
xbmc.sleep(100)
|
||||||
|
|
||||||
# if not show_server and item.play_from != 'window' and not item.no_return:
|
|
||||||
# xbmc.sleep(200)
|
|
||||||
# xbmc.executebuiltin('Action(close)')
|
|
||||||
# xbmc.sleep(500)
|
|
||||||
|
|
||||||
if next_episode and next_episode.next_ep and config.get_setting('next_ep') < 3:
|
if next_episode and next_episode.next_ep and config.get_setting('next_ep') < 3:
|
||||||
from platformcode.launcher import run
|
from platformcode.launcher import run
|
||||||
run(next_episode)
|
run(next_episode)
|
||||||
|
|
||||||
# db need to be closed when not used, it will cause freezes
|
|
||||||
db.close()
|
|
||||||
# from core.support import dbg;dbg()
|
|
||||||
|
|
||||||
# If it is configured to mark as seen
|
# If it is configured to mark as seen
|
||||||
if config.get_setting("mark_as_watched", "videolibrary"):
|
if config.get_setting("mark_as_watched", "videolibrary"):
|
||||||
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
|
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
|
||||||
|
|||||||
Reference in New Issue
Block a user