From 4c473d5f9af15c4cdb11930b9e6da1096b51e5c3 Mon Sep 17 00:00:00 2001 From: mac12m99 Date: Sat, 26 Oct 2019 14:31:16 +0200 Subject: [PATCH] =?UTF-8?q?fix=20cb01=20(novit=C3=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels/cineblog01.py | 38 ++++++++++++++++++++++++++------------ core/support.py | 17 ----------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index 028bb818..289df775 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -33,11 +33,6 @@ list_quality = ['HD', 'SD', 'default'] checklinks = config.get_setting('checklinks', 'cineblog01') checklinks_number = config.get_setting('checklinks_number', 'cineblog01') -# esclusione degli articoli 'di servizio' -blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', - 'Aggiornamento Quotidiano Serie TV', 'OSCAR 2019 ▶ CB01.UNO: Vota il tuo film preferito! 🎬', - 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?'] - @support.menu def mainlist(item): @@ -46,12 +41,13 @@ def mainlist(item): ('HD', ['', 'menu', 'Film HD Streaming']), ('Generi', ['', 'menu', 'Film per Genere']), ('Anni', ['', 'menu', 'Film per Anno']), - ('Ultimi aggiornati', ['/lista-film-ultimi-100-film-aggiornati/', 'newest', 'aggiornati']) + ('Ultimi aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'newest']) ] tvshow = ['/serietv/', ('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']), ('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']), - ('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']) + ('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']), + ('Aggiornamento quotidiano', ['/serietv/aggiornamento-quotidiano-serie-tv/', 'newest']) ] return locals() @@ -70,16 +66,29 @@ def menu(item): @support.scrape def newest(categoria): findhost() + # debug = True + patron = r']+)"?>(?P[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N|SUB-ITA)\])?\s*(?:\[(?P<quality>HD|SD|HD/3D)\])?\s*\((?P<year>[0-9]{4})\)<\/a>' + if type(categoria) != Item: item = Item() + else: + item = categoria + categoria = 'series' if item.contentType != 'movie' else 'movie' + pagination = 20 + + if categoria == 'series': + item.contentType = 'tvshow' + action = 'episodios' + item.url = host + 'serietv/aggiornamento-quotidiano-serie-tv/' + patronBlock = r'<article class="sequex-post-content">(?P<block>.*?)</article>' + patron = '<a href="(?P<url>[^"]+)".*?>(?P<title>[^<([|]+).*?(?P<lang>ITA|SUB-ITA)?</a' + else: item.contentType = 'movie' item.url = host + '/lista-film-ultimi-100-film-aggiunti/' patronBlock = r'Ultimi 100 film aggiunti:(?P<block>.*?)<\/td>' - else: - patronBlock = r'Ultimi 100 film Aggiornati:(?P<block>.*?)<\/td>' - item = categoria - patron = r'<a href="(?P<url>[^"]+)"\s*>(?P<title>[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N)\])?\s?(?:\[(?P<quality>HD|SD|HD/3D)\])?\s?\((?P<year>[0-9]{4})\)<\/a>' - pagination = 20 + # else: + # patronBlock = r'Ultimi 100 film Aggiornati:(?P<block>.*?)<\/td>' + # item = categoria return locals() @@ -101,6 +110,11 @@ def search(item, text): @support.scrape def peliculas(item): + # esclusione degli articoli 'di servizio' + blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', + 'Aggiornamento Quotidiano Serie TV', 'OSCAR 2019 ▶ CB01.UNO: Vota il tuo film preferito! 🎬', + 'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?'] + if '/serietv/' not in item.url: patron = r'<div class="?card-image"?>.*?<img src="?(?P<thumb>[^" ]+)"? alt.*?<a href="?(?P<url>[^" >]+)(?:\/|")>(?P<title>[^<[(]+)(?:\[(?P<quality>[A-Za-z0-9/-]+)])? (?:\((?P<year>[0-9]{4})\))?.*?<strong>(?P<genre>[^<>&–]+).*?DURATA (?P<duration>[0-9]+).*?<br(?: /)?>(?P<plot>[^<>]+)' action = 'findvideos' diff --git a/core/support.py b/core/support.py index 80d56ab2..093d528f 100644 --- a/core/support.py +++ b/core/support.py @@ -398,8 +398,6 @@ def scrape(func): itemlist, matches = scrapeBlock(item, args, data, patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function, lang) - checkHost(item, itemlist) - if 'itemlistHook' in args: itemlist = args['itemlistHook'](itemlist) @@ -450,21 +448,6 @@ def scrape(func): return wrapper -def checkHost(item, itemlist): - # nel caso non ci siano risultati puo essere che l'utente abbia cambiato manualmente l'host, pertanto lo riporta - # al valore di default (fixa anche il problema del cambio di host da parte nostra) - if len(itemlist) == 0: - # trovo il valore di default - defHost = None - for s in channeltools.get_channel_json(item.channel)['settings']: - if s['id'] == 'channel_host': - defHost = s['default'] - break - # lo confronto con quello attuale - if config.get_setting('channel_host', item.channel) != defHost: - config.set_setting('channel_host', defHost, item.channel) - - def dooplay_get_links(item, host): # get links from websites using dooplay theme and dooplay_player # return a list of dict containing these values: url, title and server