From 930fe4517cff4fa587ed456cbfbec3f13ffc3255 Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 16 Dec 2019 20:24:03 +0100 Subject: [PATCH] tantifilm: patch per velocizzare ricerca --- channels/tantifilm.py | 100 +++++++++++++++++++-------------------- platformcode/launcher.py | 13 +---- 2 files changed, 52 insertions(+), 61 deletions(-) diff --git a/channels/tantifilm.py b/channels/tantifilm.py index 226334e7..92929123 100644 --- a/channels/tantifilm.py +++ b/channels/tantifilm.py @@ -75,30 +75,6 @@ def peliculas(item): if item.args != 'all' and item.args != 'search': action = 'findvideos' if item.extra == 'movie' else 'episodios' item.contentType = 'movie' if item.extra == 'movie' else 'tvshow' - else: - def itemHook(item): - item.action = 'episodios' - item.contentType = 'tvshow' - data = httptools.downloadpage(item.url, headers=headers).data - data = re.sub('\n|\t', ' ', data) - data = re.sub(r'>\s+<', '> <', data) - check = scrapertoolsV2.find_single_match(data, r'
\s+

\s+(.*?)\s+

\s+
') - if 'sub' in check.lower(): - item.contentLanguage = 'Sub-ITA' - item.title += support.typo('Sub-ITA', '_ [] color kod') - support.log("CHECK : ", check) - if 'anime' in check.lower(): - support.log('select = ### è una anime ###') - item.action = 'episodios' - anime = True - args='anime' - elif 'serie' in check.lower(): - pass - else: - support.log('select ELSE = ### è un film ###') - item.action = 'findvideos' - item.contentType='movie' - return item #debug = True return locals() @@ -107,30 +83,38 @@ def peliculas(item): def episodios(item): log() findhost() - - data_check = httptools.downloadpage(item.url, headers=headers).data - data_check = re.sub('\n|\t', ' ', data_check) - data_check = re.sub(r'>\s+<', '> <', data_check) + if not item.data: + data_check = httptools.downloadpage(item.url, headers=headers).data + data_check = re.sub('\n|\t', ' ', data_check) + data_check = re.sub(r'>\s+<', '> <', data_check) + else: + data_check = item.data patron_check = r'