From 9c14ec63ed283b6be9ebb5e7ff598812aefc964a Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Fri, 1 Jun 2018 19:38:17 +0200 Subject: [PATCH 1/7] =?UTF-8?q?GranTorrent:=20nuevo=20canal=20con=20gesti?= =?UTF-8?q?=C3=B3n=20din=C3=A1mica=20de=20Videoteca?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/grantorrent.json | 53 ++ plugin.video.alfa/channels/grantorrent.py | 978 ++++++++++++++++++++ 2 files changed, 1031 insertions(+) create mode 100644 plugin.video.alfa/channels/grantorrent.json create mode 100644 plugin.video.alfa/channels/grantorrent.py diff --git a/plugin.video.alfa/channels/grantorrent.json b/plugin.video.alfa/channels/grantorrent.json new file mode 100644 index 00000000..d82d7313 --- /dev/null +++ b/plugin.video.alfa/channels/grantorrent.json @@ -0,0 +1,53 @@ +{ + "id": "grantorrent", + "name": "GranTorrent", + "active": true, + "adult": false, + "language": ["*"], + "thumbnail": "grantorrent.jpg", + "banner": "grantorrent.png", + "fanart": "grantorrent.png", + "categories": [ + "torrent", + "movie", + "tvshow" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "seleccionar_serie_temporada", + "type": "list", + "label": "Seleccionar agrupar por Serie o Temporada", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "Temporada", + "Serie" + ] + }, + { + "id": "seleccionar_ult_temporadda_activa", + "type": "bool", + "label": "Seleccionar para Videoteca si estará activa solo la última Temporada", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra (TMDB)", + "default": true, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py new file mode 100644 index 00000000..0c38c107 --- /dev/null +++ b/plugin.video.alfa/channels/grantorrent.py @@ -0,0 +1,978 @@ +# -*- coding: utf-8 -*- + +import re +import sys +import urllib +import urlparse + +from channelselector import get_thumb +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from platformcode import config, logger +from core import tmdb + +host = "https://grantorrent.net/" + +dict_url_seasons = dict() +__modo_grafico__ = config.get_setting('modo_grafico', 'grantorrent') +modo_serie_temp = config.get_setting('seleccionar_serie_temporada', 'grantorrent') +modo_ultima_temp = config.get_setting('seleccionar_ult_temporadda_activa', 'grantorrent') + + +def mainlist(item): + logger.info() + + itemlist = [] + + thumb_pelis = get_thumb("channels_movie.png") + thumb_pelis_hd = get_thumb("channels_movie_hd.png") + thumb_series = get_thumb("channels_tvshow.png") + thumb_series_hd = get_thumb("channels_tvshow_hd.png") + thumb_buscar = get_thumb("search.png") + thumb_settings = get_thumb("setting_0.png") + + itemlist.append(Item(channel=item.channel, action="submenu", title="Películas", url=host, extra="peliculas", thumbnail=thumb_pelis)) + + #Buscar películas + itemlist.append(Item(channel=item.channel, action="search", title="Buscar en Películas >>", url=host, extra="peliculas", thumbnail=thumb_buscar)) + + itemlist.append(Item(channel=item.channel, action="submenu", title="Series", url=host, extra="series", thumbnail=thumb_series)) + + #Buscar series + itemlist.append(Item(channel=item.channel, action="search", title="Buscar en Series >>", url=host + "series/", extra="series", thumbnail=thumb_buscar)) + + itemlist.append( + Item(channel=item.channel, action="", title="[COLOR yellow]Configuración del Canal:[/COLOR]", url="", thumbnail=thumb_settings)) + itemlist.append( + Item(channel=item.channel, action="settingCanal", title="Opciones de Videoteca y TMDB", url="", thumbnail=thumb_settings)) + + return itemlist + + +def settingCanal(item): + from platformcode import platformtools + return platformtools.show_channel_settings() + + +def submenu(item): + logger.info() + itemlist = [] + + thumb_buscar = get_thumb("search.png") + + try: + data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) + except: + logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL") + itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) + return itemlist #Algo no funciona, pintamos lo que tenemos + + if item.extra == "peliculas": + patron = '