From f137dba2b16fa3183c52e273d8ab023302e8b1e7 Mon Sep 17 00:00:00 2001 From: greko Date: Mon, 3 Jun 2019 23:37:27 +0200 Subject: [PATCH] fix cinemalibero aggiunta configurazione canale per cambio host automatico --- channels/cinemalibero.json | 8 ++++++++ channels/cinemalibero.py | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/channels/cinemalibero.json b/channels/cinemalibero.json index 18dfce52..0124d1ad 100644 --- a/channels/cinemalibero.json +++ b/channels/cinemalibero.json @@ -8,6 +8,14 @@ "banner": "https://www.cinemalibero.center/wp-content/themes/Cinemalibero%202.0/images/logo02.png", "categories": ["tvshow", "movie","anime"], "settings": [ + { + "id": "channel_host", + "type": "text", + "label": "Host del canale", + "default": "https://www.cinemalibero.fun/", + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index 2709560f..0074f78c 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -11,7 +11,9 @@ from lib import unshortenit from platformcode import config from platformcode import logger from specials import autoplay +import channelselector +__channel__ = 'cinemalibero' # Necessario per Autoplay IDIOMAS = {'Italiano': 'IT'} list_language = IDIOMAS.values() @@ -22,12 +24,11 @@ list_quality = ['default'] checklinks = config.get_setting('checklinks', 'cinemalibero') checklinks_number = config.get_setting('checklinks_number', 'cinemalibero') -host = 'https://www.cinemalibero.icu' +#host = 'https://www.cinemalibero.fun/' +host = config.get_setting("channel_host", __channel__) headers = [['Referer', host]] - - def mainlist(item): logger.info('[cinemalibero.py] mainlist') @@ -44,6 +45,15 @@ def mainlist(item): support.menu(itemlist, 'Sport bold', 'video', host+'/category/sport/') autoplay.show_option(item.channel, itemlist) # Necessario per Autoplay (Menu Configurazione) + + itemlist.append( + Item(channel='setting', + action="channel_config", + title=support.typo("Configurazione Canale color lime"), + config=item.channel, + folder=False, + thumbnail=channelselector.get_thumb('setting_0.png')) + ) return itemlist