From cdf84d5573a0f820f03730967d0c374cae60f84a Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 1 May 2020 23:51:55 +0200 Subject: [PATCH] migliorie piratestreaming e tantifilm --- channels/piratestreaming.py | 14 ++++++-------- channels/tantifilm.py | 6 ++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/channels/piratestreaming.py b/channels/piratestreaming.py index 5ea6909a..23f5a94f 100644 --- a/channels/piratestreaming.py +++ b/channels/piratestreaming.py @@ -67,14 +67,12 @@ def newest(categoria): @support.scrape def peliculas(item): - patron = r'data-placement="bottom" title="(?P[^"]+)" alt=[^=]+="(?P<url>[^"]+)"> <img class="[^"]+" title="[^"]+" alt="[^"]+" src="(?P<thumb>[^"]+)"' + patron = r'data-placement="bottom" title="(?P<title>[^"]+)" alt=[^=]+="(?P<url>[^"]+)"> <img class="[^"]+" title="[^"]+(?P<type>film|serie)[^"]+" alt="[^"]+" src="(?P<thumb>[^"]+)"' patronNext = r'<a\s*class="nextpostslink" rel="next" href="([^"]+)">Avanti' - def itemHook(item): - item.thumbnail = item.thumbnail.replace('locandina-film-small','locandina-film-big') - if 'serie' in item.url: - item.contentType = 'tvshow' - item.action = 'episodios' - return item + + typeActionDict = {'findvideos': ['film'], 'episodios': ['serie']} + typeContentDict = {'movie': ['film'], 'tvshow': ['serie']} + # debug = True return locals() @@ -83,7 +81,7 @@ def episodios(item): if item.data: data = item.data # debug= True title = item.fulltitle - patron = r'link-episode">(?:\s*<strong>)?\s*(?P<episode>\d+.\d+(?:.\d+)?)(?:[^\(]+\((?P<lang>[?P<lang>A-Za-z-]+)[^>]+>)?(?:\s*(?P<title>.*?) )[^>]+<\/span>\s*(?P<url>.*?)</div>' + patron = r'link-episode">(?:\s*<strong>)?\s*(?P<episode>\d+.\d+(?:.\d+)?)(?:\s*\((?P<lang>[?P<lang>A-Za-z-]+)[^>]+>)?(?:\s*(?P<title>.*?) )[^>]+<\/span>\s*(?P<url>.*?)</div>' def itemHook(item): if 'Episodio' in item.title: item.title = support.re.sub(r'Episodio [0-9.-]+', title, item.title) diff --git a/channels/tantifilm.py b/channels/tantifilm.py index 9e6a3b7c..6b79e9dc 100644 --- a/channels/tantifilm.py +++ b/channels/tantifilm.py @@ -5,13 +5,11 @@ import re -from core import scrapertools, httptools, tmdb, support +from core import scrapertools, httptools, support from core.item import Item from core.support import log from platformcode import logger -from specials import autorenumber from platformcode import config, unify -from lib.unshortenit import unshorten_only def findhost(): @@ -79,7 +77,7 @@ def episodios(item): data_check = re.sub(r'>\s+<', '> <', data_check) else: data_check = item.data - patron_check = r'<iframe src="([^"]+)" scrolling="no" frameborder="0" width="626" height="550" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true">' + patron_check = r'<iframe src="([^"]+)"' data = httptools.downloadpage(scrapertools.find_single_match(data_check, patron_check), headers=headers).data data = data.replace("'", '"') data = re.sub('\n|\t', ' ', data)