diff --git a/channels/altadefinizione.py b/channels/altadefinizione.py index ea67a85f..e3e79d4d 100644 --- a/channels/altadefinizione.py +++ b/channels/altadefinizione.py @@ -93,6 +93,7 @@ def peliculas(item): ) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + support.check_trakt(itemlist) if not item.args == 'search' and not len(itemlist) < 10: # pagination not works if not item.parent_url: @@ -107,30 +108,36 @@ def peliculas(item): return itemlist -@support.scrape def episodios(item): item.quality = '' data = item.data - 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) - # ) + item.data = '' + itemlist = [] - return locals() + for it in support.match(data, patron=[r'div class=\"single-season.*?(?P<id>season_[0-9]+).*?>Stagione:\s(?P<season>[0-9]+).*?(\s-\s(?P<lang>[a-zA-z]+?))?<']).matches: + logger.debug(it) + block = support.match(data, patron = r'div id=\"'+ it[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], lang= it[3]), + url = ep[0], + infoLabels = infoLabels) + ) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + support.check_trakt(itemlist) + support.videolibrary(itemlist, item) + support.download(itemlist, item) + + return itemlist def check(item): item.data = httptools.downloadpage(item.url).data