This commit is contained in:
Alhaziel
2020-02-22 11:59:40 +01:00
parent eefbaf460c
commit e57ea7b495
2 changed files with 20 additions and 39 deletions
+18 -37
View File
@@ -175,28 +175,18 @@ def findvideos(item):
if item.contentType == "episode": if item.contentType == "episode":
return findvid_serie(item) return findvid_serie(item)
def load_links(itemlist, re_txt, color, desc_txt, quality=""): def load_links(urls, re_txt, color, desc_txt, quality=""):
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '') if re_txt:
support.log('STREAMING',streaming) streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches support.log('STREAMING',streaming)
for url, server in matches: matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<])+<').matches
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, url, server)) for url, server in matches:
itemlist.append( logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, url, server))
Item(channel=item.channel, urls.append(final_links(url))
action="play",
title=server,
url=final_links(url),
server=server,
fulltitle=item.fulltitle,
thumbnail=item.thumbnail,
show=item.show,
quality=quality,
contentType=item.contentType,
folder=False))
support.log() support.log()
itemlist = [] itemlist = urls = []
# Carica la pagina # Carica la pagina
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
@@ -210,15 +200,15 @@ def findvideos(item):
QualityStr = scrapertools.decodeHtmlentities(match.group(1)) QualityStr = scrapertools.decodeHtmlentities(match.group(1))
# Estrae i contenuti - Streaming # Estrae i contenuti - Streaming
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "orange", "Streaming", "SD") load_links(urls, '<strong>Streamin?g:</strong>(.*?)cbtable', "orange", "Streaming", "SD")
# Estrae i contenuti - Streaming HD # Estrae i contenuti - Streaming HD
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "yellow", "Streaming HD", "HD") load_links(urls, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "yellow", "Streaming HD", "HD")
# Estrae i contenuti - Streaming 3D # Estrae i contenuti - Streaming 3D
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "pink", "Streaming 3D") load_links(urls, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "pink", "Streaming 3D")
itemlist=support.server(item, itemlist=itemlist) itemlist=support.server(item, urls)
if itemlist and QualityStr: if itemlist and QualityStr:
itemlist.insert(0, itemlist.insert(0,
Item(channel=item.channel, Item(channel=item.channel,
@@ -236,30 +226,21 @@ 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, urls, 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)
matches = support.match(html, patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>').matches matches = support.match(html, patron = r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)</a>').matches
for url, server in matches: for url, server in matches:
itemlist.append( urls.append(final_links(url))
Item(channel=item.channel,
action="play",
title=server,
url=final_links(url),
server=server,
fulltitle=item.fulltitle,
show=item.show,
quality=blktxt,
contentType=item.contentType,
folder=False))
support.log() support.log()
itemlist = [] itemlist = []
lnkblk = [] lnkblk = []
lnkblkp = [] lnkblkp = []
urls = []
data = item.url data = item.url
@@ -268,12 +249,12 @@ def findvid_serie(item):
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":
load_vid_series("<%s>"%b, item, itemlist, blktxt) load_vid_series("<%s>"%b, item, urls, blktxt)
blktxt="" blktxt=""
elif len(b.strip())>1: elif len(b.strip())>1:
blktxt=b.strip() blktxt=b.strip()
return support.server(item, itemlist=itemlist) return support.server(item, urls)
def final_links(url): def final_links(url):
+2 -2
View File
@@ -11,7 +11,7 @@ from core.support import dbg
def test_video_exists(page_url): def test_video_exists(page_url):
logger.info("(page_url='%s')" % page_url) logger.info("(page_url='%s')" % page_url)
page_url = re.sub('akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)','akvideo.stream/video/\\1',page_url) # page_url = re.sub('akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)','akvideo.stream/video/\\1',page_url)
global data global data
# dbg() # dbg()
page = httptools.downloadpage(page_url) page = httptools.downloadpage(page_url)
@@ -28,7 +28,7 @@ def test_video_exists(page_url):
# ID, code = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""") # ID, code = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""")
# post = urllib.urlencode({ID: code}) # post = urllib.urlencode({ID: code})
logger.info('PAGE DATA' + data) # logger.info('PAGE DATA' + data)
if "File Not Found" in data: if "File Not Found" in data:
return False, config.get_localized_string(70449) % "Akvideo" return False, config.get_localized_string(70449) % "Akvideo"
return True, "" return True, ""