# -*- coding: utf-8 -*- import re import urlparse from core import httptools from core import scrapertools from core.item import Item from platformcode import logger host = "https://watchfreexxx.net/" def mainlist(item): itemlist = [] itemlist.append(Item(channel=item.channel, title="Peliculas", action="lista", url = urlparse.urljoin(host, "category/porn-movies/"))) itemlist.append(Item(channel=item.channel, title="Escenas", action="lista", url = urlparse.urljoin(host, "category/xxx-scenes/"))) itemlist.append(Item(channel=item.channel, title="Buscar", action="search", url=host+'?s=', thumbnail='https://s30.postimg.cc/pei7txpa9/buscar.png', fanart='https://s30.postimg.cc/pei7txpa9/buscar.png')) return itemlist def lista(item): logger.info() itemlist = [] if item.url == '': item.url = host data = httptools.downloadpage(item.url).data data = re.sub(r'\n|\r|\t| |
|\s{2,}', "", data) patron = '
Next') if next_page != '': itemlist.append(Item(channel=item.channel, action="lista", title='Siguiente >>>', url=next_page, thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png', extra=item.extra)) return itemlist def search(item, texto): logger.info() texto = texto.replace(" ", "+") item.url = item.url + texto try: if texto != '': item.extra = 'Buscar' return lista(item) else: return [] except: import sys for line in sys.exc_info(): logger.error("%s" % line) return []