From 29915fa6e408c299b11bf37f13cb9bd5d66e4949 Mon Sep 17 00:00:00 2001 From: marco <10120390+mac12m99@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:26:56 +0200 Subject: [PATCH] altadefinizione: episodios con scrape --- channels/altadefinizione.py | 41 +++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/channels/altadefinizione.py b/channels/altadefinizione.py index 8b38fc68..649c2157 100644 --- a/channels/altadefinizione.py +++ b/channels/altadefinizione.py @@ -107,32 +107,29 @@ def peliculas(item): return itemlist +@support.scrape def episodios(item): item.quality = '' data = item.data - itemlist = [] + patronBlock = "div id=\"season_(?P[0-9])\"(?P.*?)[^\"]+).*?img\" src=\"(?P[^\"]+).*?title\">(?P[0-9]+)\.\s+(?P.*?)</span>' + def itemHook(item): + item.contentSeason += 1 + item.title = re.sub('[0-9]+(?=x[0-9]+)', str(item.contentSeason), item.title) + return item + # infoLabels['tvshowtitle'] = support.cleantitle(item.fulltitle) + # infoLabels['season'] = int(it[1]) + # infoLabels['episode'] = int(ep[2]) + # infoLabels['episodeName'] = support.cleantitle(ep[3]) + # itemlist.append(item.clone(contentType = 'tvshow', + # action='findvideos', + # thumb = ep[1], + # title = support.format_longtitle(support.cleantitle(ep[3]), season = it[1], episode = ep[2]), + # url = ep[0], + # infoLabels = infoLabels) + # ) - for it in support.match(data, patron=[r'div class=\"single-season.*?(?P<id>season_[0-9]+).*?>Stagione:\s(?P<season>[0-9]+).*?</div']).matches: - logger.debug(it) - block = support.match(data, patron = r'div id=\"season_0\".*?</div').match - for ep in support.match(block, patron=[r'<li><a href=\"(?P<url>[^\"]+).*?img\" src=\"(?P<thumb>[^\"]+).*?title\">(?P<episode>[0-9]+)\.\s+(?P<title>.*?)</span>']).matches: - logger.debug(ep) - infoLabels = dict() - infoLabels['tvshowtitle'] = support.cleantitle(item.fulltitle) - infoLabels['season'] = int(it[1]) - infoLabels['episode'] = int(ep[2]) - infoLabels['episodeName'] = support.cleantitle(ep[3]) - itemlist.append(item.clone(contentType = 'tvshow', - action='findvideos', - thumb = ep[1], - title = support.format_longtitle(support.cleantitle(ep[3]), season = it[1], episode = ep[2]), - url = ep[0], - infoLabels = infoLabels) - ) - - tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) - - return itemlist + return locals() def check(item):