# -*- coding: utf-8 -*- import re import urlparse from core import config from core import logger from core import scrapertools from core import servertools from core.item import Item # Main list manual def mainlist(item): logger.info() itemlist = [] item.url = "http://www.repelis.tv/pag/1" mifan = "http://www.psicocine.com/wp-content/uploads/2013/08/Bad_Robot_Logo.jpg" itemlist.append(Item(channel=item.channel, action="menupelis", title="Peliculas", url="http://www.repelis.tv/pag/1", thumbnail="http://www.gaceta.es/sites/default/files/styles/668x300/public/metro_goldwyn_mayer_1926-web.png?itok=-lRSR9ZC", fanart=mifan)) itemlist.append(Item(channel=item.channel, action="menuestre", title="Estrenos", url="http://www.repelis.tv/archivos/estrenos/pag/1", thumbnail="http://t0.gstatic.com/images?q=tbn:ANd9GcS4g68rmeLQFuX7iCrPwd00FI_OlINZXCYXEFrJHTZ0VSHefIIbaw", fanart=mifan)) itemlist.append( Item(channel=item.channel, action="menudesta", title="Destacadas", url="http://www.repelis.tv/pag/1", thumbnail="http://img.irtve.es/v/1074982/", fanart=mifan)) itemlist.append(Item(channel=item.channel, action="todaspelis", title="Proximos estrenos", url="http://www.repelis.tv/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="todaspelis", title="Todas las Peliculas", url="http://www.repelis.tv/pag/1", thumbnail="https://freaksociety.files.wordpress.com/2012/02/logos-cine.jpg", fanart=mifan)) if config.get_setting("adult_mode") != 0: itemlist.append(Item(channel=item.channel, action="todaspelis", title="Eroticas +18", url="http://www.repelis.tv/genero/eroticas/pag/1", thumbnail="http://www.topkamisetas.com/catalogo/images/TB0005.gif", fanart="http://www.topkamisetas.com/catalogo/images/TB0005.gif")) # Quito la busqueda por año si no esta enabled el adultmode, porque no hay manera de filtrar los enlaces eroticos72 itemlist.append( Item(channel=item.channel, action="poranyo", title="Por Año", url="http://www.repelis.tv/anio/2016", thumbnail="http://t3.gstatic.com/images?q=tbn:ANd9GcSkxiYXdBcI0cvBLsb_nNlz_dWXHRl2Q-ER9dPnP1gNUudhrqlR", fanart=mifan)) # Por categoria si que filtra la categoria de eroticos itemlist.append(Item(channel=item.channel, action="porcateg", title="Por Categoria", url="http://www.repelis.tv/genero/accion/pag/1", thumbnail="http://www.logopro.it/blog/wp-content/uploads/2013/07/categoria-sigaretta-elettronica.png", fanart=mifan)) itemlist.append( Item(channel=item.channel, action="search", title="Buscar...", url="http://www.repelis.tv/search/?s=", thumbnail="http://thumbs.dreamstime.com/x/buscar-pistas-13159747.jpg", fanart=mifan)) return itemlist # Peliculas recien agregadas ( quitamos las de estreno del slide-bar en el top def menupelis(item): logger.info(item.url) itemlist = [] data = scrapertools.cache_page(item.url).decode('iso-8859-1').encode('utf-8') patronenlaces = '

Películas Recién Agregadas

.*?>(.*?)' matchesenlaces = re.compile(patronenlaces, re.DOTALL).findall(data) logger.info("begin ----------") scrapertools.printMatches(matchesenlaces) logger.info("end ----------") for bloque_enlaces in matchesenlaces: patron = '
.*?' patron += '2> Página siguiente" try: next_page = scrapertools.get_match(data, '\d+2> Página siguiente" try: next_page = scrapertools.get_match(data, '\d+2> Página siguiente" try: next_page = scrapertools.get_match(data, '\d+Sinopsis

(.*?)

Titulo en Español

Abzurdah

Titulo Original

Abzurdah

Año de Lanzamiento

2015

Generos

Romance

Idioma

Latino

Calidad

DVD-Rip

''' # estos son los datos para plot patron = '

Sinopsis

.*?

(.*?)

.*?
.*?

(.*?)

' # titulo matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) for sinopsis, title in matches: title = "[COLOR white][B]" + title + "[/B][/COLOR]" patron = '
(.*?)
' matches = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matches) for scrapedplot in matches: splot = title + "\n\n" plot = scrapedplot plot = re.sub('

', "[COLOR red][B]", plot) plot = re.sub('

', "[/B][/COLOR] : ", plot) plot = re.sub('

', "[COLOR green]", plot) plot = re.sub('

', "[/COLOR]\n", plot) plot = re.sub('<[^>]+>', "", plot) splot += plot + "\n[COLOR red][B] Sinopsis[/B][/COLOR]\n " + sinopsis # datos de los enlaces '''
(.*?)(.*?) ">Vimple ''' patron = '(.*?)' matchesx = re.compile(patron, re.DOTALL).findall(data) scrapertools.printMatches(matchesx) for bloq in matchesx: patron = 'href="(.*?)".*?0 0">(.*?)(.*?)(.*?)<' matches = re.compile(patron, re.DOTALL).findall(bloq) # scrapertools.printMatches(matches) for scrapedurl, scrapedserver, scrapedlang, scrapedquality in matches: url = urlparse.urljoin(item.url, scrapedurl) logger.info("Lang:[" + scrapedlang + "] Quality[" + scrapedquality + "] URL[" + url + "]") patronenlaces = '.*?://(.*?)/' matchesenlaces = re.compile(patronenlaces, re.DOTALL).findall(scrapedurl) scrapertools.printMatches(matchesenlaces) scrapedtitle = "" for scrapedenlace in matchesenlaces: scrapedtitle = title + " [COLOR white][ [/COLOR]" + "[COLOR green]" + scrapedquality + "[/COLOR]" + "[COLOR white] ][/COLOR]" + " [COLOR red] [" + scrapedlang + "][/COLOR] » " + scrapedserver itemlist.append( Item(channel=item.channel, action="play", title=scrapedtitle, extra=title, url=url, fanart=item.thumbnail, thumbnail=item.thumbnail, plot=splot, folder=False)) return itemlist def play(item): logger.info("url=" + item.url) # itemlist = servertools.find_video_items(data=item.url) url = scrapertools.find_single_match(scrapertools.cache_page(item.url), '