function calcula() { //titulo $titulo = 'LiveLeak'; dbug('titulo=' . $titulo); //imagen $imagen = entre1y2($this->web_descargada, 'image: "', '"'); dbug('imagen=' . $imagen); if (enString($this->web_descargada, 'config: "')) { $config = entre1y2($this->web_descargada, 'config: "', '"'); dbug_($config); $config = explode('&', $config); dbug_r($config); $url = ''; foreach ($config as $elem) { if (strpos($elem, 'hd_file_url') === 0) { $url = urldecode(substr($elem, strposF($elem, '='))); break; } if (strpos($elem, 'file_url') === 0) { $url = urldecode(substr($elem, strposF($elem, '='))); } } } else { preg_match('#file: "(http.*?\\.mp4.*?)"#', $this->web_descargada, $matches); dbug_r($matches); $url = $matches[1]; } dbug_r($url); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url_txt' => 'Descargar', 'url' => $url, 'tipo' => 'http'))); finalCadena($obtenido); }
function calcula() { $obtenido = array('enlaces' => array()); //raido o tv if (enString($this->web_descargada, "#radio")) { $p = strpos($this->web_descargada, 'http://podcastdl.'); $f = strpos($this->web_descargada, '"', $p); $ret = substr($this->web_descargada, $p, $f - $p); dbug('url=' . $ret); array_push($obtenido['enlaces'], array('url' => $ret, 'tipo' => 'http')); $imagen = entre1y2($this->web_descargada, '<div class="imagen"><img src="', '"'); dbug('imagen=' . $imagen); } if (enString($this->web_descargada, "#tv")) { $rtmp = 'rtmp://' . entre1y2($this->web_descargada, 'rtmp://', '"'); if (enString($rtmp, "#")) { $f = strpos($rtmp, '#'); if (enString($rtmp, "#tv")) { $f = strpos($rtmp, '#', $f + 1); } $rtmp = substr($rtmp, 0, $f); } $rtmp = strtr($rtmp, array("#" => "")); dbug('rtmp=' . $rtmp); //if(isiPad) $http = entre1y2($this->web_descargada, 'if(isiPad)', '</script>'); //poster="/sites/default/files/extremaduranoticas_nuevo2.jpg" $imagen = "http://www.canalextremadura.es" . entre1y2($http, 'poster="', '"'); dbug('imagen=' . $imagen); $http = entre1y2($http, 'src="', '"'); array_push($obtenido['enlaces'], array('titulo' => 'Calidad Baja', 'url' => $http, 'tipo' => 'http')); array_push($obtenido['enlaces'], array('titulo' => 'Calidad Alta', 'url' => $rtmp, 'tipo' => 'rtmp')); } if (enString($this->web_descargada, ".mp4#")) { $rtmp = 'rtmp://' . entre1y2($this->web_descargada, 'rtmp://', '.mp4') . '.mp4'; dbug('rtmp=' . $rtmp); //if(isiPad) $http = entre1y2($this->web_descargada, 'data-iosUrl="', '"'); //poster="/sites/default/files/extremaduranoticas_nuevo2.jpg" $imagen = "http://www.canalextremadura.es/" . entre1y2($http, '#/', "#"); dbug('imagen=' . $imagen); //if(isiPad) $http = "http://" . entre1y2($http, 'http://', '#'); array_push($obtenido['enlaces'], array('titulo' => 'Calidad Baja', 'url' => $http, 'url_txt' => 'Descargar', 'tipo' => 'http')); array_push($obtenido['enlaces'], array('titulo' => 'Calidad Alta', 'url' => $rtmp, 'tipo' => 'rtmp')); } //<h1 class="title">Extremadura 2 (17/05/12)</h1> if (enString($this->web_descargada, '<h1 class="title">')) { $titulo = entre1y2($this->web_descargada, '<h1 class="title">', '</h1>'); } else { $p = strpos($this->web_descargada, '.mp4'); $p = strpos($this->web_descargada, '<a', $p); $titulo = entre1y2_a($this->web_descargada, $p, '>', '</'); } $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido); }
function calcula() { if (enString($this->web, '&')) { $idVideo = entre1y2($this->web, 'v=', '&'); } else { $idVideo = substr($this->web, strposF($this->web, 'v=')); } dbug('idVideo=' . $idVideo); //Código $titulo = trim(entre1y2($this->web_descargada, '<title>', '</title>')); dbug('titulo=' . $titulo); $imagen = ''; /* // En caso de que No hubiera bloqueo de IP $retfull = CargaWebCurl('http://www.magnovideo.com/player_config.php?mdid='.$idVideo); $imagen = entre1y2($retfull,'<tile_thumbs>','</tile_thumbs>'); dbug('imagen='.$imagen); $video_name = entre1y2($retfull,'<video_name>','</video_name>'); $sto = entre1y2($retfull,'<sto>','</sto>'); $url = substr($imagen, 0, -18).$video_name.'?'.$sto; */ $urlJS = 'function lanzaMagnovideo(){' . 'if(typeof DESCARGADOR_ARCHIVOS_SWF === "undefined"){' . 'setTimeout(lanzaMagnovideo, 200)' . '}' . 'else if(DESCARGADOR_ARCHIVOS_SWF === true){' . 'getFlashMovie("descargador_archivos").CargaWeb({"url":"http://www.magnovideo.com/player_config.php?mdid=' . $idVideo . '"}, "procesaMagnovideo");' . '}' . '}' . 'function procesaMagnovideo(txt){' . 'var imagen = txt.split("<tile_thumbs>")[1].split("</tile_thumbs>")[0];' . 'var video_name = txt.split("<video_name>")[1].split("</video_name>")[0];' . 'var sto = txt.split("<sto>")[1].split("</sto>")[0];' . 'var url = imagen.split("tmpsmall/tiles.jpg")[0] +video_name + "?" + sto;' . 'mostrarResultado(url);' . '}' . 'function mostrarResultado(entrada){' . 'finalizar(entrada,"Descargar");' . '}' . 'function mostrarFallo(){' . 'finalizar("","No se ha encontrado ningún resultado");' . '}' . 'if(typeof descargador_archivos === "undefined"){' . 'D.g("enlaces").innerHTML += \'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" id="descargador_archivos" align="middle">' . '<param name="movie" value="/util/fla/f/ajofeifo.swf" />' . '<param name="quality" value="high" />' . '<param name="bgcolor" value="#000" />' . '<param name="allowScriptAccess" value="sameDomain" />' . '<!--[if !IE]>-->' . '<embed src="/util/fla/f/ajofeifo.swf" quality="high" bgcolor="#000"' . 'width="0" height="0" name="descargador_archivos" align="middle"' . 'play="true" loop="true" quality="high" allowScriptAccess="sameDomain"' . 'type="application/x-shockwave-flash"' . 'pluginspage="http://www.macromedia.com/go/getflashplayer">' . '</embed>' . '<!--<![endif]-->' . '</object>\';' . 'var descargador_archivos = D.g("descargador_archivos");' . '}' . 'lanzaMagnovideo();'; $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $urlJS, 'tipo' => 'jsFlash'))); finalCadena($obtenido); }
function tvg() { global $web, $web_descargada; $retfull = $web_descargada; //$retfull=CargaWebCurl($web); //debe haber un video if (enString($retfull, "flowplayer(")) { //netConnectionUrl: "rtmp://media1.crtvg.es:80/vod" //Para VOD $p = strpos($retfull, 'netConnectionUrl: "') + 19; $f = strpos($retfull, '"', $p); $ret = substr($retfull, $p, $f - $p); dbug($ret); //clip: { //url: "mp4:02/0000/0000_20121206000000.mp4", $clip = strpos($retfull, 'clip: {'); $p = strpos($retfull, 'url: "', $clip) + 6; $f = strpos($retfull, '"', $p); $ret = $ret . '/' . substr($retfull, $p, $f - $p); dbug($ret); //title: "Tourilandia recibe a visita de David Vidal", $p = strpos($retfull, 'title: "', $clip) + 8; $f = strpos($retfull, '"', $p); $titulo = substr($retfull, $p, $f - $p); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); //imagen //backgroundImage: "url(http://www.crtvg.es/files/web/000020121206000000.jpg)" $p = strpos($retfull, 'backgroundImage: "url(') + 22; $f = strpos($retfull, ')', $p); $imagen = substr($retfull, $p, $f - $p); dbug('imagen=' . $imagen); } $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $ret, 'tipo' => 'rtmp'))); finalCadena($obtenido); }
function calcula() { //mirar si hay video $obtenido = array('titulo' => 'Canal de Historia', 'enlaces' => array()); if (!enString($this->web_descargada, '<iframe')) { return; } preg_match_all('@<iframe src="(.*?)"@', $this->web_descargada, $matches); dbug_r($matches); foreach ($matches[1] as $url) { dbug($url); if (strpos($url, '//player.vimeo') === 0) { $url = 'http:' . $url; $vimeo = new Vimeo(); $url_descargada = CargaWebCurl($url); $vimeo->init($url, $url_descargada); $ret = $vimeo->calcula(); dbug_r($ret); } else { $adnstream = new Adnstream(); $url_descargada = CargaWebCurl($url); $adnstream->init($url, $url_descargada); $ret = $adnstream->calcula(); dbug_r($ret); } $obtenido['enlaces'][] = array('titulo' => $ret['titulo']); foreach ($ret['enlaces'] as $enlace) { $obtenido['enlaces'][] = $enlace; } if (!isset($obtenido['imagen'])) { $obtenido['imagen'] = $ret['imagen']; } } finalCadena($obtenido); }
/** * This method will parse the url and determine the controller, its method and its parameters if any. * Then we will include the controller file. * Then initialize the controller * then run its method * @return [nothing] */ function handle_request() { $this->controller = $this->uri->url["controller"]; $this->method = restful($this->uri->url["method"]); $this->params = $this->uri->url["params"]; if ($this->debug) { dbug("The controller ", $this->controller); dbug("The method ", $this->method); dbug("The params ", $this->params); } // set file location $file = CONTROLLER_FOLDER . '/' . $this->controller . '.php'; // check if the class file (controller) exist , else throw error if (!file_exists($file)) { header("Content-Type: application/json"); echo json_encode(["status" => "fail", "response" => "The requested API does not exist."]); die(header("HTTP/1.0 404 Oops requested url does not exist or has moved ")); } // include the class file (controller) require_once $file; $controller = $this->controller; // initialize the controller $this->app = new $controller($this->autoload); // if the method exist in this controller if (method_exists($this->app, $this->method)) { $this->app->{$this->method}($this->params); } else { header("Content-Type: application/json"); echo json_encode(["status" => "fail", "response" => "The requested API does not exist."]); header("HTTP/1.0 404 Oops requested url does not exist "); } }
function calcula() { if (!preg_match('#<form name="F1" method="POST" action=\'\'>#i', $this->web_descargada)) { setErrorWebIntera('No se encuentra ningún vídeo'); return; } $id = substr($this->web, strposF($this->web, 'allmyvideos.net/')); dbug('id = ' . $id); $web_embedPlayedTo = 'http://allmyvideos.net/' . $id; $retfull = CargaWebCurl($web_embedPlayedTo, '', array('referer' => 'http://web.com')); if (enString($retfull, '"image" : "')) { $mode = 'lanzaAllMyVideosNet2'; $imagen = entre1y2($retfull, '"image" : "', '"'); } else { $imagen = ''; $web_embedPlayedTo = 'http://allmyvideos.net/' . $id; $mode = 'lanzaAllMyVideosNet1'; } if (enString($this->web_descargada, 'filename=')) { $titulo = entre1y2($this->web_descargada, 'filename=', '"'); if (enString($titulo, '&')) { $titulo = substr($titulo, 0, strpos($titulo, '&')); } $titulo = urldecode($titulo); } else { $titulo = 'AllMyVideos ID: ' . $id; } // FALLA EN EL CALLBACK DEL SWF. EDITAR EL SWF $urlJS = 'function lanzaAllMyVideosNet(){' . 'if(typeof DESCARGADOR_ARCHIVOS_SWF === "undefined"){' . 'setTimeout(lanzaAllMyVideosNet, 200)' . '}' . 'else if(DESCARGADOR_ARCHIVOS_SWF === true){' . 'getFlashMovie("descargador_archivos").CargaWeb({' . '"url":"' . $web_embedPlayedTo . '",' . '"metodo":"GET"' . '}, "' . $mode . '");' . '}' . '}' . 'function lanzaAllMyVideosNet1(txt){' . 'var regex = /<input.*?name="(.*?)".*?value="(.*?)".*?>/ig;' . 'var post = "";' . 'var res = [];' . 'while((res = regex.exec(txt)) != null){' . 'if(res[1] === "referer")res[2] = "";' . 'post += res[1] + "=" + res[2] +"&";' . '}' . 'getFlashMovie("descargador_archivos").CargaWeb({' . '"url":"' . $web_embedPlayedTo . '",' . '"metodo":"POST",' . '"post":post' . '}, "lanzaAllMyVideosNet2");' . '}' . 'function lanzaAllMyVideosNet2(txt){' . 'if(txt.indexOf(".setup(") !== -1){' . 'txt = txt.substr(txt.indexOf(".setup("));' . '}' . 'var urls = txt.split("\\"sources\\" : ")[1].split("]")[0]+"]";' . 'var urls = JSON.parse(urls);' . 'urls.sort(function(a,b){return parseInt(a["label"])<parseInt(b["label"])});' . 'url = urls[0]["file"];' . 'mostrarResultado(url);' . '}' . 'function mostrarResultado(entrada){' . 'finalizar(entrada,"Descargar");' . '}' . 'function mostrarFallo(){' . 'finalizar("","Ha ocurrido un error");' . '}' . 'if(typeof descargador_archivos === "undefined"){' . 'D.g("enlaces").innerHTML += \'' . genera_swf_object('/util/fla/f/allmyvideos.net') . '\';' . 'var descargador_archivos = D.g("descargador_archivos");' . '}' . 'lanzaAllMyVideosNet();'; $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $urlJS, 'tipo' => 'jsFlash'))); finalCadena($obtenido); }
function calcula() { $titulo = entre1y2($this->web_descargada, '<title>', '<'); dbug('titulo = ' . $titulo); if (preg_match('@http://media.*?\\.mp4@', $this->web_descargada, $matches)) { $imagen = entre1y2_a($this->web_descargada, strposF($this->web_descargada, '"og:image"'), '"', '"'); dbug('imagen = ' . $imagen); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $matches[0], 'tipo' => 'http'))); } else { preg_match('@#player-container \\.player-display.*?url.*?\'(.*?)\'@', $this->web_descargada, $matches); dbug_r($matches); $urlPreM3U8 = 'http://www.netd.com' . $matches[1]; $ret = CargaWebCurl($urlPreM3U8); dbug_($ret); preg_match('@defaultServiceUrl.*?\'(.*?)\'.*?path.*?\'(.*?)\'@', $ret, $matches); dbug_r($matches); $url = $matches[1] . '/' . $matches[2]; dbug('URL = ' . $url); preg_match('@preview.*?\'(.*?)\'@', $ret, $matches); $imagen = 'http:' . $matches[1]; dbug('imagen = ' . $imagen); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'm3u8'))); } finalCadena($obtenido); }
function calcula() { preg_match('@(?:sources: |video_files = )(\\[[\\s\\S]*?\\])@', $this->web_descargada, $matches); dbug_r($matches); $json = $matches[1]; //dbug($json); $json = strtr($json, array("\r" => "", "\n" => "", " " => "", "'" => '"')); $json = strtr($json, array(",}" => "}", ",]" => "]")); //dbug($json); $json = preg_replace("@(\\,|{)([a-z]+?):@i", '$1"$2":', $json); dbug($json); $json = json_decode($json, true); dbug_r($json); if ($json === null) { $files = preg_match('@http://.+?\\.mp4@', $this->web_descargada, $matches); $obtenido['enlaces'][] = array('url_txt' => 'Descargar', 'url' => $matches[0], 'tipo' => 'http'); } else { foreach ($json as $elem) { $obtenido['enlaces'][] = array('url_txt' => $elem['label'], 'url' => $elem['file'], 'tipo' => 'http'); } } $imagen = entre1y2($this->web_descargada, '<meta property="og:image" content="', '"'); dbug('imagen = ' . $imagen); $titulo = entre1y2($this->web_descargada, '<meta property="og:title" content="', '"'); dbug('titulo = ' . $titulo); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido); }
public function editTable() { $id = $this->input->post('id'); $data = $this->input->post('data'); $key = $this->input->post('key'); dbugnd($id); dbugnd($data); dbug($key); }
function calcula() { //http://www.cope.es/player/id=2013072310430001&activo=6 if (enString($this->web_descargada, "_url_xml_datos:")) { dbug("audio o video por xml"); //_url_xml_datos:'/proyecto/fragmentosJSP/playerxml.jsp?id=2013072310430001,1,33,13,,1411', //http://www.cope.es/proyecto/fragmentosJSP/playerxml.jsp?id=2013072310430001,1,33,13,,1411 $url = "http://www.cope.es" . entre1y2($this->web_descargada, "_url_xml_datos:'", "'"); //http://www.cope.es/proyecto/fragmentosJSP/playerxml.jsp?id=2013072310430001,1,33,13,,1411 $ret = CargaWebCurl($url); //mp3 y mp4: mp4->id=2013051613420001,1,30,,,1411 $p = strposF($ret, 'type="content"'); //$f=strposF($this->web_descargada,"'",$p); //http://www.cope.es/proyecto/fragmentosJSP/playerxml.jsp?id=2013072310430001,1,33,13,,1411 $url = entre1y2_a($ret, $p, "<url>", "</url>"); //http://vod.cope.es/audio/2013/07/23/audio_13745695177069462491.mp3 //imagen $imagen = "http://www.cope.es/" . entre1y2($ret, "<img>", "</img>"); } elseif (enString($this->web_descargada, "addCustomPlayer(")) { //addCustomPlayer('1iynycahpn4lw1ppzh0l6r5z1a', '15wugu5n3ruow1j9kwr3ma3tqz', '177dxsxbyqz8h18z4sldn5awz2', 686, 466, 'perf1iynycahpn4lw1ppzh0l6r5z1a-177dxsxbyqz8h18z4sldn5awz2', 'eplayer17', {age:1354724063000}); //xml.eplayer.performgroup.com/eplayer/mrss/1iynycahpn4lw1ppzh0l6r5z1a/15wugu5n3ruow1j9kwr3ma3tqz//7-12 //xml.eplayer.performgroup.com/eplayer/mrss/1iynycahpn4lw1ppzh0l6r5z1a/15wugu5n3ruow1j9kwr3ma3tqz preg_match("@addCustomPlayer\\('(.*?)',.*?'(.*?)'@", $this->web_descargada, $matches); $aCargar = 'http://xml.eplayer.performgroup.com/eplayer/mrss/' . $matches[1] . '/' . $matches[2]; $xml = CargaWebCurl($aCargar); //dbug($xml); preg_match_all("@<item>[\\s\\S]*?</item>@", $xml, $matches); dbug_r($matches); foreach ($matches[0] as $item) { $urlTXT = entre1y2($item, '<title>', '</title>'); $p = strrpos($item, 'url='); $url = entre1y2_a($item, $p, '"', '"'); $obtenido['enlaces'][] = array('titulo' => $urlTXT, 'url' => $url, 'tipo' => 'rtmp'); } $obtenido['titulo'] = 'Vídeos'; $obtenido['imagen'] = 'http://www.' . DOMINIO . '/canales/cope.png'; finalCadena($obtenido); return; } elseif (enString($this->web_descargada, '/proyecto/fragmentosJSP/playerxml.jsp')) { $ret = CargaWebCurl('http://www.cope.es' . desde1a2($this->web_descargada, '/proyecto/fragmentosJSP/playerxml.jsp', '"')); dbug_($ret); $url = entre1y2($ret, '<urlHtml>', '</'); $obtenido = array('titulo' => 'Cope', 'imagen' => 'http://www.' . DOMINIO . '/canales/cope.png', 'enlaces' => array(array('url' => $url, 'url_txt' => 'Descargar', 'tipo' => 'http'))); finalCadena($obtenido); return; } else { setErrorWebIntera('No se ha encontrado nada.'); return; } //titulo $titulo = entre1y2($this->web_descargada, "<title>", "|"); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); finalCadena($obtenido); }
function calcula_urlAcortada() { foreach ($this->web_descargada_headers as $header) { if (strpos($header, 'Location: ') === 0) { $this->web = substr($header, strposF($header, 'Location: ')); dbug('Location encontrado = ' . $this->web); $this->web_descargada = CargaWebCurl($this->web); $this->calcula(); continue; } } }
function __construct() { $url = isset($_REQUEST['_url']) ? explode('/', trim($_REQUEST['_url'], "/")) : null; $this->url["controller"] = !empty($url[0]) ? $url[0] : 'welcome'; $this->url["method"] = !empty($url[1]) ? $url[1] : 'index'; $this->url["params"] = count($url) > 2 ? array_slice($url, 2, count($url) - 2, true) : array(); foreach ($url as $index => $entity) { $this->url[++$index] = $entity; } if ($this->debug) { dbug(" The this->url ==( " . print_r($this->url, true) . " )== "); } }
function vhp_echo_marker($marker, $var) { global $VHP, $cpg_time_start; if (!isset($VHP)) { $VHP = array(); } $VHP[][$marker] = round(cpgGetMicroTime() - $cpg_time_start, 3); dbug(array(strtoupper($marker) => $var)); if (!is_array($var) && !is_bool($var) && $marker != 'page_html') { $var .= dbug_export(array(strtoupper($marker) => $var), '', $marker); } return $var; }
function calcula() { //titulo $titulo = utf8_encode(entre1y2($this->web_descargada, '<title>', '<')); //utf-8... mirar esto $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $p = strpos($this->web_descargada, 'og:image'); $imagen = entre1y2_a($this->web_descargada, $p, 'content="', '"'); dbug('imagen=' . $imagen); if (enString($this->web_descargada, 'og:video')) { $p = strpos($this->web_descargada, 'og:video'); $url = entre1y2_a($this->web_descargada, $p, 'content="', '"'); dbug('video=' . $url); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); } elseif (enString($this->web_descargada, '<object class="BrightcoveExperience"')) { $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array()); require_once 'brightcove-funciones.php'; /* $ejemplo = 'AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAe4KAAAAAgIAKGQ4Y2ZhOGIwZWQwYWVlM2YyMmRmZWRlMGYyZTU4NzRjYjViNGFmNjcRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdCFjb250ZW50T3ZlcnJpZGVzGWV4cGVyaWVuY2VJZAdVUkwTcGxheWVyS2V5GWRlbGl2ZXJ5VHlwZRFUVExUb2tlbgkDAQqBA1Njb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkNvbnRlbnRPdmVycmlkZRtjb250ZW50UmVmSWRzDXRhcmdldBVjb250ZW50SWRzF2NvbnRlbnRUeXBlE2NvbnRlbnRJZBtmZWF0dXJlZFJlZklkGWNvbnRlbnRSZWZJZBVmZWF0dXJlZElkAQYXdmlkZW9QbGF5ZXIBBAAFQoobzh2jSAABAQV/////4AAAAAVCg917rY7IAAaBF2h0dHA6Ly93d3cudnRlbGV2aXNpb24uZXMvcHJvZ3JhbWFzL3ZheWF2LzIwMTQvMDUvMjcvMDAzMV8zNTg4MzQwNTYxMDAxLmh0bQZlQVF+fixBQUFDZXpINWhNa34sa29OVmZFd3lwcTZXeGYyS01zN3EtM2V1R0wyOU1Pck0Ff////+AAAAAGAQ=='; $ejemplo = base64_decode($ejemplo); print_r(brightcove_decode($ejemplo)); */ preg_match('/<param value="(.*?)" name="playerID"/', $this->web_descargada, $matches); $experienceID = $matches[1]; preg_match('/<param value="(.*?)" name="playerKey"/', $this->web_descargada, $matches); $playerKey = $matches[1]; preg_match('/<param value="(.*?)" name="@videoPlayer"/', $this->web_descargada, $matches); $contentId = $matches[1]; $messagebroker = "http://c.brightcove.com/services/messagebroker/amf?playerKey=" . $playerKey; $a_encodear = array('target' => 'com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience', 'response' => '/1', 'data' => array('0' => 'd8cfa8b0ed0aee3f22dfede0f2e5874cb5b4af67', '1' => new SabreAMF_AMF3_Wrapper(new SabreAMF_TypedObject('com.brightcove.experience.ViewerExperienceRequest', array('TTLToken' => null, 'deliveryType' => NAN, 'URL' => $this->web, 'experienceId' => $experienceID, 'playerKey' => $playerKey, 'contentOverrides' => array('0' => new SabreAMF_TypedObject('com.brightcove.experience.ContentOverride', array('contentRefIds' => null, 'target' => 'videoPlayer', 'contentIds' => null, 'contentType' => 0, 'contentId' => $contentId, 'featuredRefId' => null, 'contentRefId' => null, 'featuredId' => NAN)))))))); $post = brightcove_encode($a_encodear); //print_r(brightcove_decode($post)); dbug('a descargar: ' . $messagebroker); $t = brightcove_curl_web($messagebroker, $post); $res_decoded = brightcove_decode($t); dbug('RESPUESTA BRIGHTCOVE:'); dbug_r($res_decoded); /* view-source:http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=3588406440001 http://progresive.lavozdegalicia.es/BCOVE/VTV/pd/2728142669001/201405/3588406440001/2728142669001_3588406440001_s-1.ts? http://videohdvtv-vh.akamaihd.net/BCOVE/VTV/hd/2728142669001/201405/2728142669001_3588398678001_PRG-VAYAVT4-0032.mp4 http://progresive.lavozdegalicia.es/BCOVE/VTV/hd/2728142669001/201405/2728142669001_3588398678001_PRG-VAYAVT4-0032.mp4 */ $base = $res_decoded['data']->getAMFData(); $base = $base['programmedContent']['videoPlayer']->getAMFData(); $base = $base['mediaDTO']->getAMFData(); $obtenido['enlaces'] = brightcove_genera_obtenido($this, $base, array('IOSRenditions' => 'm3u8', 'renditions' => 'http')); } finalCadena($obtenido); }
function SacarVideoPorId(&$entrada, $nombre = '') { //titulo if ($nombre === '') { //<div class="apartado"><h2>ARAGÓN NOTICIAS 1 - 05/05/2012 14:00</h2></div> $nombre = entre1y2($entrada, '<h1>', '<'); dbug('nombre. Obtenido en la web ID=' . $nombre); } else { dbug('nombre. Obtenido en la web padre=' . $nombre); } $res = $this->SacarVideo($entrada, $nombre); $res['titulo'] = $nombre; return $res; }
function calcula() { $obtenido = array('enlaces' => array()); preg_match("@([0-9]+?)(?:\\.html|-)@", $this->web, $matches); dbug_r($matches); if (!isset($matches[1]) || !is_numeric($matches[1])) { // http://granadacf.ideal.es/noticias/201410/20/entrenamiento-mucho-contenido-fisico-20141020130408.html // http://granadacf.ideal.es/modgen/?idModulo=rediseno2014/PPLL_playerVideoShowVideo&modoExtendido=player&idDivVideo=video_3849210620001_3092136624146_1_1413829041980&classVideo=story&widthVideo=490&heightVideo=490&idVideo=3849210620001&linkURLVideo=http%3A//www.ideal.es/videos/granadacf/201410/20/entrenamiento-mucho-contenido-fisico-3849210620001-mm.html&stillURLVideo=http%3A//www.ideal.es/noticias/201410/20/media/cortadas/entreno--490x490.jpg&medio=ideal&dominio=http%3A//www.ideal.es&location=granadacf.ideal.es&nameVideo=Entrenamiento%20con%20mucho%20contenido%20f%26iacute%3Bsico%20para%20iniciar%20la%20semana&shortDescriptionVideo=Entrenamiento%20con%20mucho%20contenido%20f%26iacute%3Bsico%20para%20iniciar%20la%20semana&creationDateMilisecondsVideo=1413821723&origenVideo=bc&capaModal=true&usoResizer=false&autoStartVideo=true&charset=WINDOWS-1252&authorVideo=STUDIO%20SUR&smoothingVideo=false&loid=30.9.2136624146&dispositivo=pc setErrorWebIntera("No se ha encontrado ningún vídeo."); return; } // http://www.ideal.es/videos/granada/noticias/1342041315001-02184-serie-tercer-premio-acera-darro.html $idVideo = $matches[1]; $datosBC = "http://modulos-mm.ideal.es/includes/manuales/videos/php/proxyModgen.php?idVideo=" . $idVideo . "&idModulo=VOC_playerVideoShowVideo&modoExtendido=player&idDivVideo=video&medio=ideal&origenVideo=bc"; $datosBC = CargaWebCurl($datosBC); dbug($datosBC); $publisherID = entre1y2($datosBC, '"publisherID" value="', '"'); $playerID = entre1y2($datosBC, '"playerID" value="', '"'); //$urlBC = 'http://c.brightcove.com/services/viewer/federated_f9?&flashID='.$matches[1].'-bcObject&playerID='.$playerID.'&publisherID='.$publisherID.'&%40videoPlayer='.$matches[2].'&isVid=true&isUI=true&linkBaseURL='.urlencode('http://www.hogarutil.com'.$matches[6]); //http://c.brightcove.com/services/messagebroker/amf?playerKey=AQ~~,AAAAEUA28vk~,ZZqXLYtFw-ADB2SpeHfBR3cyrCkvIrAe $messagebroker = "http://c.brightcove.com/services/messagebroker/amf?playerId=" . $playerID; include 'brightcove-funciones.php'; $a_encodear = array("target" => "com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience", "response" => "/1", "data" => array("0" => "ebcf49ebfaf7ae1b09cf79a1ab47c1286b3a0605", "1" => new SabreAMF_AMF3_Wrapper(new SabreAMF_TypedObject("com.brightcove.experience.ViewerExperienceRequest", array("TTLToken" => null, "deliveryType" => NAN, "URL" => $this->web, "experienceId" => $playerID, "playerKey" => null, "contentOverrides" => array("0" => new SabreAMF_TypedObject("com.brightcove.experience.ContentOverride", array("contentIds" => null, "contentRefId" => null, "contentRefIds" => null, "featuredRefId" => null, "contentType" => 0, "target" => "videoPlayer", "featuredId" => NAN, "contentId" => $idVideo)))))))); $post = brightcove_encode($a_encodear); //$test="AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAdAKAAAAAgIAKGViY2Y0OWViZmFmN2FlMWIwOWNmNzlhMWFiNDdjMTI4NmIzYTA2MDURCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdCFjb250ZW50T3ZlcnJpZGVzEVRUTFRva2VuGWRlbGl2ZXJ5VHlwZQdVUkwZZXhwZXJpZW5jZUlkE3BsYXllcktleQkDAQqBA1Njb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkNvbnRlbnRPdmVycmlkZRVjb250ZW50SWRzGWNvbnRlbnRSZWZJZBtjb250ZW50UmVmSWRzG2ZlYXR1cmVkUmVmSWQXY29udGVudFR5cGUNdGFyZ2V0FWZlYXR1cmVkSWQTY29udGVudElkAQEBAQQABhd2aWRlb1BsYXllcgV/////4AAAAAVCgOqrnL6IAAYBBX/////gAAAABoE/aHR0cDovL3d3dy5pZGVhbC5lcy92aWRlb3MvZ3JhbmFkYS9ub3RpY2lhcy8yMzI1MDEwOTQ2MDAxLWRpbGlnZW5jaWFzLXZ1ZWx2ZW4tdmFsbGUtbGVjcmluLmh0bWwFQlH8m6HwQAAGAQ=="; //dbug_r(brightcove_decode(base64_decode($test))); dbug('a descargar: ' . $messagebroker); /*$t=brightcove_curl_web("http://forestrf.no-ip.org/",$post); //borrar, es una prueba dbug_($t); exit;*/ $t = brightcove_curl_web($messagebroker, $post); dbug_($t); $res_decoded = brightcove_decode($t); dbug("PRIMERA RESPUESTA BRIGHTCOVE:"); dbug_r($res_decoded); $base = $res_decoded["data"]->getAMFData(); $base = $base['programmedContent']['videoPlayer']->getAMFData(); $base = $base['mediaDTO']->getAMFData(); dbug_r($base); $titulo = $base["linkText"]; $imagen = $base["videoStillURL"]; dbug('titulo = ' . $titulo); dbug('imagen = ' . $imagen); $obtenido['enlaces'] = brightcove_genera_obtenido($this, $base, array('IOSRenditions' => 'm3u8', 'renditions' => 'rtmp')); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
function calcula() { preg_match("@http://[^ ]*?\\.mp4@i", $this->web_descargada, $matches); $url = $matches[0]; $p = strpos($this->web_descargada, 'property="title"'); $titulo = entre1y2_a($this->web_descargada, $p, 'content="', '"'); $titulo = utf8_encode($titulo); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); //imagen $p = strpos($this->web_descargada, 'property="og:image"'); $imagen = entre1y2_a($this->web_descargada, $p, 'content="', '"'); dbug('imagen=' . $imagen); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); finalCadena($obtenido); }
function brightcove_genera_obtenido($dis = false, $base, $config, $titulo = '', $extraParams = false) { $obtenido2 = array(); foreach ($config as $pathBase => $tipoObtenido) { dbug($pathBase); $IOSRenditions = $base[$pathBase]; for ($i = 0, $i_t = count($IOSRenditions); $i < $i_t; $i++) { $temp = $IOSRenditions[$i]->getAMFData(); if ($dis !== false) { if (!$extraParams) { $parameters = array($temp, $tipoObtenido, &$obtenido2, $titulo); } else { $parameters = array($temp, $tipoObtenido, &$obtenido2, $titulo, &$extraParams); } call_user_func_array(array($dis, 'URLSDelArrayBrightCove'), $parameters); } else { if (!$extraParams) { URLSDelArrayBrightCove($temp, $tipoObtenido, $obtenido2, $titulo); } else { URLSDelArrayBrightCove($temp, $tipoObtenido, $obtenido2, $titulo, $extraParams); } } } } //ordenar usando ['calidad_ordenar'] for ($i = 0, $i_t = count($obtenido2) - 1; $i <= $i_t; $i++) { for ($j = $i + 1; $j <= $i_t; $j++) { //dbug("i:".$i." - j:".$j); if ($obtenido2[$i]['calidad_ordenar'] < $obtenido2[$j]['calidad_ordenar']) { $temp = $obtenido2[$i]; $obtenido2[$i] = $obtenido2[$j]; $obtenido2[$j] = $temp; } } } dbug_r($obtenido2); //borrar ['calidad_ordenar'] for ($i = 0, $i_t = count($obtenido2); $i < $i_t; $i++) { unset($obtenido2[$i]['calidad_ordenar']); } //sacar 'url-txt' a otro res de solo 'titulo' $obtenido_enlaces_temp = array(); for ($i = 0, $i_t = count($obtenido2); $i < $i_t; $i++) { $obtenido_enlaces_temp[] = $obtenido2[$i]; } return $obtenido_enlaces_temp; }
function calcula() { $retfull = CargaWebCurlProxy($this->web, 'ESP'); //titulo //<meta property="og:title" content="Alaska y Mario Episodio Extra - Pierrot"/> $p = strpos($retfull, 'og:title'); $titulo = entre1y2_a($retfull, $p, 'content="', '"'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); //imagen //<meta property="og:image" content="http://....jpg?height=106&quality=0.91"/> $p = strpos($retfull, 'og:image'); $imagen = entre1y2_a($retfull, $p, 'content="', '?'); if (enString($imagen, 'mtvnimages.com')) { $imagen = $imagen . '?height=180&quality=1'; } else { $imagen = substr($imagen, 0, strpos($imagen, '"')); } if ($imagen == '' || enString($imagen, '<')) { $imagen = entre1y2($retfull, 'rel="image_src" href="', '"'); } dbug('imagen=' . $imagen); //vid:"786779", $id = entre1y2($retfull, 'vid:"', '"'); dbug('id=' . $id); //http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri=mgid:uma:video:mtv.es:747606 $url = 'http://intl.esperanto.mtvi.com/www/xml/media/mediaGen.jhtml?uri=mgid:uma:video:mtv.es:' . $id; dbug('url=' . $url); $ret = CargaWebCurlProxy($url, 'ESP'); dbug($ret); //Por situación geográfica del servidor (supongo) da error. Usar pydowntv :( if (!enString($ret, 'copyright_error.flv')) { $extracto = entre1y2($ret, '<rendition', '<beacons>'); dbug('extracto=' . $extracto); $p = strrposF($extracto, '<src>'); $f = strpos($extracto, '<', $p); $url = substr($extracto, $p, $f - $p); } else { dbug('Usando pydowntv'); $ret = CargaWebCurl('http://www.pydowntv.com/api?url=' . $this->web); dbug($ret); $url = entre1y2($ret, '"url_video": ["', '"'); } $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'rtmpdump' => '-r "' . $url . '" -o "' . generaNombreWindowsValido($titulo) . '.' . (enString($url, '.mp4') ? 'mp4' : 'flv') . '"', 'tipo' => 'rtmpConcreto'))); finalCadena($obtenido); }
function calcula() { if (!enString($this->web_descargada, '<Form method="POST" action=\'\'>')) { setErrorWebIntera('No se encuentra ningún vídeo'); return; } $id = substr($this->web, strposF($this->web, 'played.to/')); dbug('id = ' . $id); $web_embedPlayedTo = 'http://played.to/embed-' . $id . '-640x360.html'; // $retfull = CargaWebCurl($web_embedPlayedTo, '', array('referer' => 'http://web.com')); $imagen = entre1y2($retfull, 'image: "', '"'); $titulo = entre1y2($this->web_descargada, '<h1 class="pagename">', '<'); // FALLA EN EL CALLBACK DEL SWF. EDITAR EL SWF $urlJS = 'function lanzaPlayedTo(){' . 'if(typeof DESCARGADOR_ARCHIVOS_SWF === "undefined"){' . 'setTimeout(lanzaPlayedTo, 200)' . '}' . 'else if(DESCARGADOR_ARCHIVOS_SWF === true){' . 'getFlashMovie("descargador_archivos").CargaWeb({' . '"url":"' . $web_embedPlayedTo . '",' . '"metodo":"GET"' . '}, "procesaPlayedTo2");' . '}' . '}' . 'function procesaPlayedTo2(txt){' . 'var url = txt.split("file: \\"")[1].split("\\"")[0];' . 'mostrarResultado(url);' . '}' . 'function mostrarResultado(entrada){' . 'finalizar(entrada,"Descargar");' . '}' . 'function mostrarFallo(){' . 'finalizar("","No se ha encontrado ningún resultado");' . '}' . 'if(typeof descargador_archivos === "undefined"){' . 'D.g("enlaces").innerHTML += \'' . genera_swf_object('/util/fla/f/http://played.to/') . '\';' . 'var descargador_archivos = D.g("descargador_archivos");' . '}' . 'lanzaPlayedTo();'; $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $urlJS, 'tipo' => 'jsFlash'))); finalCadena($obtenido); }
/** * Generate all FreePBX Main Style Sheets * @param {array} $variables = array() Array of variables to override */ public function generateMainStyles($variables = array()) { $this->FreePBX->Performance->Start("Less Parser Generate Main Styles"); $less_rel = '../'; $less_path = $this->FreePBX->Config->get('AMPWEBROOT') . '/admin/assets/less'; $varOverride = $this->FreePBX->Hooks->processHooks($variables); if (!empty($varOverride)) { foreach ($varOverride as $o) { $variables = array_merge($o, $variables); } } //compile these all into one giant file so that variables cross //"jq-ui-bootstrap" $less_dirs = array("freepbx", "schmooze-font"); $out = array(); $out['compiled_less_files'] = array(); foreach ($less_dirs as $dir) { $path = $less_path . "/" . $dir; if (is_dir($path)) { $files[$path . "/" . $dir . ".less"] = $less_rel; } } \Less_Cache::$cache_dir = $less_path . '/cache'; $filename = \Less_Cache::Get($files, array('compress' => true), $variables); try { $filename = \Less_Cache::Get($files, array('compress' => true), $variables); } catch (\Exception $e) { dbug($e); die_freepbx(sprintf(_('Can not write to cache folder at %s/cache. Please run (from the CLI): %s'), $dir, 'fwconsole chown')); } $out['compiled_less_files'][] = 'cache/' . $filename; $extra_less_dirs = array("buttons"); $out['extra_compiled_less_files'] = array(); foreach ($extra_less_dirs as $dir) { $path = $less_path . "/" . $dir; if (is_dir($path)) { $file = $this->getCachedFile($path, $less_rel, $variables); $out['extra_compiled_less_files'][$dir] = $dir . '/cache/' . $file; } } $this->FreePBX->Performance->Stop("Less Parser Generate Main Styles"); return $out; }
/** * Load View * * This function is used to load a "view" file. It has two parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. * * NOTE: you cannot use the variable $view_filename_protected in your views! * * @param string * @param array * @return string * */ function load_view($view_filename_protected, $vars = array()) { //return false if we cant find the file or if we cant open it if (!$view_filename_protected || !file_exists($view_filename_protected) || !is_readable($view_filename_protected)) { dbug('load_view failed to load view for inclusion:', $view_filename_protected); return false; } // Import the view variables to local namespace extract((array) $vars, EXTR_SKIP); // Capture the view output ob_start(); // Load the view within the current scope include $view_filename_protected; // Get the captured output $buffer = ob_get_contents(); //Flush & close the buffer ob_end_clean(); //Return captured output return $buffer; }
function calcula() { preg_match('@video.php\\?v=(.*?)$@', $this->web, $matches); dbug_r($matches); if (enString($matches[1], '.mp4')) { $url = 'http://www.tvmelilla.es/videoalacarta/' . $matches[1]; $imagen = strtr($url, array(".mp4" => ".jpg")); dbug('imagen = ' . $imagen); $titulo = utf8_encode(entre1y2($this->web_descargada, '<title>', '<')); dbug('titulo = ' . $titulo); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); } else { $vimeo = new Vimeo(); $vimeoURL = 'http://vimeo.com/' . $matches[1]; $vimeoWeb_descargada = CargaWebCurl($vimeoURL); $vimeo->init($vimeoURL, $vimeoWeb_descargada); $obtenido = $vimeo->calcula(); } finalCadena($obtenido); }
function calcula() { $obtenido = array('enlaces' => array()); if (preg_match('#<param.+?name="@videoPlayer".+?value="(.+?)"#', $this->web_descargada, $matches)) { $contentId = $matches[1]; } else { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } if (preg_match('#<param.+?name="playerID".+?value="(.+?)"#', $this->web_descargada, $matches)) { $experienceID = $matches[1]; } else { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } dbug('$contentId -> ' . $contentId); dbug('experienceID = playerId -> ' . $experienceID); $messagebroker = 'http://c.brightcove.com/services/messagebroker/amf?playerId=' . $experienceID; include 'brightcove-funciones.php'; $a_encodear = array('target' => 'com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience', 'response' => '/1', 'data' => array('0' => 'fcc17f21d09457d5e28d64c3dc0c0a3cb8863710', '1' => new SabreAMF_AMF3_Wrapper(new SabreAMF_TypedObject('com.brightcove.experience.ViewerExperienceRequest', array('contentOverrides' => array(new SabreAMF_TypedObject('com.brightcove.experience.ContentOverride', array('featuredRefId' => null, 'contentIds' => null, 'contentRefId' => null, 'contentType' => 0, 'target' => 'videoPlayer', 'contentRefIds' => null, 'featuredId' => NAN, 'contentId' => $contentId))), 'playerKey' => null, 'TTLToken' => null, 'deliveryType' => NAN, 'URL' => $this->web, 'experienceId' => $experienceID))))); $post = brightcove_encode($a_encodear); dbug('a descargar: ' . $messagebroker); $t = brightcove_curl_web($messagebroker, $post); dbug_($t); $res_decoded = brightcove_decode($t); dbug('PRIMERA RESPUESTA BRIGHTCOVE (enlaces de vídeos aquí):'); dbug_r($res_decoded); $base = $res_decoded['data']->getAMFData(); $base2 = $base['programmedContent']['videoPlayer']->getAMFData(); $base3 = $base2['mediaDTO']->getAMFData(); $titulo = $base3['displayName']; $titulo = limpiaTitulo($titulo); $imagen = $base3['videoStillURL']; dbug('titulo = ' . $titulo); dbug('imagen = ' . $imagen); $obtenido['enlaces'] = brightcove_genera_obtenido(false, $base3, array('IOSRenditions' => 'm3u8', 'renditions' => 'rtmpConcreto'), $titulo); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
function calcula() { $obtenido = array('enlaces' => array()); //http://c.brightcove.com/services/viewer/federated_f9?&flashID=ms-player2-continuo-bcObject&playerID=2418571368001&publisherID=2385340627001&%40videoPlayer=2875076343001&isVid=true&isUI=true&linkBaseURL=".urlencode() $patron = '@GENERAL.videoBrightcove.*?\\(.*?"(.*?)".*?,.*?"(.*?)"@i'; preg_match($patron, $this->web_descargada, $matches); dbug_r($matches); if (!isset($matches[2]) || !is_numeric($matches[2])) { setErrorWebIntera("No se ha encontrado ningún vídeo."); return; } $contentId = $matches[2]; $publisherID = 2385340627001; $playerID = 2418571368001; //$urlBC = 'http://c.brightcove.com/services/viewer/federated_f9?&flashID='.$matches[1].'-bcObject&playerID='.$playerID.'&publisherID='.$publisherID.'&%40videoPlayer='.$matches[2].'&isVid=true&isUI=true&linkBaseURL='.urlencode('http://www.hogarutil.com'.$matches[6]); //http://c.brightcove.com/services/messagebroker/amf?playerKey=AQ~~,AAAAEUA28vk~,ZZqXLYtFw-ADB2SpeHfBR3cyrCkvIrAe $messagebroker = "http://c.brightcove.com/services/messagebroker/amf?playerId=" . $playerID; include 'brightcove-funciones.php'; $a_encodear = array("target" => "com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience", "response" => "/1", "data" => array("0" => "8ea8d3dc9fe7f3763119fb54107e6b5f814b876f", "1" => new SabreAMF_AMF3_Wrapper(new SabreAMF_TypedObject("com.brightcove.experience.ViewerExperienceRequest", array("TTLToken" => null, "deliveryType" => NAN, "playerKey" => "", "URL" => $this->web, "experienceId" => $playerID, "contentOverrides" => array("0" => new SabreAMF_TypedObject("com.brightcove.experience.ContentOverride", array("target" => "videoPlayer", "featuredId" => NAN, "contentType" => 0, "contentId" => $contentId, "featuredRefId" => null, "contentIds" => null, "contentRefId" => null, "contentRefIds" => null)))))))); $post = brightcove_encode($a_encodear); dbug('a descargar: ' . $messagebroker); $t = brightcove_curl_web($messagebroker, $post); dbug($t); $res_decoded = brightcove_decode($t); dbug("PRIMERA RESPUESTA BRIGHTCOVE:"); dbug_r($res_decoded); $base = $res_decoded["data"]->getAMFData(); $base = $base['programmedContent']['videoPlayer']->getAMFData(); $base = $base['mediaDTO']->getAMFData(); dbug_r($base); $titulo = $base["displayName"]; $imagen = $base["videoStillURL"]; dbug('titulo = ' . $titulo); dbug('imagen = ' . $imagen); $obtenido['enlaces'] = brightcove_genera_obtenido(false, $base, array('IOSRenditions' => 'm3u8', 'renditions' => 'rtmpConcreto'), $titulo); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; $obtenido['descripcion'] = $base["longDescription"]; finalCadena($obtenido, false); }
function calcula() { //mirar si hay video $obtenido = array(); if (!enString($this->web_descargada, '_w320.jpg')) { return; } $p = strpos($this->web_descargada, 'og:image'); $imagen = entre1y2_a($this->web_descargada, $p, 'content="', '"'); dbug('imagen=' . $imagen); $id = entre1y2($imagen, strrposF($imagen, '/'), "_w320.jpg"); dbug('id=' . $id); // Problemas con geobloqueo. //$ret=CargaWebCurl(urldecode(entre1y2($this->web_descargada, "'file': '", "'"))); //$ret=CargaWebCurl('http://www.adnstream.com/get_playlist.php?lista=video¶m='.$id); $ret = CargaWebCurl('http://proxyanonimo.es/browse.php?u=' . urlencode('http://www.adnstream.com/get_playlist.php?lista=video¶m=' . $id) . '&b=12&f=norefer', '', 0, '', array('Referer: http://proxyanonimo.es/')); dbug_($ret); $titulo = entre1y2($ret, '<title>', '<'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $descripcion = entre1y2($ret, '<description>', '<'); dbug('descripcion=' . $descripcion); if (enString($ret, 'hd.file>')) { $ret = entre1y2($ret, 'hd.file>', '<'); } elseif (enString($ret, 'file>')) { $ret = entre1y2($ret, 'file>', '<'); } else { $p = strpos($ret, 'http://'); $f = strpos($ret, '<', $p); $ret = substr($ret, $p, $f - $p); } if (enString($ret, '.flv')) { $ret = substr($ret, 0, strrposF($ret, '/')) . $id . '.H264-480p.mp4'; $ret = 'http://176.31.233.154' . substr($ret, strpos($ret, '/', 10)); } $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'descripcion' => $descripcion, 'enlaces' => array(array('url' => $ret, 'tipo' => 'http'))); finalCadena($obtenido); return $obtenido; }
function parsefragment(&$arr, $html, $titulo, $multiple = false) { //rtmp://media1.crtvg.es:80/vod $p = strpos($html, 'clip:'); if (!$p) { $p = strposF($html, '"clip":'); } $p = strpos($html, 'url:', $p); if (!$p) { $p = strposF($html, '"provider":"rtmp","url":'); } $url = entre1y2_a($html, $p, '"', '"'); $url = str_replace('\\', '', $url); dbug('url=' . $url); //netConnectionUrl: "rtmp://media1.crtvg.es:80/vod" $p = strpos($html, 'netConnectionUrl:'); if (!$p) { $p = strposF($html, '"netConnectionUrl":'); } $preurl = entre1y2_a($html, $p, '"', '"'); $preurl = str_replace('\\', '', $preurl); dbug('$preurl=' . $preurl); //ipadUrl: "http:// m3u8" $p = strpos($html, 'ipadUrl:'); if (!$p) { $p = strposF($html, '"ipadUrl":'); } $ipadUrl = entre1y2_a($html, $p, '"', '"'); $ipadUrl = str_replace('\\', '', $ipadUrl); dbug('$ipadUrl=' . $ipadUrl); if ($multiple) { $arr[] = array('titulo' => $titulo); } $arr[] = array('url' => ' ', 'rtmpdump' => '-r "' . $preurl . '" -y "' . $url . '" -o "' . generaNombreWindowsValido($titulo) . '.mp4"', 'tipo' => 'rtmpConcreto'); if (strlen($ipadUrl) > 10) { $arr[] = array('url' => $ipadUrl, 'tipo' => 'm3u8'); } }
function calcula() { if (preg_match("@playlist[\\s\\S]*?image.*?'([\\s\\S]*?)'[\\s\\S]*?sources[\\s\\S]*?'(http://.*?)'@i", $this->web_descargada, $matches)) { dbug_r($matches); $url = $matches[2]; dbug($url); $imagen = $matches[1]; dbug('imagen=' . $imagen); } elseif (preg_match("@['\"](https?://.+?token=.+?)['\"]@i", $this->web_descargada, $matches)) { dbug_r($matches); $url = $matches[1]; dbug($url); preg_match("@thumbail['\"].*?:.*?['\"](.+?)['\"]@i", $this->web_descargada, $matches); dbug_r($matches); $imagen = $matches[1]; dbug('imagen=' . $imagen); } $titulo = entre1y2($this->web_descargada, '<title>', '</title>'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'url_txt' => 'Descargar', 'tipo' => 'http'))); finalCadena($obtenido); }
function calcula() { //get the music_id $ari = explode("/", $this->web); $v_id = array_pop($ari); dbug("http://www.veoh.com/rest/video/" . $v_id . "/details"); //retrieve xml files $this->web_descargada = CargaWebCurl("http://www.veoh.com/rest/video/" . $v_id . "/details"); $c = strpos($this->web_descargada, "videoId"); //titulo $titulo = entre1y2_a($this->web_descargada, $c, 'title="', '"'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); //imagen $imagen = entre1y2_a($this->web_descargada, $c, 'fullHighResImagePath="', '"'); dbug('imagen=' . $imagen); $url = entre1y2_a($this->web_descargada, $c, 'fullPreviewHashPath="', '"'); //yell it loud $url = trim($url); dbug($url); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'url_txt' => 'Descargar', 'tipo' => 'http'))); finalCadena($obtenido); }