From a3440c96d437aca56928087e314920c94c779203 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Wed, 21 Feb 2018 11:57:50 -0500 Subject: [PATCH] cinecalidad: fix --- plugin.video.alfa/channels/cinecalidad.py | 77 ++--------------------- 1 file changed, 5 insertions(+), 72 deletions(-) diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index 55981dd3..48207535 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -14,7 +14,6 @@ from platformcode import config, logger IDIOMAS = {'latino': 'Latino', 'castellano': 'Español', 'portugues': 'Portugues'} list_language = IDIOMAS.values() -logger.debug('lista_language: %s' % list_language) list_quality = ['1080p', '720p', '480p', '360p', '240p', 'default'] list_servers = [ @@ -114,7 +113,7 @@ def submenu(item): title="Buscar", action="search", thumbnail='https://s30.postimg.org/pei7txpa9/buscar.png', - url=host + '/apiseries/seriebyword/', + url=host + '/?s=', fanart='https://s30.postimg.org/pei7txpa9/buscar.png', host=item.host, )) @@ -350,15 +349,12 @@ def get_urls(item, link): data = httptools.downloadpage(url, post=post, headers=headers).data dict_data = jsontools.load(data) - logger.debug(dict_data['link']) - logger.debug(data) return dict_data['link'] def play(item): logger.info() itemlist = [] - logger.debug('item: %s' % item) if 'juicyapi' not in item.url: itemlist = servertools.find_video_items(data=item.url) @@ -397,72 +393,9 @@ def newest(categoria): return itemlist - -def busqueda(item): - logger.info() - itemlist = [] - - # Descarga la página - data = httptools.downloadpage(item.url).data - - from core import jsontools - data = jsontools.load(data) - - for entry in data["results"]: - title = entry["richSnippet"]["metatags"]["ogTitle"] - url = entry["url"] - plot = entry["content"] - plot = scrapertools.htmlclean(plot) - thumbnail = entry["richSnippet"]["metatags"]["ogImage"] - title = scrapertools.find_single_match(title, '(.*?) \(.*?\)') - year = re.sub(r'.*?\((\d{4})\)', '', title) - title = year - fulltitle = title - - new_item = item.clone(action="findvideos", - title=title, - fulltitle=fulltitle, - url=url, - thumbnail=thumbnail, - contentTitle=title, - contentType="movie", - plot=plot, - infoLabels={'year': year, 'sinopsis': plot} - ) - itemlist.append(new_item) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - - actualpage = int(scrapertools.find_single_match(item.url, 'start=(\d+)')) - totalresults = int(data["cursor"]["resultCount"]) - if actualpage + 20 <= totalresults: - url_next = item.url.replace("start=" + str(actualpage), "start=" + str(actualpage + 20)) - itemlist.append( - Item(channel=item.channel, - action="busqueda", - title=">> Página Siguiente", - url=url_next - )) - - return itemlist - - def search(item, texto): logger.info() - - data = httptools.downloadpage(host).data - cx = scrapertools.find_single_match(data, 'name="cx" value="(.*?)"') - texto = texto.replace(" ", "%20") - item.url = "https://www.googleapis.com/customsearch/v1element?key=AIzaSyCVAXiUzRYsML1Pv6RwSG1gunmMikTzQqY&rsz" \ - "=filtered_cse&num=20&hl=es&sig=0c3990ce7a056ed50667fe0c3873c9b6&cx=%s&q=%s&sort=&googlehost=www" \ - ".google.com&start=0" % (cx, texto) - - try: - return busqueda(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 [] - + texto = texto.replace(" ", "-") + item.url = host + '/?s=' + texto + if texto != '': + return peliculas(item)