diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index a07ceca6..0875e1f6 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -75,12 +75,6 @@ def peliculas(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - patron = '(?s)short_overlay.*?
(.*?)<\/a>' + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels = item.infoLabels + num_ep = 1 + for scrapedseason, scrapedepisode, scrapedurl, scrapedtitle in matches: + season = scrapedseason + contentEpisodeNumber = num_ep + url = scrapedurl + title = '%sx%s - %s' % (season, num_ep, scrapedtitle) + itemlist.append(item.clone(title = title, + url = url, + contentEpisodeNumber = contentEpisodeNumber, + action = 'findvideos', + infoLabels = infoLabels + )) + num_ep += 1 + return itemlist + +def episodesxseason (item): + logger.info() + itemlist = [] + season = item.contentSeasonNumber + data = httptools.downloadpage(item.url).data + patron = '
%s - (\d+)<\/div>
(.*?)<\/a>'%season + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels = item.infoLabels + num_ep=1 + for scrapedepisode, scrapedurl, scrapedtitle in matches: + title = '%sx%s - %s'%(season, num_ep, scrapedtitle) + url = scrapedurl + infoLabels['episode']= num_ep + itemlist.append(item.clone(title = title, + url=url, + contentEpisodeNumber = num_ep, + action = 'findvideos', + infoLabels=infoLabels)) + num_ep +=1 + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + + +def findvideos(item): + logger.info() + itemlist = [] + templist =[] + data = httptools.downloadpage(item.url).data + itemlist.extend(servertools.find_video_items(data=data)) + for videoitem in itemlist: + videoitem.channel = item.channel + if videoitem.server != 'youtube': + videoitem.title = item.title+' (%s)'%videoitem.server + else: + videoitem.title = 'Trailer en %s' % videoitem.server + videoitem.action = 'play' + + if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': + itemlist.append( + Item(channel=item.channel, + title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', + url=item.url, + action="add_pelicula_to_library", + extra="findvideos", + contentTitle=item.contentTitle, + )) + + return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria == 'peliculas': + item.url = host + '/release/2017/' + + elif categoria == 'infantiles': + item.url = host + '/genero/infantil/' + + itemlist = list_all(item) + if itemlist[-1].title == '>> Página siguiente': + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist