def play(params,url,category): xbmc.output("[meristation.py] play") title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" ) thumbnail = urllib.unquote_plus( params.get("thumbnail") ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) server = "Directo" # URL de detalle # http://www.meristation.com/v3/des_videos.php?pic=WII&idj=cw49944ba621067&COD=cw4a8d04e8e355d # URL con el vídeo # http://www.meristation.com/v3/des_videos.php?id=cw4a8d04e8e355d&c=1&pic=WII&idj=cw49944ba621067 # URL descargar vídeo # http://www.meristation.com/v3/des_videos.php?id=cw4a8d04e8e355d&c=1&pic=WII&idj=cw49944ba621067 # XML # http://www.meristation.com/v3/video_player.php?vid=cw48fc48c0d0da9&res=alta&format=xml&version=1.5.002 # Extrae el código del vídeo xbmc.output("[meristation.py] url="+url) patron = 'http\://www.meristation.com/v3/des_videos.php.*?\&COD\=([^$]+)$' matches = re.compile(patron,re.DOTALL).findall(url) scrapertools.printMatches(matches) if len(matches)==0: patron = 'id\=([^\&]+)\&' matches = re.compile(patron,re.DOTALL).findall(url) scrapertools.printMatches(matches) if len(matches)==0: patron = 'http\://www.meristation.com/v3/des_videos.php.*?\&id\=([^$]+)$' matches = re.compile(patron,re.DOTALL).findall(url) scrapertools.printMatches(matches) if len(matches)==0: xbmctools.alertnodisponible() return # Descarga la página xbmc.output("[meristation.py] vid="+matches[0]) url = 'http://www.meristation.com/v3/video_player.php?id='+matches[0]+'&format=xml' xbmc.output("[meristation.py] url="+url) data = scrapertools.downloadpagewithcookies(url) xbmc.output(data[:200]) # Extrae las entradas (carpetas) patron = '<location>([^<]+)</location>' matches = re.compile(patron,re.DOTALL).findall(data) scrapertools.printMatches(matches) if len(matches)==0: return url = matches[0] url = url.replace(" ","%20") xbmctools.playvideo(CHANNELCODE,server,url,category,title,thumbnail,plot)
def detail(params, url, category): logger.info("[peliculasyonkis.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") # Descarga la pv°gina data = scrapertools.cachePage(url) # logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ patronvideos = 'href="http://www.peliculasyonkis.sx/player/visor_([^\.]+).php.*?' patronvideos += 'id=([^"]+)".*?' patronvideos += 'alt="([^"]+)"' patronvideos += "(.*?)</tr>" matches = re.compile(patronvideos, re.DOTALL).findall(data) patronvideos1 = 'http://www.peliculasyonkis.sx/go/(d)/(.+?)".*?alt="([^"]+)"' patronvideos1 += "(.+?)<br /></span></div></td>" matches1 = re.compile(patronvideos1, re.DOTALL).findall(data) if len(matches1) > 0: for j in matches1: matches.append(j) if len(matches) > 0: scrapertools.printMatches(matches) id, serv = ChoiceOneVideo(matches, title) logger.info("[peliculasyonkis.py] id=" + id) url = Decrypt_Server(id, serv) if (serv in ["pymeno2", "pymeno3"]) and (":" in url): match = url.split(":") url = choiceOnePart(match) if url == "": return print "codigo :%s" % url else: xbmctools.alertnodisponible() return "" if url == "": return xbmctools.play_video(CHANNELNAME, SERVER[serv], url, category, title, thumbnail, plot)
def detail(params, url, category): logger.info("[peliculasyonkis.py] detail") title = urllib.unquote_plus(params.get("title")) thumbnail = urllib.unquote_plus(params.get("thumbnail")) plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") # Descarga la pv°gina data = scrapertools.cachePage(url) #logger.info(data) # ------------------------------------------------------------------------------------ # Busca los enlaces a los videos # ------------------------------------------------------------------------------------ patronvideos = 'href="http://www.peliculasyonkis.sx/player/visor_([^\.]+).php.*?' patronvideos += 'id=([^"]+)".*?' patronvideos += 'alt="([^"]+)"' patronvideos += '(.*?)</tr>' matches = re.compile(patronvideos, re.DOTALL).findall(data) patronvideos1 = 'http://www.peliculasyonkis.sx/go/(d)/(.+?)".*?alt="([^"]+)"' patronvideos1 += "(.+?)<br /></span></div></td>" matches1 = re.compile(patronvideos1, re.DOTALL).findall(data) if (len(matches1) > 0): for j in matches1: matches.append(j) if len(matches) > 0: scrapertools.printMatches(matches) id, serv = ChoiceOneVideo(matches, title) logger.info("[peliculasyonkis.py] id=" + id) url = Decrypt_Server(id, serv) if (serv in ["pymeno2", "pymeno3"]) and (":" in url): match = url.split(":") url = choiceOnePart(match) if url == "": return print 'codigo :%s' % url else: xbmctools.alertnodisponible() return "" if url == "": return xbmctools.play_video(CHANNELNAME, SERVER[serv], url, category, title, thumbnail, plot)