Fix Segna già visti CB01 con Autoplay

This commit is contained in:
Alhaziel
2020-02-20 19:41:09 +01:00
parent 854ec6e26d
commit bc9b3381dc
2 changed files with 31 additions and 33 deletions
+22 -24
View File
@@ -178,18 +178,15 @@ def findvideos(item):
def load_links(itemlist, re_txt, color, desc_txt, quality=""): def load_links(itemlist, re_txt, color, desc_txt, quality=""):
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '') streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
support.log('STREAMING',streaming) support.log('STREAMING',streaming)
support.log('STREAMING=', streaming) matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
# patron = '<td><a.*?href=(.*?) (?:target|rel)[^>]+>([^<]+)<' for url, server in matches:
patron = '<td><a.*?href=([^ ]+) [^>]+>([^<]+)<' logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, url, server))
matches = re.compile(patron, re.DOTALL).findall(streaming)
for scrapedurl, scrapedtitle in matches:
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
itemlist.append( itemlist.append(
Item(channel=item.channel, Item(channel=item.channel,
action="play", action="play",
title=scrapedtitle, title=server,
url=scrapedurl, url=final_links(url),
server=scrapedtitle, server=server,
fulltitle=item.fulltitle, fulltitle=item.fulltitle,
thumbnail=item.thumbnail, thumbnail=item.thumbnail,
show=item.show, show=item.show,
@@ -226,7 +223,7 @@ def findvideos(item):
itemlist.insert(0, itemlist.insert(0,
Item(channel=item.channel, Item(channel=item.channel,
action="", action="",
title="[COLOR orange]%s[/COLOR]" % QualityStr, title=support.typo(QualityStr,'[] color kod bold'),
folder=False)) folder=False))
return itemlist return itemlist
@@ -239,23 +236,22 @@ def findvideos(item):
def findvid_serie(item): def findvid_serie(item):
def load_vid_series(html, item, itemlist, blktxt): def load_vid_series(html, item, itemlist, blktxt=''):
logger.info('HTML' + html) # logger.info('HTML' + html)
patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>' # patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>'
# Estrae i contenuti # Estrae i contenuti
matches = re.compile(patron, re.DOTALL).finditer(html) # matches = re.compile(patron, re.DOTALL).finditer(html)
for match in matches: matches = support.match(html, patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>').matches
scrapedurl = match.group(1) for url, server in matches:
scrapedtitle = ("%s" % support.color(blktxt,"orange") + " - " if blktxt else "") + match.group(2)
# title = item.title + " [COLOR blue][" + scrapedtitle + "][/COLOR]"
itemlist.append( itemlist.append(
Item(channel=item.channel, Item(channel=item.channel,
action="play", action="play",
title=scrapedtitle, title=server,
url=scrapedurl, url=final_links(url),
server=scrapedtitle, server=server,
fulltitle=item.fulltitle, fulltitle=item.fulltitle,
show=item.show, show=item.show,
quality=blktxt,
contentType=item.contentType, contentType=item.contentType,
folder=False)) folder=False))
@@ -268,7 +264,7 @@ def findvid_serie(item):
data = item.url data = item.url
# Blocks with split # Blocks with split
blk=re.split("(?:>\s*)?([A-Za-z\s0-9]*):\s*<",data,re.S) blk=re.split(r"(?:>\s*)?([A-Za-z\s0-9]*):\s*<",data,re.S)
blktxt="" blktxt=""
for b in blk: for b in blk:
if b[0:3]=="a h" or b[0:4]=="<a h": if b[0:3]=="a h" or b[0:4]=="<a h":
@@ -280,9 +276,11 @@ def findvid_serie(item):
return support.server(item, itemlist=itemlist) return support.server(item, itemlist=itemlist)
def play(item): def final_links(url):
support.log() support.log()
itemlist = [] itemlist = []
item= Item()
item.url = url
### Handling new cb01 wrapper ### Handling new cb01 wrapper
if host[9:] + "/film/" in item.url: if host[9:] + "/film/" in item.url:
iurl = httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location", "") iurl = httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location", "")
@@ -311,4 +309,4 @@ def play(item):
else: else:
data = support.swzz_get_url(item) data = support.swzz_get_url(item)
return servertools.find_video_items(data=data) return data
+1 -1
View File
@@ -1044,7 +1044,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
item.title = typo(item.contentTitle.strip(),'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title item.title = typo(item.contentTitle.strip(),'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
videoitem.plot= typo(videoitem.title, 'bold') videoitem.plot= typo(videoitem.title, 'bold') + typo(videoitem.quality, '_ [] bold')
videoitem.title = item.title + (typo(videoitem.title, '_ color kod [] bold') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "") videoitem.title = item.title + (typo(videoitem.title, '_ color kod [] bold') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "")
videoitem.fulltitle = item.fulltitle videoitem.fulltitle = item.fulltitle
videoitem.show = item.show videoitem.show = item.show