diff --git a/channels/0example.json b/channels/0example.json new file mode 100644 index 00000000..f538f39c --- /dev/null +++ b/channels/0example.json @@ -0,0 +1,114 @@ +Rev:0.1 +Update: 18-9-2019 +##################### +Promemoria da cancellare pena la non visibilità del canale in KOD!! +##################### + + +le voci in settings sono state inserite per l'unico scopo +di velocizzare la scrittura del file +Vanno lasciate solo quelle voci il cui funzionamento sul +canale non vanno attivate. +Per esempio se il canale non ha: newest() +lasciare le voci dove c'è newest nell'id. Es: include_in_newest_series +Ovviamente va mantenuto tutto il codice di quell'id tra le {} +se vanno cancellati tutti deve rimanere la voce: +"settings": [] +##################### Cancellare fino a qui! +{ + "id": "nome del file .json", + "name": "Nome del canale visualizzato in KOD", + "language": ["ita", "vos"], + "active": false, + "adult": false, + "thumbnail": "", + "banner": "", + "categories": ["movie", "tvshow", "anime", "vos", "documentary", "adult"], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "@70728", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_series", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_anime", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "include_in_newest_italiano", + "type": "bool", + "label": "@70727", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "checklinks", + "type": "bool", + "label": "Verifica se i link esistono", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "checklinks_number", + "type": "list", + "label": "Numero di link da verificare", + "default": 2, + "enabled": false, + "visible": "eq(-1,false)", + "lvalues": [ "3", "5", "10", "15", "20" ] + }, + { + "id": "filter_languages", + "type": "list", + "label": "@30019", + "default": 0, + "enabled": false, + "visible": false, + "lvalues": ["Non Filtrare"] + } + ], + + "renumber": [ + { + "id": "autorenumber", + "type": "bool", + "label": "@70712", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "autorenumber_mode", + "type": "bool", + "label": "@70688", + "default": false, + "enabled": false, + "visible": "eq(-1,false)" + } + ] +} diff --git a/channels/0example.py b/channels/0example.py new file mode 100644 index 00000000..c1540995 --- /dev/null +++ b/channels/0example.py @@ -0,0 +1,243 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per 'idcanale nel json' +# ------------------------------------------------------------ +# Rev: 0.1 +# Update 17-09-2019 +""" + + Problemi noti che non superano il test del canale: + - indicare i problemi + + Avvisi: + - Eventuali avvisi per i tester + + Ulteriori info: + + +""" +# Questo vuole solo essere uno scheletro per velocizzare la scrittura di un canale. +# I commenti sono più un promemoria... che una vera e propria spiegazione! +# Niente di più. Ulteriori informazioni sono reperibili nel wiki: +# https://github.com/kodiondemand/addon/wiki/decoratori +# CANCELLARE Ciò CHE NON SERVE per il canale, lascia il codice commentato +# ma fare PULIZIA quando si è finito di testarlo + +# Qui gli import + +# per l'uso dei decoratori, per i log, e funzioni per siti particolari +from core import support +# se non si fa uso di findhost() +from platformcode import config + +# in caso di necessità +#from core import scrapertoolsV2, httptools, servertools, tmdb +#from core.item import Item +#from lib import unshortenit + +##### fine import + +# impostazioni variabili o def findhost() + +# se necessaria la variabile __channel__ +# da cancellare se non utilizzata +__channel__ = "id nel json" +# da cancellare se si utilizza findhost() +host = config.get_channel_url(id nel json o __channel__) +headers = [['Referer', host]] + +# Inizio findhost() - da cancellare se usato l'altro metodo +#impostati dinamicamente da findhost() +host = "" +headers = "" + +def findhost(): + global host, headers + # da adattare alla bisogna... + permUrl = httptools.downloadpage('INSERIRE-URL-QUI', follow_redirects=False).headers + host = 'https://www.'+permUrl['location'].replace('https://www.google.it/search?q=site:', '') + # cancellare host non utilizzato + host = scrapertoolsV2.find_single_match(data, r'