# -*- coding: utf-8 -*- # ------------------------------------------------------------ import urlparse import urllib2 import urllib import re import os import sys from platformcode import config, logger from core import scrapertools from core.item import Item from core import servertools from core import httptools host = 'https://www.youjizz.com' def mainlist(item): logger.info() itemlist = [] itemlist.append(Item(channel=item.channel, title="Nuevas", action="lista", url=host + "/newest-clips/1.html")) itemlist.append(Item(channel=item.channel, title="Popular", action="lista", url=host + "/most-popular/1.html")) itemlist.append( Item(channel=item.channel, title="Mejor valorada", action="lista", url=host + "/top-rated-week/1.html")) itemlist.append(Item(channel=item.channel, title="Categorias", action="categorias", url=host)) itemlist.append(Item(channel=item.channel, title="Buscar", action="search")) return itemlist def search(item, texto): logger.info() texto = texto.replace(" ", "+") item.url = host + "/search/%s-1.html" % texto try: return lista(item) except: import sys for line in sys.exc_info(): logger.error("%s" % line) return [] def categorias(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = scrapertools.get_match(data, '