From feedeeb47d99b5e6f60bf7c13c0ebd9397210fa5 Mon Sep 17 00:00:00 2001 From: chivmalev Date: Wed, 20 Feb 2019 10:00:40 -0300 Subject: [PATCH] maxipelis24:correcciones --- plugin.video.alfa/channels/maxipelis24.py | 35 ++++++++++++----------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/plugin.video.alfa/channels/maxipelis24.py b/plugin.video.alfa/channels/maxipelis24.py index f0e71d21..674e8417 100644 --- a/plugin.video.alfa/channels/maxipelis24.py +++ b/plugin.video.alfa/channels/maxipelis24.py @@ -28,11 +28,11 @@ def mainlist(item): itemlist.append(Item(channel=item.channel, title="Peliculas", action="movies", url=host, page=0, thumbnail=get_thumb('movies', auto=True))) itemlist.append(Item(channel=item.channel, action="category", title="Año de Estreno", - url=host, cat='year', page=0, thumbnail=get_thumb('year', auto=True))) + url=host, cat='year', thumbnail=get_thumb('year', auto=True))) itemlist.append(Item(channel=item.channel, action="category", title="Géneros", - url=host, cat='genre', page=0, thumbnail=get_thumb('genres', auto=True))) + url=host, cat='genre', thumbnail=get_thumb('genres', auto=True))) itemlist.append(Item(channel=item.channel, action="category", title="Calidad", - url=host, cat='quality', page=0, thumbnail=get_thumb("quality", auto=True))) + url=host, cat='quality', thumbnail=get_thumb("quality", auto=True))) itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=host + "?s=", page=0, thumbnail=get_thumb("search", auto=True))) @@ -53,17 +53,18 @@ def category(item): itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + if item.cat == 'genre': data = scrapertools.find_single_match( data, '

Géneros .*?') - patron = '
  • ([^<]+)<' + patron = '
  • ([^<]+)<' elif item.cat == 'year': data = scrapertools.find_single_match( data, '

    Año de estreno.*?') - patron = 'li>([^<]+).*?<' + patron = 'li>([^<]+).*?<' elif item.cat == 'quality': data = scrapertools.find_single_match(data, '

    Calidad.*?') - patron = 'li>([^<]+)<' + patron = 'li>([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: itemlist.append(Item(channel=item.channel, action='movies', @@ -81,7 +82,7 @@ def movies(item): patron += '([^<]+).*?' patron += 'class="year">([^<]+).+?class="calidad2">([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) - for scrapedurl, img, scrapedtitle, resto, year, quality in matches[item.page:item.page + 30]: + for scrapedurl, img, scrapedtitle, resto, year, quality in matches[item.page:item.page + 20]: scrapedtitle = re.sub(r' \((\d+)\)', '', scrapedtitle) plot = scrapertools.htmlclean(resto).strip() title = ' %s [COLOR red][%s][/COLOR]' % (scrapedtitle, quality) @@ -97,14 +98,15 @@ def movies(item): infoLabels={'year': year})) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) # Paginacion - if item.page + 30 < len(matches): - itemlist.append(item.clone(page=item.page + 30, title=">> Siguiente")) + if item.page + 20 < len(matches): + itemlist.append(item.clone(page=item.page + 20, title=">> Siguiente")) else: next_page = scrapertools.find_single_match( - data, 'class="respo_pag">
    Siguiente<') + data, '') if next_page: - itemlist.append(item.clone( - url=next_page, page=0, title=">> Siguiente")) + itemlist.append(item.clone(url=next_page, page=0, + title=" Siguiente »")) + return itemlist @@ -113,7 +115,8 @@ def findvideos(item): itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) - data1= scrapertools.find_single_match(data,'
      .*?
    ') + data1 = scrapertools.find_single_match( + data, '
      .*?
    ') patron = "li>.*?href=.*?>([^\s]+)" matches1 = re.compile(patron, re.DOTALL).findall(data1) for lang in matches1: @@ -136,7 +139,6 @@ def findvideos(item): url = video_data.headers['location'] title = '%s' - else: patron = '