diff --git a/plugin.video.alfa/channels/descargacineclasico.py b/plugin.video.alfa/channels/descargacineclasico.py index 8bfe9c9b..88291a9d 100755 --- a/plugin.video.alfa/channels/descargacineclasico.py +++ b/plugin.video.alfa/channels/descargacineclasico.py @@ -1,15 +1,15 @@ -# -*- coding: utf-8 -*- - +# -*- coding: utf-8 -*- import re -import urlparse from channelselector import get_thumb -from core import scrapertools -from core import servertools -from core.item import Item -from core.tmdb import Tmdb from platformcode import logger -from servers.decrypters import expurl +from core import scrapertools, httptools +from core import servertools +from core import tmdb +from core.item import Item +from lib import unshortenit + +host = "http://www.descargacineclasico.net" def agrupa_datos(data): @@ -22,54 +22,36 @@ def agrupa_datos(data): def mainlist(item): logger.info() - - thumb_buscar = get_thumb("search.png") - itemlist = [] itemlist.append(Item(channel=item.channel, title="Últimas agregadas", action="agregadas", - url="http://www.descargacineclasico.net/", viewmode="movie_with_plot", + url=host, viewmode="movie_with_plot", thumbnail=get_thumb('last', auto=True))) itemlist.append(Item(channel=item.channel, title="Listado por género", action="porGenero", - url="http://www.descargacineclasico.net/", + url=host, thumbnail=get_thumb('genres', auto=True))) itemlist.append( - Item(channel=item.channel, title="Buscar", action="search", url="http://www.descargacineclasico.net/", + Item(channel=item.channel, title="Buscar", action="search", url=host, thumbnail=get_thumb('search', auto=True))) - return itemlist def porGenero(item): logger.info() - itemlist = [] - data = scrapertools.cache_page(item.url) - logger.info("data=" + data) - + data = httptools.downloadpage(item.url).data patron = '' - data = re.compile(patron, re.DOTALL).findall(data) - patron = '.*?href="([^"]+).*?>([^<]+)' - matches = re.compile(patron, re.DOTALL).findall(data[0]) - - for url, genero in matches: - itemlist.append( - Item(channel=item.channel, action="agregadas", title=genero, url=url, viewmode="movie_with_plot")) - + data = re.compile(patron,re.DOTALL).findall(data) + patron = '.*?href="([^"]+).*?>([^<]+)' + matches = re.compile(patron,re.DOTALL).findall(data[0]) + for url,genero in matches: + itemlist.append( Item(channel=item.channel , action="agregadas" , title=genero,url=url, viewmode="movie_with_plot")) return itemlist -def search(item, texto): +def search(item,texto): logger.info() - - ''' - texto_get = texto.replace(" ","%20") - texto_post = texto.replace(" ","+") - item.url = "http://pelisadicto.com/buscar/%s?search=%s" % (texto_get,texto_post) - ''' - texto = texto.replace(" ", "+") - item.url = "http://www.descargacineclasico.net/?s=" + texto - + item.url = host + "?s=" + texto try: return agregadas(item) # Se captura la excepci?n, para no interrumpir al buscador global si un canal falla @@ -83,98 +65,62 @@ def search(item, texto): def agregadas(item): logger.info() itemlist = [] - ''' - # Descarga la pagina - if "?search=" in item.url: - url_search = item.url.split("?search=") - data = scrapertools.cache_page(url_search[0], url_search[1]) - else: - data = scrapertools.cache_page(item.url) - logger.info("data="+data) - ''' - - data = scrapertools.cache_page(item.url) - logger.info("data=" + data) - - # Extrae las entradas - fichas = re.sub(r"\n|\s{2}", "", scrapertools.get_match(data, '
(.*?)wp-pagenavi')) - - # - # Quatermass II (Quatermass 2) (1957) Descargar y ver Online Gratis - - - patron = '
(.*?)wp-pagenavi')) + patron = '
  • 2
  • 3
  • 4
  • 5
  • 6
  • - patron_nextpage = r'