# -*- coding: utf-8 -*- import re import urlparse from core import scrapertools, httptools from core.item import Item from core.scrapertools import decodeHtmlentities as dhe from platformcode import logger def mainlist(item): logger.info() itemlist = [] itemlist.append(Item(channel=item.channel, title="[COLOR forestgreen]Videos[/COLOR]", action="scraper", url="http://cuelgame.net/?category=4", thumbnail="http://img5a.flixcart.com/image/poster/q/t/d/vintage-camera-collage-sr148-medium-400x400-imadkbnrnbpggqyz.jpeg", fanart="http://imgur.com/7frGoPL.jpg")) itemlist.append(Item(channel=item.channel, title="[COLOR forestgreen]Buscar[/COLOR]", action="search", url="", thumbnail="http://images2.alphacoders.com/846/84682.jpg", fanart="http://imgur.com/1sIHN1r.jpg")) return itemlist def search(item, texto): logger.info() texto = texto.replace(" ", "+") item.url = "http://cuelgame.net/search.php?q=%s" % (texto) try: return scraper(item) # Se captura la excepciÛn, para no interrumpir al buscador global si un canal falla except: import sys for line in sys.exc_info(): logger.error("%s" % line) return [] def scraper(item): logger.info() itemlist = [] # Descarga la página data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| |CET", "", data) patron = '