From af974ea65314297dd089ed1f3cf4b1ce5ca8f91b Mon Sep 17 00:00:00 2001 From: mrgaturus Date: Wed, 30 May 2018 01:44:56 -0500 Subject: [PATCH] C2ES/Buscar por letra: No mostrar error de kodi si no hay resultados --- plugin.video.alfa/channels/cuevana2espanol.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin.video.alfa/channels/cuevana2espanol.py b/plugin.video.alfa/channels/cuevana2espanol.py index db33fafe..368eaf18 100644 --- a/plugin.video.alfa/channels/cuevana2espanol.py +++ b/plugin.video.alfa/channels/cuevana2espanol.py @@ -92,19 +92,19 @@ def byLetter(item): pageForNonce = load_data(item.url) nonce = scrapertools.find_single_match(pageForNonce, '"nonce":"([^"]+)"') raw = httptools.downloadpage('http://cuevana2espanol.com/wp-json/dooplay/glossary/?term=%s&nonce=%s&type=all' % (letter, nonce)).data - json = jsontools.load(raw).items() + json = jsontools.load(raw) logger.info(nonce) + if 'error' not in json: + for movie in json.items(): + data = movie[1] + itemTitle = data['title'] + if 'year' in data: + itemTitle += " [COLOR blue](%s)[/COLOR]" % data['year'] + if data['imdb']: + itemTitle += " [COLOR yellow](%s)[/COLOR]" % data['imdb'] - for movie in json: - data = movie[1] - itemTitle = data['title'] - if 'year' in data: - itemTitle += " [COLOR blue](%s)[/COLOR]" % data['year'] - if data['imdb']: - itemTitle += " [COLOR yellow](%s)[/COLOR]" % data['imdb'] - - itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=data['title'], url=data['url'], - thumbnail=data['img'].replace('-90x135', ''), action="findvideos")) + itemlist.append(Item(channel = item.channel, title=itemTitle, fulltitle=data['title'], url=data['url'], + thumbnail=data['img'].replace('-90x135', ''), action="findvideos")) return itemlist