From 3cd606ff24981f38d49d51a23510d80b66bcad46 Mon Sep 17 00:00:00 2001 From: greko17 Date: Sun, 3 Nov 2019 10:43:31 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20serietvu.py=20canale=20terminato,=20da?= =?UTF-8?q?=20testare=20fix:=20toonitalia,=20uscivano=20risultati=20in=20n?= =?UTF-8?q?ovit=C3=A0=20->=20serie=20fix:=20news,=20commentati=20log,=20tr?= =?UTF-8?q?aduzione=20voci=20fix:=20serietvonline,=20pulizia=20codice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels/serietvonline.py | 4 +- channels/serietvu.json | 66 +------- channels/serietvu.py | 336 ++++++++++---------------------------- channels/toonitalia.json | 8 +- channels/toonitalia.py | 9 +- specials/news.py | 6 +- 6 files changed, 103 insertions(+), 326 deletions(-) diff --git a/channels/serietvonline.py b/channels/serietvonline.py index 02125027..8c090a34 100644 --- a/channels/serietvonline.py +++ b/channels/serietvonline.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ -# Canale per serietvonline +# Canale per serietvonline.py # ---------------------------------------------------------- """ @@ -191,7 +191,7 @@ def findvideos(item): data = httptools.downloadpage(item.url, headers=headers).data data = re.sub('\n|\t', ' ', data) data = re.sub(r'>\s+<', '> <', data) - support.log("DATA - HTML:\n", data) + #support.log("DATA - HTML:\n", data) url_video = scrapertoolsV2.find_single_match(data, r'(.+?)', -1) url_serie = scrapertoolsV2.find_single_match(data, r'') goseries = support.typo("Vai alla Serie:", ' bold') diff --git a/channels/serietvu.json b/channels/serietvu.json index abb5dbd5..929dcc5b 100644 --- a/channels/serietvu.json +++ b/channels/serietvu.json @@ -3,68 +3,10 @@ "name": "SerieTVU", "active": true, "adult": false, - "language": ["ita"], + "language": ["ita", "sub-ita"], "thumbnail": "serietvu.png", "banner": "serietvu.png", - "categories": ["tvshow"], - "settings": [ - { - "id": "channel_host", - "type": "text", - "label": "Host del canale", - "default": "https://www.serietvu.club", - "enabled": true, - "visible": true - }, - { - "id": "include_in_global_search", - "type": "bool", - "label": "Includi ricerca globale", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_series", - "type": "bool", - "label": "Includi in Novità - Serie TV", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_italiano", - "type": "bool", - "label": "Includi in Novità - Italiano", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "checklinks", - "type": "bool", - "label": "Verifica se i link esistono", - "default": false, - "enabled": true, - "visible": true - }, - { - "id": "checklinks_number", - "type": "list", - "label": "Numero de link da verificare", - "default": 1, - "enabled": true, - "visible": "eq(-1,true)", - "lvalues": [ "1", "3", "5", "10" ] - }, - { - "id": "filter_languages", - "type": "list", - "label": "Mostra link in lingua...", - "default": 0, - "enabled": true, - "visible": true, - "lvalues": ["Non filtrare","IT"] - } - ] + "categories": ["tvshow", "vos"], + "not_active": ["include_in_newest_peliculas", "include_in_newest_anime"], + "settings": [] } diff --git a/channels/serietvu.py b/channels/serietvu.py index 5c8c7b34..4dc8ee17 100644 --- a/channels/serietvu.py +++ b/channels/serietvu.py @@ -1,28 +1,22 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ -# Canale per SerieTVU -# Thanks to Icarus crew & Alfa addon & 4l3x87 +# Canale per serietvu.py # ---------------------------------------------------------- """ - Trasformate le sole def per support.menu e support.scrape - da non inviare nel test. - Test solo a trasformazione completa - + La pagina novità contiene al max 25 titoli """ import re -from core import tmdb, scrapertools, support +from core import support, httptools, scrapertoolsV2 from core.item import Item from core.support import log -from platformcode import config, logger +from platformcode import config __channel__ = 'serietvu' host = config.get_channel_url(__channel__) headers = [['Referer', host]] -IDIOMAS = {'Italiano': 'IT'} -list_language = IDIOMAS.values() list_servers = ['speedvideo'] list_quality = ['default'] @@ -30,235 +24,74 @@ list_quality = ['default'] @support.menu def mainlist(item): log() + tvshow = ['/category/serie-tv', - ('Novità', ['/ultimi-episodi', 'latestep']), - ('Categorie', ['', 'categorie']) + ('Novità', ['/ultimi-episodi/', 'peliculas', 'update']), + ('Generi', ['', 'genres', 'genres']) ] return locals() -# ---------------------------------------------------------------------------------------------------------------- -def cleantitle(scrapedtitle): - log() - scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip()) - scrapedtitle = scrapedtitle.replace('[HD]', '').replace('’', '\'').replace('– Il Trono di Spade', '').replace( - 'Flash 2014', 'Flash').replace('"', "'") - year = scrapertools.find_single_match(scrapedtitle, '\((\d{4})\)') - if year: - scrapedtitle = scrapedtitle.replace('(' + year + ')', '') - - return scrapedtitle.strip() - - -# ================================================================================================================ - -# ---------------------------------------------------------------------------------------------------------------- +@support.scrape def peliculas(item): log() - itemlist = [] - patron = r'
\s*' - patron += r'[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<' - matches, data = support.match(item, patron, headers=headers) + patronBlock = r'
\s+.*?(?P.*?)