From 79f289b2833850ebc624fd20ae0f98ee8b11c15b Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Tue, 15 Jan 2019 21:25:08 +0100 Subject: [PATCH] Grantorrent: Novedades 4K --- plugin.video.alfa/channels/grantorrent.json | 8 +++++++ plugin.video.alfa/channels/grantorrent.py | 26 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/plugin.video.alfa/channels/grantorrent.json b/plugin.video.alfa/channels/grantorrent.json index 923acf94..88e3b68c 100644 --- a/plugin.video.alfa/channels/grantorrent.json +++ b/plugin.video.alfa/channels/grantorrent.json @@ -113,6 +113,14 @@ "14", "15" ] + }, + { + "id": "include_in_newest_4k", + "type": "bool", + "label": "Incluir en Novedades - 4K", + "default": true, + "enabled": true, + "visible": true } ] } diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index e2bb54ba..ff07dc1a 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -1086,3 +1086,29 @@ def search(item, texto): for line in sys.exc_info(): logger.error("ERROR: %s: SEARCH" % line) return [] + + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + + try: + if categoria == '4k': + item.url = host + "categoria/4k/" + item.extra = "peliculas" + item.channel = channel + item.category_new= 'newest' + + itemlist = listado(item) + if ">> Página siguiente" in itemlist[-1].title: + itemlist.pop() + + # Se captura la excepción, para no interrumpir al canal novedades si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist \ No newline at end of file