From 6dc853b41e317ae0d9494c4d0831350e0431a8a6 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Fri, 3 Nov 2017 15:49:52 -0500 Subject: [PATCH] repelis: fix categoria --- plugin.video.alfa/channels/repelis.py | 58 ++++++++------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/plugin.video.alfa/channels/repelis.py b/plugin.video.alfa/channels/repelis.py index 480a5e4f..dec63bd8 100644 --- a/plugin.video.alfa/channels/repelis.py +++ b/plugin.video.alfa/channels/repelis.py @@ -30,11 +30,6 @@ def mainlist(item): itemlist.append( Item(channel=item.channel, action="menudesta", title="Destacadas", url= host + "/pag/1", thumbnail="http://img.irtve.es/v/1074982/", fanart=mifan)) - itemlist.append(Item(channel=item.channel, action="menupelis", title="Proximos estrenos", - url= host + "/archivos/proximos-estrenos/pag/1", - thumbnail="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTpsRC" - "-GTYzCqhor2gIDfAB61XeymwgXWSVBHoRAKs2c5HAn29f&reload=on", - fanart=mifan)) itemlist.append(Item(channel=item.channel, action="menupelis", title="Todas las Peliculas", url= host + "/pag/1", thumbnail="https://freaksociety.files.wordpress.com/2012/02/logos-cine.jpg", fanart=mifan)) @@ -70,7 +65,8 @@ def menupelis(item): logger.info(item.url) itemlist = [] data = httptools.downloadpage(item.url).data.decode('iso-8859-1').encode('utf-8') - + if item.genre: + item.extra = item.genre if item.extra == '': section = 'Recién Agregadas' elif item.extra == 'year': @@ -79,17 +75,13 @@ def menupelis(item): section = 'de Eróticas \+18' else: section = 'de %s'%item.extra - - patronenlaces = 'Películas %s<\/h.>.*?>(.*?)<\/section>'%section - matchesenlaces = re.compile(patronenlaces, re.DOTALL).findall(data) - + patronenlaces = 'Películas %s.*?>(.*?)'%section + matchesenlaces = scrapertools.find_multiple_matches(data, patronenlaces) for bloque_enlaces in matchesenlaces: - patron = '
.*?' patron += '> 4) chr2 = ((enc2 & 15) << 4) | (enc3 >> 2) chr3 = ((enc3 & 3) << 6) | enc4 @@ -352,4 +326,4 @@ def decode(string): output = output.decode('utf8') - return output \ No newline at end of file + return output