From d9211871c0476af7c90339c2255e4ba605c55293 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Sat, 1 Jun 2019 12:25:38 +0200 Subject: [PATCH] Fix Support Match --- channels/cineblog01.py | 2 +- channels/guardaserieclick.py | 112 +++++++---------------------------- channels/tantifilm.py | 9 ++- channels/vedohd.py | 2 +- core/support.py | 5 +- 5 files changed, 29 insertions(+), 101 deletions(-) diff --git a/channels/cineblog01.py b/channels/cineblog01.py index f2c803cc..b801c948 100644 --- a/channels/cineblog01.py +++ b/channels/cineblog01.py @@ -122,7 +122,7 @@ def last(item): if item.contentType == 'episode': matches = support.match(item, r']+)".*?>([^(:(|[)]+)([^<]+)<\/a>', '
(.*?)(.*?)(.*?)(.*?)(.*?)(.*?)(.*?)(.*?)\s[^>]+>[^>]+>[^>]+>[^>]+>' - patron += r'[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)

' - - matches = support.match(item, patron, patron_block, headers)[0] - - for scrapedurl, scrapedthumbnail, scrapedtitle in matches: - scrapedtitle = cleantitle(scrapedtitle) - - itemlist.append( - Item(channel=item.channel, - action="episodios", - contentType="episode", - title=scrapedtitle, - fulltitle=scrapedtitle, - url=scrapedurl, - show=scrapedtitle, - thumbnail=scrapedthumbnail, - folder=True)) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - return itemlist + patron = r'
\s[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)

' + return support.scrape(item, patron, ['url', 'thumb', 'title'], patron_block=patron_block, action='episodios') # ================================================================================================================ @@ -141,47 +122,10 @@ def serietvaggiornate(item): log() itemlist = [] - patron_block = r'(.*?)]+> ]+>[^>]+>' - patron += r'[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>' + patron_block = r'
(.*?)<\/div><\/div>]+> ]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^(?:<|\()]+)(?:\(([^\)]+)\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>' - matches = support.match(item, patron, patron_block, headers)[0] - - for scrapedurl, scrapedthumbnail, scrapedep, scrapedtitle in matches: - episode = re.compile(r'^(\d+)x(\d+)', re.DOTALL).findall(scrapedep) # Prendo stagione ed episodioso - scrapedtitle = cleantitle(scrapedtitle) - - contentlanguage = "" - if 'sub-ita' in scrapedep.strip().lower(): - contentlanguage = 'Sub-ITA' - - extra = r']*>' % ( - episode[0][0], episode[0][1].lstrip("0")) - - infoLabels = {} - infoLabels['episode'] = episode[0][1].zfill(2) - infoLabels['season'] = episode[0][0] - - title = str( - "%s - %sx%s %s" % (scrapedtitle, infoLabels['season'], infoLabels['episode'], contentlanguage)).strip() - - itemlist.append( - Item(channel=item.channel, - action="findepvideos", - contentType="episode", - title=title, - show=scrapedtitle, - fulltitle=scrapedtitle, - url=scrapedurl, - extra=extra, - thumbnail=scrapedthumbnail, - contentLanguage=contentlanguage, - infoLabels=infoLabels, - folder=True)) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - - return itemlist + return support.scrape(item, patron, ['url', 'thumb', 'episode', 'lang', 'title'], patron_block=patron_block, action='findvideos') # ================================================================================================================ @@ -202,29 +146,7 @@ def lista_serie(item): patron_block = r'(.*?)' patron = r'\s[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)

' - matches, data = support.match(item, patron, patron_block, headers) - - for scrapedurl, scrapedimg, scrapedtitle in matches: - scrapedtitle = cleantitle(scrapedtitle) - - if scrapedtitle not in ['DMCA', 'Contatti', 'Lista di tutte le serie tv']: - itemlist.append( - Item(channel=item.channel, - action="episodios", - contentType="episode", - title=scrapedtitle, - fulltitle=scrapedtitle, - url=scrapedurl, - thumbnail=scrapedimg, - extra=item.extra, - show=scrapedtitle, - folder=True)) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - - support.nextPage(itemlist, item, data, r"\s([^<]+)<\/div>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>]+>([^<]+)<[^>]+>[^>]+>[^>]+>' - patron += r'[^<]+[^"]+".*?serie="([^"]+)".*?stag="([0-9]*)".*?ep="([0-9]*)"\s' + patron += r'[^"]+".*?serie="([^"]+)".*?stag="([0-9]*)".*?ep="([0-9]*)"\s' patron += r'.*?embed="([^"]+)"\s.*?embed2="([^"]+)?"\s.*?embed3="([^"]+)?"?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s?' patron += r'(?:]+>|]+>)?' @@ -255,7 +177,7 @@ def episodios(item): itemlist.append( Item(channel=item.channel, action="findvideos", - title=title, + title=support.typo(title, 'bold'), fulltitle=scrapedtitle, url=scrapedurl + "\r\n" + scrapedurl2 + "\r\n" + scrapedurl3, contentType="episode", @@ -290,5 +212,11 @@ def findepvideos(item): # ---------------------------------------------------------------------------------------------------------------- def findvideos(item): log() - logger.debug(item.url) - return support.server(item, data=item.url) + if item.contentType == 'tvshow': + data = httptools.downloadpage(item.url, headers=headers).data + matches = scrapertools.find_multiple_matches(data, item.extra) + data = "\r\n".join(matches[0]) + else: + log(item.url) + data = item.url + return support.server(item, data) diff --git a/channels/tantifilm.py b/channels/tantifilm.py index aa88d6b6..0b33787a 100644 --- a/channels/tantifilm.py +++ b/channels/tantifilm.py @@ -130,7 +130,7 @@ def peliculas(item): action = 'findvideos' if item.extra == 'movie' else 'episodios' if item.args == 'movie': patron= r'
[^<]+]+>[^<]+]+>[^<]+<\/a>.*?

\s*([a-zA-Z-0-9]+)\s*<\/p>' - itemlist = support.scrape(item, patron, ['url', 'title', 'year', 'thumb', 'quality'], headers, action=action, patronNext='

]+><\/a><[^>]+>

([^<]+) \(([^\)]+)[^<]+<\/p>.*?

\s*([a-zA-Z-0-9]+)\s*<\/p>' itemlist = support.scrape(item, patron, ['url', 'thumb', 'title', 'year', 'quality'], headers, action=action, patronNext='