From f019e97a5f4f003fdb411170131097e76a9ea16f Mon Sep 17 00:00:00 2001 From: chivmalev Date: Tue, 15 Jan 2019 09:54:53 -0300 Subject: [PATCH] =?UTF-8?q?maxipelis24:correcci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/maxipelis24.py | 104 +++++++++++++--------- 1 file changed, 62 insertions(+), 42 deletions(-) diff --git a/plugin.video.alfa/channels/maxipelis24.py b/plugin.video.alfa/channels/maxipelis24.py index bfa6773d..f4da9333 100644 --- a/plugin.video.alfa/channels/maxipelis24.py +++ b/plugin.video.alfa/channels/maxipelis24.py @@ -19,14 +19,20 @@ def mainlist(item): logger.info() itemlist = [] - itemlist.append(Item(channel = item.channel, title = "peliculas", action = "movies", url = host, thumbnail = get_thumb('movies', auto = True))) - itemlist.append(Item(channel = item.channel, action = "category", title = "Año de Estreno", 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', thumbnail = get_thumb('genres', auto = True))) - itemlist.append(Item(channel = item.channel, action = "category", title = "Calidad", url = host, cat = 'quality', thumbnail = get_thumb("quality", auto = True))) - itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "?s=", thumbnail = get_thumb("search", auto = True))) - + 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))) + itemlist.append(Item(channel=item.channel, action="category", title="Géneros", + url=host, cat='genre', page=0, 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))) + itemlist.append(Item(channel=item.channel, title="Buscar", action="search", + url=host + "?s=", page=0, thumbnail=get_thumb("search", auto=True))) + return itemlist + def search(item, texto): logger.info() texto = texto.replace(" ", "+") @@ -34,62 +40,72 @@ def search(item, texto): if texto != '': return movies(item) + def category(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ","", data) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) if item.cat == 'genre': - data = scrapertools.find_single_match(data, '

Géneros .*?') + data = scrapertools.find_single_match( + data, '

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

    Año de estreno.*?') + data = scrapertools.find_single_match( + data, '

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

    Calidad.*?') patron = 'li>([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: - itemlist.append(Item(channel = item.channel, action = 'movies', title =scrapedtitle, url = scrapedurl, type = 'cat', first = 0)) + itemlist.append(Item(channel=item.channel, action='movies', + title=scrapedtitle, url=scrapedurl, type='cat', page=0)) return itemlist + def movies(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ","", data) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) patron = '
    Siguiente<', re.DOTALL).findall(data) - if matches: - url = urlparse.urljoin(item.url, matches[0]) - itemlist.append(Item(channel = item.channel, action = "movies", title = "Página siguiente >>", url = url)) + itemlist.append(Item(channel=item.channel, + title=title, + url=scrapedurl, + action="findvideos", + plot=plot, + thumbnail=img, + contentTitle=scrapedtitle, + contentType="movie", + quality=quality, + 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")) + else: + next_page = scrapertools.find_single_match( + data, 'class="respo_pag">
    Siguiente<') + if next_page: + itemlist.append(item.clone( + url=next_page, page=0, title=">> Siguiente")) return itemlist + def findvideos(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - data = re.sub(r"\n|\r|\t|\s{2}| ","", data) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) patron = '