From d751c27253fe776ca896def5791d63de0dfdbb49 Mon Sep 17 00:00:00 2001 From: greko17 Date: Sun, 3 Nov 2019 15:24:33 +0100 Subject: [PATCH 1/8] fix: cinemalibero --- channels/cinemalibero.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index c2c3bee5..0f9c26b4 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -133,7 +133,7 @@ def episodios(item): # Questa def. deve sempre essere nominata episodios url=item.url, show=item.fulltitle, contentType='movie')) - debug = True + #debug = True return locals() @support.scrape @@ -157,7 +157,7 @@ def select(item): return episodios(Item(channel=item.channel, title=item.title, fulltitle=item.fulltitle, - contentSerieName = fulltitle, + contentSerieName = item.fulltitle, url=item.url, extra='serie', contentType='episode')) From 0b4eadc2635a2b0b3286e376b1f5858bb0fdae76 Mon Sep 17 00:00:00 2001 From: greko17 Date: Mon, 4 Nov 2019 00:40:48 +0100 Subject: [PATCH 2/8] fix: example estensione .txt per togliere errrore nei log --- channels/0example.json.txt | 116 +++++++++++++++ channels/0example.py.txt | 286 +++++++++++++++++++++++++++++++++++++ 2 files changed, 402 insertions(+) create mode 100644 channels/0example.json.txt create mode 100644 channels/0example.py.txt diff --git a/channels/0example.json.txt b/channels/0example.json.txt new file mode 100644 index 00000000..783193c6 --- /dev/null +++ b/channels/0example.json.txt @@ -0,0 +1,116 @@ +Rev:0.2 +Update: 03-10-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. +"not_active": ["include_in_newest"], VA INSERITO nei canali che NON hanno nessuna voce newest. +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", "sub-ita"], + "active": false, + "adult": false, + "thumbnail": "", + "banner": "", + "categories": ["movie", "tvshow", "anime", "vos", "documentary", "adult"], + "not_active": ["include_in_newest"], + "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.txt b/channels/0example.py.txt new file mode 100644 index 00000000..f418da4a --- /dev/null +++ b/channels/0example.py.txt @@ -0,0 +1,286 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per 'idcanale nel json' +# By: pincopallo! +# Eventuali crediti se vuoi aggiungerli +# ------------------------------------------------------------ +# Rev: 0.2 +# Update 12-10-2019 +# fix: +# 1. aggiunto pagination e sistemate alcune voci +# 2. modificato problemi in eccezioni +# 3. aggiunta la def select +# 4. modifica alla legenda e altre aggiunte + +# Questo vuole solo essere uno scheletro per velocizzare la scrittura di un canale. +# La maggior parte dei canali può essere scritta con il decoratore. +# 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 + +""" + Questi sono commenti per i beta-tester. + + Su questo canale, nella categoria 'Ricerca Globale' + non saranno presenti le voci 'Aggiungi alla Videoteca' + e 'Scarica Film'/'Scarica Serie', dunque, + la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE. + + Novità. Indicare in quale/i sezione/i è presente il canale: + - Nessuna, film, serie, anime... + + Avvisi: + - Eventuali avvisi per i tester + + Ulteriori info: + +""" +# CANCELLARE Ciò CHE NON SERVE per il canale, lascia il codice commentato ove occorre, +# ma fare PULIZIA quando si è finito di testarlo + +# Qui gli import +#import re + +# 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 # per newest +#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' OR __channel__) # <-- ATTENZIONE +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(permUrl, r'
', item) + #support.dbg() + data = httptools.downloadpage(item.url, headers=headers).data + # pulizia di data, in caso commentare le prossime 2 righe + data = re.sub('\n|\t', ' ', data) + data = re.sub(r'>\s+<', '> <', data) + block = scrapertoolsV2.find_single_match(data, r'') + if re.findall('', data, re.IGNORECASE): + support.log('select = ### è una serie ###') + return episodios(Item(channel=item.channel, + title=item.title, + fulltitle=item.fulltitle, + url=item.url, + args='serie', + contentType='tvshow', + #data1 = data decommentando portiamo data nella def senza doverla riscaricare + )) + +############## Fondo Pagina +# da adattare al canale +def search(item, text): + support.log('search', item) + itemlist = [] + text = text.replace(' ', '+') + item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) + # bisogna inserire item.contentType per la ricerca globale + # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. + item.contentType = item.contentType + try: + return peliculas(item) + # Se captura la excepcion, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + log('search log:', line) + return [] + + +# da adattare al canale +# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte +# altrimenti NON inserirlo +def newest(categoria): + support.log('newest ->', categoria) + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + item.action = 'peliculas' + itemlist = peliculas(item) + + if itemlist[-1].action == 'peliculas': + itemlist.pop() + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.log('newest log: ', {0}.format(line)) + return [] + + return itemlist + +# da adattare... +# consultare il wiki sia per support.server che ha vari parametri, +# sia per i siti con hdpass +#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True) +def findvideos(item): + support.log('findvideos ->', item) + return support.server(item, headers=headers) From a240610772bf438b7e06baa322600cf5bc7c0490 Mon Sep 17 00:00:00 2001 From: greko17 Date: Mon, 4 Nov 2019 00:46:42 +0100 Subject: [PATCH 3/8] fix: canali con findhost() --- channels/altadefinizione01.py | 13 ++++---- channels/casacinemaInfo.py | 11 +++++-- channels/eurostreaming.py | 16 ++++++---- channels/seriehd.py | 60 +++++++++++++++++------------------ channels/serietvonline.py | 16 +++++++--- 5 files changed, 66 insertions(+), 50 deletions(-) diff --git a/channels/altadefinizione01.py b/channels/altadefinizione01.py index 506b091d..be01b78f 100644 --- a/channels/altadefinizione01.py +++ b/channels/altadefinizione01.py @@ -27,14 +27,12 @@ def findhost(): host = scrapertoolsV2.find_single_match(data, '
]+>[^>]+ [^>]+[^>]+ [^>]+>(?P[^<]+).*?[^>]+>(?P<year>\d{4})<'\ @@ -106,7 +105,8 @@ def orderalf(item): def search(item, text): support.log(item, text) - + findhost() + itemlist = [] text = text.replace(" ", "+") item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text) @@ -122,6 +122,7 @@ def search(item, text): def newest(categoria): support.log(categoria) + findhost() itemlist = [] item = Item() try: diff --git a/channels/casacinemaInfo.py b/channels/casacinemaInfo.py index 8f48cdef..d94c55a4 100644 --- a/channels/casacinemaInfo.py +++ b/channels/casacinemaInfo.py @@ -32,7 +32,7 @@ def findhost(): headers = [['Referer', host]] if host.endswith('/'): host = host[:-1] -findhost() + list_servers = ['supervideo', 'streamcherry','rapidvideo', 'streamango', 'openload'] list_quality = ['default', 'HD', '3D', '4K', 'DVD', 'SD'] @@ -40,7 +40,7 @@ list_quality = ['default', 'HD', '3D', '4K', 'DVD', 'SD'] @support.menu def mainlist(item): support.log(item) - + findhost() film = ['', ('Al Cinema', ['/category/in-sala/', 'peliculas', '']), ('Novità', ['/category/nuove-uscite/', 'peliculas', '']), @@ -55,7 +55,8 @@ def mainlist(item): def peliculas(item): support.log(item) #support.dbg() # decommentare per attivare web_pdb - + #findhost() + blacklist = [''] if item.args != 'search': patron = r'<div class="col-mt-5 postsh">[^<>]+<div class="poster-media-card">[^<>]+<a href="(?P<url>[^"]+)" title="(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?".*?<img(?:.+?)?src="(?P<thumb>[^"]+)"' @@ -66,6 +67,7 @@ def peliculas(item): patronNext = '<a href="([^"]+)"\s+?><i class="glyphicon glyphicon-chevron-right"' + #support.regexDbg(item, patronBlock, headers) #debug = True return locals() @@ -86,6 +88,7 @@ def genres(item): def search(item, text): support.log('search', item) + findhost() itemlist = [] text = text.replace(' ', '+') item.args = 'search' @@ -101,8 +104,10 @@ def search(item, text): def newest(categoria): support.log('newest ->', categoria) + findhost() itemlist = [] item = Item() + try: if categoria == 'peliculas': item.url = host diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index e0948c03..7e96865e 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -26,7 +26,7 @@ def findhost(): host = 'https://www.'+permUrl['location'].replace('https://www.google.it/search?q=site:', '') headers = [['Referer', host]] -findhost() + list_servers = ['verystream', 'wstream', 'speedvideo', 'flashx', 'nowvideo', 'streamango', 'deltabit', 'openload'] list_quality = ['default'] @@ -34,13 +34,12 @@ list_quality = ['default'] @support.menu def mainlist(item): support.log() + findhost() tvshow = ['' ] - anime = ['/category/anime-cartoni-animati/' ] - mix = [ (support.typo('Aggiornamenti Serie-Anime', 'bullet bold'), ['/aggiornamento-episodi/', 'peliculas', 'newest']), (support.typo('Archivio Serie-Anime', 'bullet bold'), ['/category/serie-tv-archive/', 'peliculas']) @@ -53,7 +52,7 @@ def mainlist(item): @support.scrape def peliculas(item): support.log() - + #findhost() action = 'episodios' if item.args == 'newest': #patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>.*?).[^–][\s]?<a href="(?P<url>[^"]+)"\s+target="_blank">(?P<episode>\d+x\d+-\d+|\d+x\d+) (?P<title2>.*?)[ ]?(?:|\((?P<lang>SUB ITA)\))?</a>' @@ -62,13 +61,14 @@ def peliculas(item): else: patron = r'<div class="post-thumb">.*?\s<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>' patronNext='a class="next page-numbers" href="?([^>"]+)">Avanti »</a>' - + #debug = True return locals() @support.scrape def episodios(item): support.log("episodios: %s" % item) + #findhost() action = 'findvideos' item.contentType = 'tvshow' @@ -76,7 +76,8 @@ def episodios(item): data1 = pagina(item.url) data1 = re.sub('\n|\t', ' ', data1) data = re.sub(r'>\s+<', '> <', data1) - patronBlock = r'(?P<block>STAGIONE\s\d+ (.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>' + #patronBlock = r'(?P<block>STAGIONE\s\d+ (.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>' + patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>' #patron = r'(?:\s|\Wn)?(?:<strong>|)?(?P<episode>\d+&#\d+;\d+-\d+|\d+&#\d+;\d+)(?:</strong>|)?(?P<title>.+?)(?:–|-.+?-|–.+?–|–|.)?<a (?P<url>.*?)<br />' patron = r'(?:\s|\Wn)?(?:<strong>|)?(?P<episode>\d+&#\d+;\d+-\d+|\d+&#\d+;\d+)(?:</strong>|)?(?P<title>.+?)(?:–|-.+?-|–.+?–|–|.)?(?:<a (?P<url>.*?))?<br />' @@ -91,6 +92,7 @@ def episodios(item): def pagina(url): support.log(url) + #findhost() data = httptools.downloadpage(url, headers=headers).data.replace("'", '"') #support.log("DATA ----###----> ", data) @@ -110,6 +112,7 @@ def pagina(url): # =========== def ricerca ============= def search(item, texto): support.log() + findhost() item.url = "%s/?s=%s" % (host, texto) item.contentType = 'tvshow' @@ -127,6 +130,7 @@ def search(item, texto): def newest(categoria): support.log() + findhost() itemlist = [] item = Item() item.contentType = 'tvshow' diff --git a/channels/seriehd.py b/channels/seriehd.py index 030d0c7b..a8853e8a 100644 --- a/channels/seriehd.py +++ b/channels/seriehd.py @@ -7,23 +7,19 @@ from core import scrapertoolsV2, httptools, support from core.item import Item -# impostati dinamicamente da findhost() host = '' headers = '' def findhost(): + global host, headers data= httptools.downloadpage('https://seriehd.nuovo.link/').data global host, headers host = scrapertoolsV2.find_single_match(data, r'<div class="elementor-button-wrapper"> <a href="([^"]+)"') headers = [['Referer', host]] - return host - -findhost() list_servers = ['verystream', 'openload', 'streamango', 'thevideome'] list_quality = ['1080p', '720p', '480p', '360'] - @support.menu def mainlist(item): findhost() @@ -33,33 +29,9 @@ def mainlist(item): return locals() -def search(item, texto): - support.log(texto) - - item.contentType = 'tvshow' - item.url = host + "/?s=" + texto - try: - return peliculas(item) - - # Continua la ricerca in caso di errore . - except: - import sys - for line in sys.exc_info(): - support.logger.error("%s" % line) - return [] - - -@support.scrape -def genre(item): - patronMenu = '<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>' - blacklist = ['Serie TV','Serie TV Americane','Serie TV Italiane','altadefinizione'] - patronBlock = '<ul class="sub-menu">(?P<block>.*)</ul>' - action = 'peliculas' - return locals() - - @support.scrape def peliculas(item): + #findhost() patron = r'<h2>(?P<title>.*?)</h2>\s*<img src="(?P<thumb>[^"]+)" alt="[^"]*" />\s*<A HREF="(?P<url>[^"]+)">.*?<span class="year">(?:(?P<year>[0-9]{4}))?.*?<span class="calidad">(?:(?P<quality>[A-Z]+))?.*?</span>' patronNext=r'<span class="current">\d+</span><a rel="nofollow" class="page larger" href="([^"]+)">\d+</a>' action='episodios' @@ -68,6 +40,7 @@ def peliculas(item): @support.scrape def episodios(item): + #findhost() data ='' url = support.match(item, patronBlock=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">')[1] seasons = support.match(item, r'<a href="([^"]+)">(\d+)<', r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers, url)[0] @@ -82,8 +55,35 @@ def episodios(item): action = 'findvideos' return locals() + +@support.scrape +def genre(item): + #findhost() + patronMenu = '<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>' + blacklist = ['Serie TV','Serie TV Americane','Serie TV Italiane','altadefinizione'] + patronBlock = '<ul class="sub-menu">(?P<block>.*)</ul>' + action = 'peliculas' + return locals() + + +def search(item, texto): + support.log(texto) + findhost() + + item.contentType = 'tvshow' + item.url = host + "/?s=" + texto + try: + return peliculas(item) + # Continua la ricerca in caso di errore . + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + def newest(categoria): support.log(categoria) + findhost() itemlist = [] item = support.Item() try: diff --git a/channels/serietvonline.py b/channels/serietvonline.py index 8c090a34..c92fbe3b 100644 --- a/channels/serietvonline.py +++ b/channels/serietvonline.py @@ -28,7 +28,6 @@ def findhost(): data = httptools.downloadpage('https://serietvonline.me/').data host = scrapertoolsV2.find_single_match(data, r'<a class="pure-button pure-button-primary" title=\'serie tv online\' href="([^"]+)">') headers = [['Referer', host]] -findhost() list_servers = ['akvideo', 'wstream', 'backin', 'vidtome', 'nowvideo'] list_quality = ['default'] @@ -37,6 +36,7 @@ list_quality = ['default'] @support.menu def mainlist(item): support.log() + findhost() film = ['/ultimi-film-aggiunti/', ('Lista', ['/lista-film/', 'peliculas', 'lista']) @@ -61,6 +61,7 @@ def mainlist(item): @support.scrape def peliculas(item): support.log() + #findhost() blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Ccartoni Animati e Anime'] patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">' @@ -86,6 +87,11 @@ def peliculas(item): ## item.action = 'episodios' ## return item + elif item.contentType == 'episode': + pagination = 35 + action = 'findvideos' + patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<' + elif item.contentType == 'tvshow': # SEZIONE Serie TV- Anime - Documentari pagination = 35 @@ -94,9 +100,6 @@ def peliculas(item): patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+?href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[ ](?P<rating>\d+.\d+|\d+)<[^>]+>[^>]+><h2>(?P<title>[^"]+)</h2>[ ]?(?:<span class="year">(?P<year>\d+|\-\d+))?<' else: patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<' - if item.args == 'update': - action = 'findvideos' - patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<' else: # SEZIONE FILM @@ -129,6 +132,7 @@ def peliculas(item): @support.scrape def episodios(item): support.log() + #findhost() action = 'findvideos' patronBlock = r'<table>(?P<block>.*?)<\/table>' @@ -140,6 +144,7 @@ def episodios(item): def search(item, text): support.log("CERCA :" ,text, item) + findhost() item.url = "%s/?s=%s" % (host, text) try: @@ -154,6 +159,7 @@ def search(item, text): def newest(categoria): support.log(categoria) + findhost() itemlist = [] item = Item() @@ -162,7 +168,7 @@ def newest(categoria): item.url = host + '/ultimi-film-aggiunti/' elif categoria == 'series': item.args = 'update' - item.contentType = 'tvshow' + item.contentType = 'episode' item.url = host +'/ultimi-episodi-aggiunti/' try: item.action = 'peliculas' From 75ab1763bf514677edaa8da857b1b8a44d4e5e6f Mon Sep 17 00:00:00 2001 From: greko17 <sex1712@email.it> Date: Mon, 4 Nov 2019 00:48:05 +0100 Subject: [PATCH 4/8] delete: 0example --- channels/0example.json | 116 ----------------- channels/0example.py | 286 ----------------------------------------- 2 files changed, 402 deletions(-) delete mode 100644 channels/0example.json delete mode 100644 channels/0example.py diff --git a/channels/0example.json b/channels/0example.json deleted file mode 100644 index 783193c6..00000000 --- a/channels/0example.json +++ /dev/null @@ -1,116 +0,0 @@ -Rev:0.2 -Update: 03-10-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. -"not_active": ["include_in_newest"], VA INSERITO nei canali che NON hanno nessuna voce newest. -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", "sub-ita"], - "active": false, - "adult": false, - "thumbnail": "", - "banner": "", - "categories": ["movie", "tvshow", "anime", "vos", "documentary", "adult"], - "not_active": ["include_in_newest"], - "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 deleted file mode 100644 index f418da4a..00000000 --- a/channels/0example.py +++ /dev/null @@ -1,286 +0,0 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------ -# Canale per 'idcanale nel json' -# By: pincopallo! -# Eventuali crediti se vuoi aggiungerli -# ------------------------------------------------------------ -# Rev: 0.2 -# Update 12-10-2019 -# fix: -# 1. aggiunto pagination e sistemate alcune voci -# 2. modificato problemi in eccezioni -# 3. aggiunta la def select -# 4. modifica alla legenda e altre aggiunte - -# Questo vuole solo essere uno scheletro per velocizzare la scrittura di un canale. -# La maggior parte dei canali può essere scritta con il decoratore. -# 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 - -""" - Questi sono commenti per i beta-tester. - - Su questo canale, nella categoria 'Ricerca Globale' - non saranno presenti le voci 'Aggiungi alla Videoteca' - e 'Scarica Film'/'Scarica Serie', dunque, - la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE. - - Novità. Indicare in quale/i sezione/i è presente il canale: - - Nessuna, film, serie, anime... - - Avvisi: - - Eventuali avvisi per i tester - - Ulteriori info: - -""" -# CANCELLARE Ciò CHE NON SERVE per il canale, lascia il codice commentato ove occorre, -# ma fare PULIZIA quando si è finito di testarlo - -# Qui gli import -#import re - -# 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 # per newest -#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' OR __channel__) # <-- ATTENZIONE -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(permUrl, r'<div class="elementor-button-wrapper"> <a href="([^"]+)"') - headers = [['Referer', host]] - -findhost() # così le imposta una volta per tutte -### fine findhost - -# server di esempio... -list_servers = ['supervideo', 'streamcherry','rapidvideo', 'streamango', 'openload'] -# quality di esempio -list_quality = ['default', 'HD', '3D', '4K', 'DVD', 'SD'] - -### fine variabili - -#### Inizio delle def principali ### - -@support.menu -def mainlist(item): - support.log(item) - - # Ordine delle voci - # Voce FILM, puoi solo impostare l'url - film = ['', # url per la voce FILM, se possibile la pagina principale con le ultime novità - #Voce Menu,['url','action','args',contentType] - ('Al Cinema', ['', 'peliculas', '']), - ('Generi', ['', 'genres', 'genres']), - ('Per Lettera', ['', 'genres', 'letters']), - ('Anni', ['', 'genres', 'years']), - ('Qualità', ['', 'genres', 'quality']), - ('Mi sento fortunato', ['', 'genres', 'lucky']), - ('Popolari', ['', 'peliculas', '']), - ('Sub-ITA', ['', 'peliculas', '']) - ] - - # Voce SERIE, puoi solo impostare l'url - tvshow = ['', # url per la voce Serie, se possibile la pagina con titoli di serie - #Voce Menu,['url','action','args',contentType] - ('Novità', ['', '', '']), - ('Per Lettera', ['', 'genres', 'letters']), - ('Per Genere', ['', 'genres', 'genres']), - ('Per anno', ['', 'genres', 'years']) - ] - # Voce ANIME, puoi solo impostare l'url - anime = ['', # url per la voce Anime, se possibile la pagina con titoli di anime - #Voce Menu,['url','action','args',contentType] - ('Novità', ['', '', '']), - ('In Corso',['', '', '', '']), - ('Ultimi Episodi',['', '', '', '']), - ('Ultime Serie',['', '', '', '']) - ] - - """ - Eventuali Menu per voci non contemplate! - """ - - # se questa voce non è presente il menu genera una voce - # search per ogni voce del menu. Es. Cerca Film... - search = '' # se alla funzione search non serve altro - - # VOCE CHE APPARIRA' come prima voce nel menu di KOD! - # [Voce Menu,['url','action','args',contentType] - top = [ '' ['', '', '', '']) - - # Se vuoi creare un menu personalizzato o perchè gli altri non - # ti soddisfano - # [Voce Menu,['url','action','args',contentType] - nome = [( '' ['', '', '', '']) - return locals() - - # Legenda known_keys per i groups nei patron - # known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', - # 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] - # url = link relativo o assoluto alla pagina titolo film/serie - # title = titolo Film/Serie/Anime/Altro - # title2 = titolo dell'episodio Serie/Anime/Altro - # season = stagione in formato numerico - # episode = numero episodio, in formato numerico. - # thumb = linkrealtivo o assoluto alla locandina Film/Serie/Anime/Altro - # quality = qualità indicata del video - # year = anno in formato numerico (4 cifre) - # duration = durata del Film/Serie/Anime/Altro - # genere = genere del Film/Serie/Anime/Altro. Es: avventura, commedia - # rating = punteggio/voto in formato numerico - # type = tipo del video. Es. movie per film o tvshow per le serie. Di solito sono discrimanti usati dal sito - # lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA. - # AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!! - - -@support.scrape -def peliculas(item): - support.log(item) - #support.dbg() # decommentare per attivare web_pdb - - action = '' - blacklist = [''] - patron = r'' - patronBlock = r'' - patronNext = '' - pagination = '' - - #debug = True # True per testare le regex sul sito - return locals() - -@support.scrape -def episodios(item): - support.log(item) - #support.dbg() - - action = '' - blacklist = [''] - patron = r'' - patronBlock = r'' - patronNext = '' - pagination = '' - - #debug = True - return locals() - -# Questa def è utilizzata per generare i menu del canale -# per genere, per anno, per lettera, per qualità ecc ecc -@support.scrape -def genres(item): - support.log(item) - #support.dbg() - - action = '' - blacklist = [''] - patron = r'' - patronBlock = r'' - patronNext = '' - pagination = '' - - #debug = True - return locals() - -############## Fine ordine obbligato -## Def ulteriori - -# per quei casi dove il sito non differenzia film e/o serie e/o anime -# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro -# andranno modificate anche le def peliculas e episodios ove occorre -def select(item): - support.log('select --->', item) - #support.dbg() - data = httptools.downloadpage(item.url, headers=headers).data - # pulizia di data, in caso commentare le prossime 2 righe - data = re.sub('\n|\t', ' ', data) - data = re.sub(r'>\s+<', '> <', data) - block = scrapertoolsV2.find_single_match(data, r'') - if re.findall('', data, re.IGNORECASE): - support.log('select = ### è una serie ###') - return episodios(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - url=item.url, - args='serie', - contentType='tvshow', - #data1 = data decommentando portiamo data nella def senza doverla riscaricare - )) - -############## Fondo Pagina -# da adattare al canale -def search(item, text): - support.log('search', item) - itemlist = [] - text = text.replace(' ', '+') - item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) - # bisogna inserire item.contentType per la ricerca globale - # se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare. - item.contentType = item.contentType - try: - return peliculas(item) - # Se captura la excepcion, para no interrumpir al buscador global si un canal falla - except: - import sys - for line in sys.exc_info(): - log('search log:', line) - return [] - - -# da adattare al canale -# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte -# altrimenti NON inserirlo -def newest(categoria): - support.log('newest ->', categoria) - itemlist = [] - item = Item() - try: - if categoria == 'peliculas': - item.url = host - item.action = 'peliculas' - itemlist = peliculas(item) - - if itemlist[-1].action == 'peliculas': - itemlist.pop() - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.log('newest log: ', {0}.format(line)) - return [] - - return itemlist - -# da adattare... -# consultare il wiki sia per support.server che ha vari parametri, -# sia per i siti con hdpass -#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True) -def findvideos(item): - support.log('findvideos ->', item) - return support.server(item, headers=headers) From 6f183b83d90f62339fac1e98196e4abfc7d0c117 Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Mon, 4 Nov 2019 12:04:49 +0100 Subject: [PATCH 5/8] Thumb e Banner: Casa Cinema Il Genio dello streaming Cinemalibero Mondo Serie TV --- channels/casacinema.json | 4 ++-- channels/cinemalibero.json | 4 ++-- channels/ilgeniodellostreaming.json | 6 +++--- channels/mondoserietv.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/channels/casacinema.json b/channels/casacinema.json index 8f092063..4532df5d 100644 --- a/channels/casacinema.json +++ b/channels/casacinema.json @@ -4,8 +4,8 @@ "language": ["ita", "sub-ita"], "active": true, "adult": false, - "thumbnail": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/casacinema.png", - "banner": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/casacinema.png", + "thumbnail": "casacinema.png", + "banner": "casacinema.png", "categories": ["tvshow", "movie","vos"], "settings": [ ] diff --git a/channels/cinemalibero.json b/channels/cinemalibero.json index acf7781a..820ef7bb 100644 --- a/channels/cinemalibero.json +++ b/channels/cinemalibero.json @@ -4,8 +4,8 @@ "language": ["ita"], "active": true, "adult": false, - "thumbnail": "https://www.cinemalibero.center/wp-content/themes/Cinemalibero%202.0/images/logo02.png", - "banner": "https://www.cinemalibero.center/wp-content/themes/Cinemalibero%202.0/images/logo02.png", + "thumbnail": "cinemalibero.png", + "banner": "cinemalibero.png", "categories": ["movie","tvshow","anime"], "not_active": ["include_in_newest"], "settings": [] diff --git a/channels/ilgeniodellostreaming.json b/channels/ilgeniodellostreaming.json index 49426164..960aaabe 100644 --- a/channels/ilgeniodellostreaming.json +++ b/channels/ilgeniodellostreaming.json @@ -3,9 +3,9 @@ "name": "IlGenioDelloStreaming", "active": true, "adult": false, - "language": ["ita", "vos"], - "thumbnail": "https://i.imgur.com/Nsa81r0.png", - "banner": "https://i.imgur.com/Nsa81r0.png", + "language": ["ita", "sub-ita"], + "thumbnail": "ilgeniodellostreaming.png", + "banner": "ilgeniodellostreaming.png", "categories": ["movie", "tvshow", "anime", "vos"], "settings": [] } diff --git a/channels/mondoserietv.json b/channels/mondoserietv.json index 2f1a428e..3bd6ab63 100644 --- a/channels/mondoserietv.json +++ b/channels/mondoserietv.json @@ -4,8 +4,8 @@ "active": true, "adult": false, "language": ["ita"], - "thumbnail": "https:\/\/mondoserietv.com\/wp-content\/uploads\/2018\/04\/logo.png", - "bannermenu": "https:\/\/mondoserietv.com\/wp-content\/uploads\/2018\/04\/logo.png", + "thumbnail": "mondoserietv.png", + "bannermenu": "mondoserietv.png", "categories": ["movie","anime","tvshow","documentary"], "not_active":["include_in_newest_anime","include_in_newest_documentary"], "settings": [] From 7ee9c45326c7d1f11adbab13531f2cbd53f5c3fe Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Mon, 4 Nov 2019 12:13:39 +0100 Subject: [PATCH 6/8] Rimossi colori --- platformcode/platformtools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 483c9506..282d7029 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -549,7 +549,7 @@ def set_context_commands(item, parent_item): from_action=item.action).tourl()))) # Añadir a Alfavoritos (Mis enlaces) if item.channel not in ["favorites", "videolibrary", "help", ""] and parent_item.channel != "favorites": - context_commands.append(('[COLOR blue]%s[/COLOR]' % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" % + context_commands.append(("[B]%s[/B]" % config.get_localized_string(70557), "XBMC.RunPlugin(%s?%s)" % (sys.argv[0], item.clone(channel="kodfavorites", action="addFavourite", from_channel=item.channel, from_action=item.action).tourl()))) @@ -571,7 +571,7 @@ def set_context_commands(item, parent_item): mediatype = 'tv' else: mediatype = item.contentType - context_commands.append(("[COLOR yellow]%s[/COLOR]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % ( + context_commands.append(("[B]%s[/B]" % config.get_localized_string(70561), "XBMC.Container.Update (%s?%s)" % ( sys.argv[0], item.clone(channel='search', action='discover_list', search_type='list', page='1', list_type='%s/%s/similar' % (mediatype,item.infoLabels['tmdb_id'])).tourl()))) From c20c73bb968dd034bf160ced0034ca82a8865524 Mon Sep 17 00:00:00 2001 From: greko17 <sex1712@email.it> Date: Mon, 4 Nov 2019 14:44:33 +0100 Subject: [PATCH 7/8] fix: core/channeltools.py ripristinato pulsante tutti/nessuno... --- core/channeltools.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/channeltools.py b/core/channeltools.py index e54eb43d..254d2ed9 100644 --- a/core/channeltools.py +++ b/core/channeltools.py @@ -375,8 +375,6 @@ def set_channel_setting(name, value, channel): except EnvironmentError: logger.error("ERROR al leer el archivo: %s" % file_settings) - dict_settings[name] = value - # delete unused Settings def_keys = [] del_keys = [] @@ -388,11 +386,12 @@ def set_channel_setting(name, value, channel): for key in del_keys: del dict_settings[key] + dict_settings[name] = value + # comprobamos si existe dict_file y es un diccionario, sino lo creamos if dict_file is None or not dict_file: dict_file = {} - dict_file['settings'] = dict_settings # Creamos el archivo ../settings/channel_data.json From b444b07d68c31cbe28f7d177cca28d3b8ea48724 Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Mon, 4 Nov 2019 19:20:08 +0100 Subject: [PATCH 8/8] =?UTF-8?q?Fix=20per=20Ricerca=20e=20Novit=C3=A0=20per?= =?UTF-8?q?=20Sub-ITA=20con=20selezione=20auto=20o=20ita=20in=20impostazio?= =?UTF-8?q?ni?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- specials/news.py | 4 ++-- specials/search.py | 4 ++-- specials/searchall.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/specials/news.py b/specials/news.py index 38ecb05c..f1274853 100644 --- a/specials/news.py +++ b/specials/news.py @@ -149,7 +149,7 @@ def get_channels_list(): continue # No incluir si el canal es en un idioma filtrado - if channel_language != "all" and channel_language not in channel_parameters["language"] \ + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ and "*" not in channel_parameters["language"]: continue @@ -624,7 +624,7 @@ def setting_channel(item): continue # No incluir si el canal es en un idioma filtrado - if channel_language != "all" and channel_language not in channel_parameters["language"] \ + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ and "*" not in channel_parameters["language"]: continue diff --git a/specials/search.py b/specials/search.py index a4f19373..196614f4 100644 --- a/specials/search.py +++ b/specials/search.py @@ -256,7 +256,7 @@ def setting_channel_old(item): continue # No incluir si el canal es en un idioma filtrado - if channel_language != "all" and channel_language not in channel_parameters["language"] \ + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ and "*" not in channel_parameters["language"]: continue @@ -524,7 +524,7 @@ def do_search(item, categories=None): continue # No busca si el canal es en un idioma filtrado - if channel_language != "all" and channel_language not in channel_parameters["language"] \ + if channel_language != "all" and channel_language not in str(channel_parameters["language"]) \ and "*" not in channel_parameters["language"]: logger.info("%s -idioma no válido-" % basename_without_extension) continue diff --git a/specials/searchall.py b/specials/searchall.py index de795570..fa3db25f 100644 --- a/specials/searchall.py +++ b/specials/searchall.py @@ -705,7 +705,7 @@ def do_channels_search(item): continue # No busca si el canal es en un idioma filtrado - if channel_language != "all" and channel_parameters["language"] != channel_language: + if channel_language != "all" and channel_language not in str(channel_parameters["language"]): continue # No busca si es un canal excluido de la busqueda global