diff --git a/channels/altadefinizione01_link.json b/channels/altadefinizione01_link.json index a60ab421..4e6c491b 100644 --- a/channels/altadefinizione01_link.json +++ b/channels/altadefinizione01_link.json @@ -10,7 +10,8 @@ "fix" : "reimpostato url e modificato file per KOD", "change_date": "2019-30-04", "categories": [ - "movie" + "movie", + "vosi" ], "settings": [ { @@ -79,7 +80,8 @@ "visible": true, "lvalues": [ "Non filtrare", - "IT" + "ITA", + "vosi" ] }, { diff --git a/channels/altadefinizione01_link.py b/channels/altadefinizione01_link.py index a779c9bc..b46e87b6 100644 --- a/channels/altadefinizione01_link.py +++ b/channels/altadefinizione01_link.py @@ -1,9 +1,6 @@ # -*- coding: utf-8 -*- # -*- Channel Altadefinizione01L Film - Serie -*- -# -*- Creato per Alfa-addon -*- -# -*- e adattato for KOD -*- # -*- By Greko -*- -# -*- last change: 26/05/2019 import channelselector from specials import autoplay @@ -18,10 +15,7 @@ __channel__ = "altadefinizione01_link" list_servers = ['supervideo', 'streamcherry','rapidvideo', 'streamango', 'openload'] list_quality = ['default'] -#host = config.get_setting("channel_host", __channel__) -host = config.get_channel_url(__channel__) -checklinks = config.get_setting('checklinks', __channel__) -checklinks_number = config.get_setting('checklinks_number', __channel__) +host = config.get_setting("channel_host", __channel__) headers = [['Referer', host]] # =========== home menu =================== @@ -156,7 +150,5 @@ def findvideos(item): # Requerido para AutoPlay autoplay.start(itemlist, item) - - support.videolibrary(itemlist, item, 'color kod') return itemlist diff --git a/channels/eurostreaming.json b/channels/eurostreaming.json index 07ad271e..c78f0e87 100644 --- a/channels/eurostreaming.json +++ b/channels/eurostreaming.json @@ -6,8 +6,16 @@ "language": ["ita"], "thumbnail": "https://eurostreaming.cafe/wp-content/uploads/2017/08/logocafe.png", "bannermenu": "https://eurostreaming.cafe/wp-content/uploads/2017/08/logocafe.png", - "categories": ["tvshow","anime"], + "categories": ["tvshow","anime","vosi"], "settings": [ + { + "id": "channel_host", + "type": "text", + "label": "Host del canale", + "default": "https://eurostreaming.cafe/", + "enabled": true, + "visible": true + }, { "id": "include_in_global_search", "type": "bool", @@ -16,14 +24,6 @@ "enabled": true, "visible": true }, - { - "id": "modo_grafico", - "type": "bool", - "label": "Cerca informazioni extra", - "default": true, - "enabled": true, - "visible": true - }, { "id": "include_in_newest_series", "type": "bool", @@ -39,23 +39,6 @@ "default": true, "enabled": true, "visible": true - }, - { - "id": "checklinks", - "type": "bool", - "label": "Verifica se i link esistono", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "checklinks_number", - "type": "list", - "label": "Numero de link da verificare", - "default": 1, - "enabled": true, - "visible": "eq(-1,true)", - "lvalues": [ "5", "10", "15", "20" ] }, { "id": "filter_languages", @@ -66,25 +49,9 @@ "visible": true, "lvalues": [ "Non filtrare", - "Italiano", + "ITA", "vosi" ] - }, - { - "id": "perfil", - "type": "list", - "label": "profilo dei colori", - "default": 0, - "enabled": true, - "visible": true, - "lvalues": [ - "Sin color", - "Perfil 5", - "Perfil 4", - "Perfil 3", - "Perfil 2", - "Perfil 1" - ] } ] } diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index 224e6cd8..8f4d39b9 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -1,62 +1,76 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ # Canale per Eurostreaming -# adattamento di Cineblog01 # by Greko # ------------------------------------------------------------ """ Riscritto per poter usufruire del modulo support. Problemi noti: - Alcun regex possono migliorare + Le regex non prendono tutto... server versystream : 'http://vcrypt.net/very/' # VeryS non decodifica il link :http://vcrypt.net/fastshield/ - server nowvideo.club da implementare nella cartella servers, altri server nei meandri del sito?! - Alcune sezioni di anime-cartoni non vanno, alcune hanno solo la lista degli episodi, ma non hanno link - altre cambiano la struttura - La sezione novità non fa apparire il titolo degli episodi + alcuni server tra cui nowvideo.club non sono implementati nella cartella servers + Alcune sezioni di anime-cartoni non vanno: + - alcune hanno solo la lista degli episodi, ma non hanno link + - altre cambiano la struttura + La sezione novità di KOD non fa apparire il titolo degli episodi + + In episodios è stata aggiunta la possibilità di configurare la videoteca + """ -import re - -from core import scrapertoolsV2, httptools, tmdb, support +import channelselector +from specials import autoplay, filtertools +from core import scrapertoolsV2, httptools, servertools, tmdb, support from core.item import Item from platformcode import logger, config -from specials import autoplay -host = "https://eurostreaming.cafe/" +__channel__ = "eurostreaming" + +host = config.get_setting("channel_host", __channel__) headers = ['Referer', host] -IDIOMAS = {'Italiano': 'IT'} -list_language = IDIOMAS.values() -list_servers = ['verystream', 'wstream', 'speedvideo', 'flashx', 'nowvideo', 'streamango', 'deltabit', 'openload'] +list_servers = ['verystream', 'wstream', 'speedvideo', 'flashx', 'nowvideo', 'streamango', 'deltabit', 'nowvideo', 'turbovid', 'openload'] list_quality = ['default'] -checklinks = config.get_setting('checklinks', 'eurostreaming') -checklinks_number = config.get_setting('checklinks_number', 'eurostreaming') +IDIOMAS = {'Italiano': 'ITA', 'vosi':'Sub-ITA'} +list_language = IDIOMAS.values() def mainlist(item): + #import web_pdb; web_pdb.set_trace() support.log() itemlist = [] - support.menu(itemlist, 'Serie TV', 'serietv', host, 'episode') # mettere sempre episode per serietv, anime!! - support.menu(itemlist, 'Serie TV Archivio submenu', 'serietv', host + "category/serie-tv-archive/", 'episode') - support.menu(itemlist, 'Ultimi Aggiornamenti submenu', 'serietv', host + 'aggiornamento-episodi/', 'episode', args='True') - support.menu(itemlist, 'Anime / Cartoni', 'serietv', host + 'category/anime-cartoni-animati/', 'episode') - support.menu(itemlist, 'Cerca...', 'search', host, 'episode') + support.menu(itemlist, 'Serie TV', 'serietv', host, contentType = 'episode') # mettere sempre episode per serietv, anime!! + support.menu(itemlist, 'Serie TV Archivio submenu', 'serietv', host + "category/serie-tv-archive/", contentType = 'episode') + support.menu(itemlist, 'Ultimi Aggiornamenti submenu', 'serietv', host + 'aggiornamento-episodi/', args='True', contentType = 'episode') + support.menu(itemlist, 'Anime / Cartoni', 'serietv', host + 'category/anime-cartoni-animati/', contentType = 'episode') + support.menu(itemlist, 'Cerca...', 'search', host, contentType = 'episode') +## itemlist = filtertools.show_option(itemlist, item.channel, list_language, list_quality) # richiesto per autoplay autoplay.init(item.channel, list_servers, list_quality) autoplay.show_option(item.channel, itemlist) + 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 - -def serietv(item): +def serietv(item): + #import web_pdb; web_pdb.set_trace() + # lista serie tv support.log() itemlist = [] if item.args: # il titolo degli episodi viene inglobato in episode ma non sono visibili in newest!!! patron = r'(.*?).[^–](.*?)<\/a>' - listGroups = ['title', 'url', 'title2'] + listGroups = ['title', 'url', 'episode'] patronNext = '' else: patron = r'
.*?\s(.*?(?:\((\d{4})\)|(\d{4}))?)<\/a><\/h2>' @@ -64,69 +78,67 @@ def serietv(item): patronNext='a class="next page-numbers" href="?([^>"]+)">Avanti »' itemlist = support.scrape(item, patron_block='', patron=patron, listGroups=listGroups, - patronNext=patronNext, - action='episodios') + patronNext=patronNext, action='episodios') return itemlist + def episodios(item): - support.log() +## import web_pdb; web_pdb.set_trace() + support.log("episodios") itemlist = [] - + # Carica la pagina data = httptools.downloadpage(item.url).data #======== if 'clicca qui per aprire' in data.lower(): - item.url = scrapertoolsV2.find_single_match(data, '"go_to":"(.*?)"') + item.url = scrapertoolsV2.find_single_match(data, '"go_to":"([^"]+)"') item.url = item.url.replace("\\","") # Carica la pagina data = httptools.downloadpage(item.url).data elif 'clicca qui' in data.lower(): - item.url = scrapertoolsV2.find_single_match(data, '

') + item.url = scrapertoolsV2.find_single_match(data, '

') # Carica la pagina data = httptools.downloadpage(item.url).data #========= + patron = r'(?:<\/span>\w+ STAGIONE\s\d+ (?:\()?(ITA|SUB ITA)(?:\))?<\/div>'\ + '

') - for match in matches: - blocks = scrapertoolsV2.find_multiple_matches(match, r'(?:(\d×[a-zA-Z0-9].*?))
') - season_lang = scrapertoolsV2.find_single_match(match, r'<\/span>.*?STAGIONE\s+\d+\s\(([^<>]+)\)').strip() + # Permette la configurazione della videoteca senza andare nel menu apposito + # così si possono Attivare/Disattivare le impostazioni direttamente dalla + # pagina delle puntate + itemlist.append( + Item(channel='setting', + action="channel_config", + title=support.typo("Configurazione Videoteca color lime"), + plot = 'Filtra per lingua utilizzando la configurazione della videoteca.\ + Escludi i video in sub attivando "Escludi streams... " e aggiungendo sub in Parole', + config='videolibrary', + folder=False, + thumbnail=channelselector.get_thumb('setting_0.png') + )) - logger.info("blocks log: %s" % ( blocks )) - for block in blocks: - season_n, episode_n = scrapertoolsV2.find_single_match(block, r'(\d+)(?:×|×)(\d+)') - titolo = scrapertoolsV2.find_single_match(block, r'[&#;]\d+[ ]([a-zA-Z0-9;&#.\s]+)[ ]?[^<>]') - logger.info("block log: %s" % ( block )) - - titolo = re.sub(r'×|×', "x", titolo).replace("’","'") - item.infoLabels['season'] = season_n # permette di vedere il plot della stagione e... - item.infoLabels['episode'] = episode_n # permette di vedere il plot della puntata e... - - itemlist.append( - Item(channel=item.channel, - action="findvideos", - contentType=item.contentType, - title="[B]" + season_n + "x" + episode_n + " " + titolo + "[/B] " + season_lang, - fulltitle=item.title, # Titolo nel video - show=titolo + ":" + season_n + "x" + episode_n, # sottotitoletto nel video - url=block, - extra=item.extra, - thumbnail=item.thumbnail, - infoLabels=item.infoLabels - )) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + itemlist = filtertools.get_links(itemlist, item, list_language) - support.videolibrary(itemlist, item) - return itemlist +# =========== def findvideos ============= + +def findvideos(item): + support.log() + itemlist =[] + + itemlist = support.server(item, item.url) + + return itemlist # =========== def ricerca ============= def search(item, texto): support.log() item.url = "%s?s=%s" % (host, texto) - try: return serietv(item) # Continua la ricerca in caso di errore @@ -141,8 +153,9 @@ def newest(categoria): support.log() itemlist = [] item = Item() - try: - item.args= 'True' + item.contentType= 'episode' + item.args= 'True' + try: item.url = "%saggiornamento-episodi/" % host item.action = "serietv" itemlist = serietv(item) @@ -159,10 +172,5 @@ def newest(categoria): return itemlist -def findvideos(item): - support.log() - itemlist =[] - - itemlist = support.server(item, item.url) - - return itemlist +def paginator(item): + pass diff --git a/core/support.py b/core/support.py index eaec9e51..8bba39ba 100644 --- a/core/support.py +++ b/core/support.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# ----------------------------------------------------------- # support functions that are needed by many channels, to no repeat the same code import base64 import inspect @@ -145,6 +147,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" log('MATCHES =', matches) known_keys = ['url', 'title', 'title2', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang'] #by greko aggiunto episode + lang = '' # aggiunto per gestire i siti con pagine di serietv dove si hanno i video in ita e in subita for match in matches: if len(listGroups) > len(match): # to fix a bug @@ -158,22 +161,27 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" val = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + val scraped[kk] = val - title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).replace('"', "'").strip() # fix by greko da " a ' + title = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["title"])).replace('’', '\'').replace('"', "'").strip() # fix by greko da " a ' plot = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["plot"])) longtitle = typo(title, 'bold') if scraped['quality']: longtitle = longtitle + typo(scraped['quality'], '_ [] color kod') if scraped['episode']: - scraped['episode'] = re.sub(r'\s-\s|-|x|–', 'x' , scraped['episode']) + scraped['episode'] = re.sub(r'\s-\s|-|x|–', 'x' , scraped['episode']).replace('’', '\'').replace('"', "'") longtitle = typo(scraped['episode'] + ' - ', 'bold') + longtitle if scraped['title2']: title2 = scrapertoolsV2.decodeHtmlentities(scraped["title2"]).replace('"', "'").strip() longtitle = longtitle + typo(title2, 'bold _ -- _') - if scraped["lang"]: - if 'sub' in scraped["lang"].lower(): + + + ## Aggiunto/modificato per gestire i siti che hanno i video + ## in ita e subita delle serie tv nella stessa pagina + if scraped['lang']: + if 'sub' in scraped['lang'].lower(): lang = 'Sub-ITA' else: - lang = 'ITA' + lang = 'ITA' + if lang != '': longtitle += typo(lang, '_ [] color kod') if item.infoLabels["title"] or item.fulltitle: # if title is set, probably this is a list of episodes or video sources @@ -214,6 +222,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" title=longtitle, fulltitle=title, show=title, + language = 'ITA' if lang =='' else lang, quality=scraped["quality"], url=scraped["url"], infoLabels=infolabels,