From 27f741569899f2c3ae59350b5128608958a5e389 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 15 Jan 2020 22:24:25 +0100 Subject: [PATCH] Fix AnimeSaturn, il Genio dello Streaming --- channels/animesaturn.py | 10 ++++++++-- channels/ilgeniodellostreaming.py | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/channels/animesaturn.py b/channels/animesaturn.py index ff52f470..2c0de7d0 100644 --- a/channels/animesaturn.py +++ b/channels/animesaturn.py @@ -81,6 +81,9 @@ def peliculas(item): if item.args == 'incorso': patron = r'"slider_title"\s*href="(?P[^"]+)">]+>(?P[^\(<]+)(?:\((?P<year>\d+)\))?</a>' else: patron = r'href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>.+?)(?:\((?P<lang>ITA)\))?(?:(?P<year>\((\d+)\)))?</span>' action = 'check' + def itemHook(item): + item.url = item.url.replace('www.','') + return item return locals() @@ -102,15 +105,18 @@ def check(item): def episodios(item): if item.contentType != 'movie': anime = True patron = r'<strong" style="[^"]+">(?P<title>[^<]+)</b></strong></td>\s*<td style="[^"]+"><a href="(?P<url>[^"]+)"' + def itemHook(item): + item.url = item.url.replace('www.','') + return item return locals() def findvideos(item): support.log() itemlist = [] - urls = support.match(item, patron=r'<a href="([^"]+)"><div class="downloadestreaming">', headers=headers, debug=True).matches + urls = support.match(item, patron=r'<a href="([^"]+)"><div class="downloadestreaming">', headers=headers).matches if urls: - links = support.match(urls[0], patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers).matches + links = support.match(urls[0].replace('www.',''), patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers).matches for link in links: itemlist.append( support.Item(channel=item.channel, diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index 3cbb560e..2c7fb457 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -213,7 +213,9 @@ def findvideos(item): log() itemlist =[] - matches, data = support.match(item, '<iframe class="metaframe rptss" src="([^"]+)"[^>]+>',headers=headers) + html = support.match(item, patron='<iframe class="metaframe rptss" src="([^"]+)"[^>]+>',headers=headers) + matches = html.matches + data = html.data for url in matches: html = httptools.downloadpage(url, headers=headers).data data += str(scrapertools.find_multiple_matches(html, '<meta name="og:url" content="([^"]+)">')) @@ -224,7 +226,7 @@ def findvideos(item): data = httptools.downloadpage(item.url).data patron = r'<div class="item"><a href="'+host+'/serietv/([^"\/]+)\/"><i class="icon-bars">' - series = scrapertools.find_single_match(data, patron) + series = support.match(data, patron=patron).matches titles = support.typo(series.upper().replace('-', ' '), 'bold color kod') goseries = support.typo("Vai alla Serie:", ' bold') itemlist.append(