regex debugger e altre modifiche varie

This commit is contained in:
marco
2019-07-30 21:14:12 +02:00
committed by mac12m99
parent 4dc1d6b91d
commit cbb45094a5
4 changed files with 31 additions and 42 deletions
+7 -24
View File
@@ -9,9 +9,8 @@ from core import scrapertoolsV2, httptools, servertools, tmdb, support
from core.item import Item
from lib import unshortenit
from platformcode import logger, config
from specials import autoplay
#impostati dinamicamente da getUrl()
#impostati dinamicamente da findhost()
host = ""
headers = ""
@@ -56,31 +55,15 @@ def mainlist(item):
return locals()
@support.scrape
def menu(item):
findhost()
itemlist= []
data = httptools.downloadpage(item.url, headers=headers).data
data = re.sub('\n|\t', '', data)
block = scrapertoolsV2.find_single_match(data, item.args + r'<span.*?><\/span>.*?<ul.*?>(.*?)<\/ul>')
support.log('MENU BLOCK= ',block)
patron = r'href="?([^">]+)"?>(.*?)<\/a>'
matches = re.compile(patron, re.DOTALL).findall(block)
for scrapedurl, scrapedtitle in matches:
itemlist.append(
Item(
channel=item.channel,
title=scrapedtitle,
contentType=item.contentType,
action='peliculas',
url=host + scrapedurl
)
)
return support.thumb(itemlist)
patronBlock = item.args + r'<span.*?><\/span>.*?<ul.*?>(.*?)<\/ul>'
patron = r'href="?(?P<url>[^">]+)"?>(?P<title>.*?)<\/a>'
thumb = ''
action = 'peliculas'
return locals()
def newest(categoria):