pelisfox: fix patron
This commit is contained in:
@@ -74,16 +74,15 @@ def lista(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||||
|
|
||||||
if item.seccion != 'actor':
|
if item.seccion != 'actor':
|
||||||
patron = '<li class=item-serie.*?><a href=(.*?) title=(.*?)><img src=(.*?) alt=><span '
|
patron = '(?s)<li class="item-serie.*?href="([^"]+).*?title="([^"]+).*?data-src="([^"]+).*?<span '
|
||||||
patron += 'class=s-title><strong>.*?<\/strong><p>(.*?)<\/p><\/span><\/a><\/li>'
|
patron += 'class="s-title">.*?<p>([^<]+)'
|
||||||
else:
|
else:
|
||||||
patron = '<li><a href=(\/pelicula\/.*?)><figure><img src=(.*?) alt=><\/figure><p class=title>(.*?)<\/p><p '
|
patron = '(?s)<li>.*?<a href="(/pelicula/[^"]+)".*?<figure>.*?data-src="([^"]+)".*?p class="title">([^<]+).*?'
|
||||||
patron += 'class=year>(.*?)<\/p>'
|
patron += 'year">([^<]+)'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear in matches:
|
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear in matches:
|
||||||
url = host + scrapedurl
|
url = host + scrapedurl
|
||||||
if item.seccion != 'actor':
|
if item.seccion != 'actor':
|
||||||
@@ -109,11 +108,11 @@ def lista(item):
|
|||||||
# Paginacion
|
# Paginacion
|
||||||
|
|
||||||
if itemlist != []:
|
if itemlist != []:
|
||||||
actual_page = scrapertools.find_single_match(data, '<a class=active item href=.*?>(.*?)<\/a>')
|
actual_page = scrapertools.find_single_match(data, '<a class="active item" href=".*?">(.*?)<\/a>')
|
||||||
if actual_page:
|
if actual_page:
|
||||||
next_page_num = int(actual_page) + 1
|
next_page_num = int(actual_page) + 1
|
||||||
next_page = scrapertools.find_single_match(data,
|
next_page = scrapertools.find_single_match(data,
|
||||||
'<li><a class= item href=(.*?)\?page=.*?&limit=.*?>Siguiente')
|
'<li><a class=" item" href="(.*?)\?page=.*?&limit=.*?">Siguiente')
|
||||||
next_page_url = host + next_page + '?page=%s' % next_page_num
|
next_page_url = host + next_page + '?page=%s' % next_page_num
|
||||||
if next_page != '':
|
if next_page != '':
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
@@ -129,15 +128,14 @@ def seccion(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||||
if item.seccion == 'generos':
|
if item.seccion == 'generos':
|
||||||
patron = '<a href=(\/peliculas\/[\D].*?\/) title=Películas de .*?>(.*?)<\/a>'
|
patron = '<a href="(\/peliculas\/[\D].*?\/)" title="Películas de .*?>(.*?)<\/a>'
|
||||||
elif item.seccion == 'anios':
|
elif item.seccion == 'anios':
|
||||||
patron = '<li class=.*?><a href=(.*?)>(\d{4})<\/a> <\/li>'
|
patron = '<li class=.*?><a href="(.*?)">(\d{4})<\/a> <\/li>'
|
||||||
elif item.seccion == 'actor':
|
elif item.seccion == 'actor':
|
||||||
patron = '<li><a href=(.*?)><div.*?<div class=photopurple title=(.*?)><\/div><img src=(.*?)><\/figure>'
|
patron = '<li><a href="(.*?)".*?div.*?<div class="photopurple" title="(.*?)">.*?data-src="([^"]+)'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
|
||||||
if item.seccion != 'actor':
|
if item.seccion != 'actor':
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
title = scrapedtitle.decode('utf-8')
|
title = scrapedtitle.decode('utf-8')
|
||||||
@@ -158,7 +156,6 @@ def seccion(item):
|
|||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
for scrapedurl, scrapedname, scrapedthumbnail in matches:
|
for scrapedurl, scrapedname, scrapedthumbnail in matches:
|
||||||
thumbnail = scrapedthumbnail
|
|
||||||
fanart = ''
|
fanart = ''
|
||||||
title = scrapedname
|
title = scrapedname
|
||||||
url = host + scrapedurl
|
url = host + scrapedurl
|
||||||
@@ -168,14 +165,14 @@ def seccion(item):
|
|||||||
title=title,
|
title=title,
|
||||||
fulltitle=item.title,
|
fulltitle=item.title,
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumbnail,
|
thumbnail=scrapedthumbnail,
|
||||||
fanart=fanart,
|
fanart=fanart,
|
||||||
seccion=item.seccion
|
seccion=item.seccion
|
||||||
))
|
))
|
||||||
# Paginacion
|
# Paginacion
|
||||||
|
|
||||||
if itemlist != []:
|
if itemlist != []:
|
||||||
next_page = scrapertools.find_single_match(data, '<li><a class= item href=(.*?)&limit=.*?>Siguiente <')
|
next_page = scrapertools.find_single_match(data, '<li><a class=" item" href="(.*?)&limit=.*?>Siguiente <')
|
||||||
next_page_url = host + next_page
|
next_page_url = host + next_page
|
||||||
if next_page != '':
|
if next_page != '':
|
||||||
itemlist.append(item.clone(action="seccion",
|
itemlist.append(item.clone(action="seccion",
|
||||||
@@ -240,7 +237,6 @@ def findvideos(item):
|
|||||||
))
|
))
|
||||||
for videoitem in templist:
|
for videoitem in templist:
|
||||||
data = httptools.downloadpage(videoitem.url).data
|
data = httptools.downloadpage(videoitem.url).data
|
||||||
|
|
||||||
urls_list = scrapertools.find_multiple_matches(data, 'var.*?_SOURCE\s+=\s+\[(.*?)\]')
|
urls_list = scrapertools.find_multiple_matches(data, 'var.*?_SOURCE\s+=\s+\[(.*?)\]')
|
||||||
for element in urls_list:
|
for element in urls_list:
|
||||||
json_data=jsontools.load(element)
|
json_data=jsontools.load(element)
|
||||||
@@ -260,19 +256,19 @@ def findvideos(item):
|
|||||||
for urls in video_list:
|
for urls in video_list:
|
||||||
if urls.language == '':
|
if urls.language == '':
|
||||||
urls.language = videoitem.language
|
urls.language = videoitem.language
|
||||||
urls.title = item.title + '(%s) (%s)' % (urls.language, urls.server)
|
urls.title = item.title + urls.language + '(%s)'
|
||||||
|
|
||||||
|
|
||||||
for video_url in video_list:
|
for video_url in video_list:
|
||||||
video_url.channel = item.channel
|
video_url.channel = item.channel
|
||||||
video_url.action = 'play'
|
video_url.action = 'play'
|
||||||
video_url.quality = quality
|
video_url.quality = quality
|
||||||
|
video_url.server = ""
|
||||||
|
video_url.infoLabels = item.infoLabels
|
||||||
else:
|
else:
|
||||||
server = servertools.get_server_from_url(url)
|
video_list.append(item.clone(title=item.title, url=url, action='play', quality = quality
|
||||||
video_list.append(item.clone(title=item.title, url=url, action='play', quality = quality,
|
))
|
||||||
server=server))
|
video_list = servertools.get_servers_itemlist(video_list, lambda i: i.title % i.server.capitalize())
|
||||||
|
tmdb.set_infoLabels(video_list)
|
||||||
|
|
||||||
if config.get_videolibrary_support() and len(video_list) > 0 and item.extra != 'findvideos':
|
if config.get_videolibrary_support() and len(video_list) > 0 and item.extra != 'findvideos':
|
||||||
video_list.append(
|
video_list.append(
|
||||||
Item(channel=item.channel,
|
Item(channel=item.channel,
|
||||||
@@ -308,3 +304,8 @@ def newest(categoria):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
item.thumbnail = item.contentThumbnail
|
||||||
|
return [item]
|
||||||
|
|||||||
Reference in New Issue
Block a user