From 80261ee7ce6f74f4c1ff0e9a0d4816d0944c8766 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Fri, 19 Aug 2022 10:08:02 +0200 Subject: [PATCH] Fix Cinemalibero (Wrestling) --- channels/cinemalibero.py | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index 2ebb600e..06b07e86 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -97,25 +97,21 @@ def peliculas(item): @support.scrape def episodios(item): data = item.data - # support.dbg() - # debugBlock = True + if item.args == 'anime': logger.debug("Anime :", item) - # blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo'] patron = r'[^>]+>(?PEpisodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))' patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)' item.contentType = 'tvshow' - elif item.args == 'wrestling': - - logger.debug("Wrestling :", item) - # debugBlock = True + elif item.args == 'sport': + logger.debug("Sport :", item) patron = r'(?:/>|<p>)\s*(?P<title>[^-]+)-(?P<data>.+?)(?:<br|</p)' patronBlock = r'</strong>\s*</p>(?P<block>.*?</p>)' item.contentType = 'tvshow' elif item.args == 'serie' or item.contentType == 'tvshow': logger.debug("Serie :", item) - # debugBlock = True - patron = r'(?:/>|<p>)\s*(?:(?P<episode>\d+(?:x|×|×)\d+|Puntata \d+)[;]?[ ]?(?P<title>[^<–-]+))?(?P<data>.*?)(?:<br|</p)' + # debug=True + patron = r'(?:/>|<p>)\s*(?:(?P<episode>\d+(?:x|×|×)\d+|Puntata \d+)(?:-(?P<episode2>\d+))?[;]?[ ]?(?P<title>[^<–-]+))?(?P<data>.*?)(?:<br|</p)' patronBlock = r'Stagione\s(?:[Uu]nica)?(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:strong>|<div class="at-below)' item.contentType = 'tvshow' else: @@ -128,8 +124,9 @@ def episodios(item): def itemlistHook(itl): ret = [] - if item.args == 'wrestling': + if item.args == 'sport': return itl + # support.dbg() for it in itl: ep = scrapertools.find_single_match(it.title, r'(\d+x\d+)') if not ep and 'http' in it.data: # stagione intera @@ -211,22 +208,28 @@ def newest(categoria): def check(item): logger.debug() data = support.match(item.url, headers=headers).data + # support.dbg() if data: - ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower() - if ck == 'film': - item.contentType = 'movie' - item.data = data - # item.action = 'findvideos' - return findvideos(item) + ck = str(support.match(data, patronBlock=r'Genere:(.*?)</span>', patron=r'tag">([^<]+)').matches).lower() - elif ck in ['serie tv', 'wrestling wwe', 'anime']: + if 'serie tv' in ck or 'anime' in ck:# in ['serie tv', 'wrestling wwe', 'anime']: + if 'anime' in ck: + item.args = 'anime' + elif 'sport' in ck: + item.args = 'sport' + else: + item.args = 'serie' item.contentType = 'tvshow' - item.args = ck.split()[0] item.data = data itemlist = episodios(item) if not itemlist: item.data = data return findvideos(item) + else: + item.contentType = 'movie' + item.data = data + # item.action = 'findvideos' + return findvideos(item) return itemlist