From 851acaca885033278e1c30bb3fb3957557360859 Mon Sep 17 00:00:00 2001 From: pipcat Date: Fri, 24 Aug 2018 18:54:35 +0200 Subject: [PATCH 1/4] Correcciones pelispedia --- plugin.video.alfa/channels/pelispedia.py | 75 +++++------------------- 1 file changed, 14 insertions(+), 61 deletions(-) diff --git a/plugin.video.alfa/channels/pelispedia.py b/plugin.video.alfa/channels/pelispedia.py index e10c382d..edaeb8ee 100644 --- a/plugin.video.alfa/channels/pelispedia.py +++ b/plugin.video.alfa/channels/pelispedia.py @@ -114,21 +114,12 @@ def listado_alfabetico(item): itemlist = [] for letra in '0ABCDEFGHIJKLMNOPQRSTUVWXYZ': - - cadena = "series/letra/" if item.extra == "movies": - cadena = 'movies/all/?letra=' + cadena = 'letra/' + ('num' if letra == '0' else letra) + '/' viewcontent = "movies" - if letra == '0': - cadena += "Num" - else: - cadena += letra else: + cadena = 'series/letra/' + ('num' if letra == '0' else letra) + '/' viewcontent = "tvshows" - if letra == '0': - cadena += "num/" - else: - cadena += letra + "/" itemlist.append( Item(channel=__channel__, action="listado", title=letra, url=urlparse.urljoin(CHANNEL_HOST, cadena), @@ -148,7 +139,7 @@ def listado_genero(item): data = re.sub(r"\n|\r|\t|\s{2}| |
|
|
|
|
|-\s", "", data) if item.extra == "movies": - cadena = 'movies/all/?gender=' + cadena = 'genero/' viewcontent = "movies" patron = '' data = scrapertools.find_single_match(data, patron) @@ -164,9 +155,7 @@ def listado_genero(item): matches = re.compile(patron, re.DOTALL).findall(data) for key, value in matches[1:]: - cadena2 = cadena + key - if item.extra != "movies": - cadena2 += "/" + cadena2 = cadena + key + '/' itemlist.append( Item(channel=__channel__, action="listado", title=value, url=urlparse.urljoin(CHANNEL_HOST, cadena2), @@ -186,7 +175,7 @@ def listado_anio(item): data = re.sub(r"\n|\r|\t|\s{2}| |
|
|
|
|
|-\s", "", data) if item.extra == "movies": - cadena = 'movies/all/?year=' + cadena = 'anio/' viewcontent = "movies" patron = '' data = scrapertools.find_single_match(data, patron) @@ -203,10 +192,7 @@ def listado_anio(item): matches = re.compile(patron, re.DOTALL).findall(data) for value in matches[1:]: - cadena2 = cadena + value - - if item.extra != "movies": - cadena2 += "/" + cadena2 = cadena + value + '/' itemlist.append( Item(channel=__channel__, action="listado", title=titulo + value, url=urlparse.urljoin(CHANNEL_HOST, cadena2), @@ -294,7 +280,7 @@ def listado(item): '

(.*?)

' matches = re.compile(patron, re.DOTALL).findall(data) - for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear, scrapedplot in matches[:28]: + for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear, scrapedplot in matches: title = "%s (%s)" % (scrapertools.unescape(scrapedtitle.strip()), scrapedyear) plot = scrapertools.entityunescape(scrapedplot) @@ -309,52 +295,19 @@ def listado(item): else: new_item.fulltitle = scrapertools.unescape(scrapedtitle.strip()) new_item.infoLabels = {'year': scrapedyear} - # logger.debug(new_item.tostring()) itemlist.append(new_item) # Obtenemos los datos basicos de todas las peliculas mediante multihilos tmdb.set_infoLabels(itemlist, __modo_grafico__) - # numero de registros que se muestran por página, se fija a 28 por cada paginación - if len(matches) >= 28 and '/buscar/?' not in item.url: + if '