function calcula() { $obtenido = array('enlaces' => array()); if (strpos($this->web, 'http://player.vimeo.com/video/') === 0) { $ret = desde1a2($this->web_descargada, '{"', ';'); $json_respuesta = json_decode($ret, true); } else { $ret = CargaWebCurl('http://player.vimeo.com/video/' . html_entity_decode(entre1y2($this->web_descargada, 'http://player.vimeo.com/video/', '"'))); $json_respuesta = json_decode($ret, true); } dbug_r($json_respuesta); $opciones = $json_respuesta['request']['files']['h264']; dbug_r($opciones); if (count($opciones) == 3 && isset($opciones['mobile']) && isset($opciones['hd']) && isset($opciones['sd'])) { $obtenido['enlaces'][] = array('url' => $opciones['hd']['url'], 'url_txt' => "Calidad: Alta", 'tipo' => 'http'); $obtenido['enlaces'][] = array('url' => $opciones['sd']['url'], 'url_txt' => "Calidad: Media", 'tipo' => 'http'); $obtenido['enlaces'][] = array('url' => $opciones['mobile']['url'], 'url_txt' => "Calidad: Baja", 'tipo' => 'http'); } else { foreach ($opciones as $index => $elem) { $obtenido['enlaces'][] = array('url' => $elem['url'], 'url_txt' => "Calidad: " . $index, 'tipo' => 'http'); } } $titulo = $json_respuesta['video']['title']; $titulo = limpiaTitulo($titulo); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = current($json_respuesta['video']['thumbs']); finalCadena($obtenido); return $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); }
function forshared() { global $web; $res = CargaWebCurl('http://search.4shared.com/q/CCQD/1/music/' . urlencode($web)); //recortar a solo los enlaces $p = strposF($res, '"listView res_table"'); $f = strpos($res, '"writeDragMain"', $p); $res = substr($res, $p, $f - $p); $resultados = array('buscador' => '4shared.com', 'enlaces' => array()); $p1 = 0; for ($i = 0; $i < 10 && ($p1 = strpos($res, '<tr valign="top" >', $p1)); $i++) { $p1++; //tamaño $p = strposF($res, '<div class="fsize">', $p1); $f = strpos($res, '</div>', $p); $tam = substr($res, $p, $f - $p); $tam = trim(strtr($tam, array("\n" => "", " " => "", "," => "", "KB" => ""))); $tam = (double) $tam / 1024; $tam = substr($tam, 0, strpos($tam, ".") + 2); //título $p = strpos($res, 'mp3.png', $p1); $p = strposF($res, 'title="', $p); $f = strpos($res, '"', $p); $tit = substr($res, $p, $f - $p); $tit = trim(strtr($tit, array("\n" => ""))); //url $p = strposF($res, "showMediaPreview(event, '", $p1); $f = strpos($res, "'", $p); $url = substr($res, $p, $f - $p); $r = array('url' => $url, 'titulo' => $tit, 'peso' => $tam); $resultados['enlaces'][] = $r; } dbug_r($resultados); return $resultados; }
function soso() { global $web; $res = CargaWebCurl('http://cgi.music.soso.com/fcgi-bin/m.q?p=1&source=1&t=1&w=' . urlencode($web)); //recortar a solo los enlaces $p = strposF($res, '<div id="results_box">'); $f = strpos($res, 'id="right_box"', $p); $res = substr($res, $p, $f - $p); $resultados = array('buscador' => 'soso.com', 'enlaces' => array()); $p1 = 0; for ($i = 0; $i < 20 && ($p1 = strpos($res, 'onmouseover="soso.ie6hover(this,1)"', $p1)); $i++) { $p1++; //url $p = strposF($res, '<td class="data">', $p1); $p = strposF($res, 'FI', $p); $f = strpos($res, ";", $p); $url = substr($res, $p, $f - $p); if (!enString($url, "qqmusic.qq.com")) { //título $p = strposF($res, 'class="s_name">', $p1); $f = strpos($res, '</a>', $p); $tit = strip_tags(substr($res, $p, $f - $p)); //peso $p = strposF($res, '<td class="size">', $p1); $f = strpos($res, "</", $p); $peso = substr($res, $p, $f - $p); $peso = trim(strtr($peso, array("M" => ""))); $r = array('url' => $url, 'titulo' => $tit, 'peso' => $peso, 'preview' => 1); $resultados['enlaces'][] = $r; } } dbug_r($resultados); return $resultados; }
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() { //$url = "http://www.crunchyroll.com/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id={$id}&video_format={$format}&video_quality={$quality}&auto_play=1&aff=crunchyroll-website&show_pop_out_controls=1&pop_out_disable_message=Only+All-Access+Members+and+Anime+Members+can+pop+out+this+video.+Get+your+membership+today%21"; if (POST_BM) { $ret = $this->web_descargada; } else { if (!enString($this->web_descargada, '"config_url":"')) { define('IGNORA_AVISO_RAPIDO', true); setErrorWebIntera(USE_BOOKMARKLET_2); return; } $url = entre1y2($this->web_descargada, '"config_url":"', '"'); $url = urldecode($url); /* $url = "http://www.crunchyroll.com/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=649575&video_format=106&video_quality=60&auto_play=1&aff=crunchyroll-website&show_pop_out_controls=1&pop_out_disable_message=Only+All-Access+Members+and+Anime+Members+can+pop+out+this+video.+Get+your+membership+today%21"; $post = "current%5Fpage=http%3A%2F%2Fwww%2Ecrunchyroll%2Ecom%2Fkill%2Dla%2Dkill%2Fepisode%2D24%2Dpast%2Dthe%2Dinfinite%2Ddarkness%2D649575%3Fp480%3D1"; $ret = CargaWebCurl($url, $post, 0, '', array('Content-type: application/x-www-form-urlencoded')); dbug_($ret); */ $post = "current%5Fpage=" . urlencode($this->web); $ret = CargaWebCurl($url, $post, 0, '', array('Content-type: application/x-www-form-urlencoded')); } dbug_($ret); $titulo = entre1y2($ret, '<series_title>', '</') . ' - ' . entre1y2($ret, '<episode_title>', '</'); $obtenido = array('titulo' => $titulo, 'imagen' => entre1y2($ret, '<episode_image_url>', '</'), 'enlaces' => array(array('url' => '-', 'rtmpdump' => '-r "' . entre1y2($ret, '<host>', '</') . '" ' . '-y "' . entre1y2($ret, '<file>', '</') . '"', 'nombre_archivo' => generaNombreWindowsValido($titulo) . '.mp4', 'tipo' => 'rtmpConcreto', 'extension' => 'mp4'))); 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 emp3world() { global $web; $res = CargaWebCurl('http://www.emp3world.com/r.php?submit=Search&phrase=' . urlencode($web)); //recortar a solo los enlaces $p = strposF($res, '<div id="results_box">'); $f = strpos($res, 'id="right_box"', $p); $res = substr($res, $p, $f - $p); $resultados = array('buscador' => 'emp3world.com', 'enlaces' => array()); $p1 = 0; for ($i = 0; $i < 10 && ($p1 = strpos($res, 'class="song_item"', $p1)); $i++) { $p1++; //título $p = strposF($res, '<span id="song_title">', $p1); $f = strpos($res, '</span', $p); $tit = trim(strtr(substr($res, $p, $f - $p) . "@@", array("mp3@@" => ""))); //url $p = strposF($res, 'class="play_link"', $p1); $f = strpos($res, "</div", $p); $url = substr($res, $p, $f - $p); $p = strrposF($url, '<a href="'); $f = strpos($url, '"', $p); $url = substr($url, $p, $f - $p); //peso $p = strposF($res, 'class="song_size">', $p1); $f = strpos($res, "</div", $p); $peso = substr($res, $p, $f - $p); $peso = trim(strtr($peso, array("MB" => ""))); $r = array('url' => $url, 'titulo' => $tit, 'peso' => $peso, 'preview' => 1); $resultados['enlaces'][] = $r; } dbug_r($resultados); return $resultados; }
function calculacom() { //titulo //<meta property="og:title" content="Alaska y Mario Episodio Extra - Pierrot"/> $p = strpos($this->web_descargada, 'og:title'); $titulo = entre1y2_a($this->web_descargada, $p, 'content="', '"'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); //imagen //<meta property="og:image" content="http://....jpg?height=106&quality=0.91"/> $p = strpos($this->web_descargada, 'og:image'); $imagen = entre1y2_a($this->web_descargada, $p, 'content="', '?'); if (enString($imagen, 'mtvnimages.com')) { $imagen = $imagen . '?height=180&quality=1'; } else { $imagen = substr($imagen, 0, strpos($imagen, '"')); } dbug('imagen=' . $imagen); //en la página /* http://www.eitb.com/es/videos/detalle/1258848/video-meteorito-rusia--mas-100-heridos-al-caer-meteorito/ detalle_video_1258848 http://www.eitb.com/es/get/multimedia/video/id/1258848/size/grande/ <media:content url="http://hdstreameitb-f.akamaihd.net/z/multimediahd/videos/2013/02/15/1045086/20130215_15532024_0005703037_001_001____T1_METEOR.mp4/manifest.f4m" type="video/x-flv"/> http://www.eitb.com/multimediahd/videos/2013/02/15/1045086/20130215_15532024_0005703037_001_001____T1_METEOR.mp4 http://www.eitb.com/multimedia/videos/2011/10/24/558362/PIRINEOS_ES_20111024_101408.flv */ if (preg_match('/<div.+?class="player">/', $this->web_descargada)) { if (!enString($this->web_descargada, 'detalle_video_')) { setErrorWebIntera('No se puede encontrar ningún vídeo.'); return; } $p = strpos($this->web_descargada, '<div class="player">'); $id = entre1y2_a($this->web_descargada, $p, 'detalle_video_', '"'); dbug('id=' . $id); } elseif (enString($this->web_descargada, 'insertar_player_video(')) { $id = entre1y2($this->web_descargada, 'insertar_player_video(', ','); dbug('id=' . $id); } $ret = CargaWebCurl('http://www.eitb.com/es/get/multimedia/video/id/' . $id . '/size/grande/'); $imagen = entre1y2($ret, 'thumbnail url="', '"'); if (enString($ret, 'manifest.f4m')) { $p = strpos($ret, '<media:content url="'); //$p=strpos($ret,'url="',$p); $url = 'http://www.eitb.com/' . entre1y2_a($ret, $p, 'z/', '/manifest.f4m'); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); } elseif (enString($ret, '.mp4') || enString($ret, '.flv')) { $url = 'http://www.eitb.com/' . entre1y2($ret, '<media:content url="', '"'); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http', 'extension' => substr($url, -3, 3)))); } //a la carta: Ni idea /* http://www.eitb.tv/es/#/video/2142574288001 http://www.eitb.tv/es/get/videoplaylist/2142574288001/ */ finalCadena($obtenido); }
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 calcula() { /* "clip":{"url":"mp4:/_archivos/videos/web/4334/4334.mp4"} "netConnectionUrl":"rtmp://alacarta.aragontelevision.es/vod" "playlist":[{"url":"mp4:/_archivos/videos/web/4334/4334.mp4"}] http://alacarta.aragontelevision.es/_archivos/videos/web/4334/4334.mp4 */ $imagen = 'http://www.' . DOMINIO . '/canales/aragontv.png'; $obtenido = array('enlaces' => array()); //un solo video if (enString($this->web_descargada, 'flowplayer(')) { dbug('simple'); $titulo = entre1y2($this->web_descargada, '<div class="apartado"><h2>', '</h2>'); $titulo = limpiaTitulo($titulo); if (stringContains($titulo, array('</', 'Server:'))) { dbug('titulo fallido, usando <title>'); $titulo = entre1y2($this->web_descargada, '<title>', '</'); $titulo = limpiaTitulo($titulo); } dbug('titulo=' . $titulo); $obtenido['enlaces'][] = $this->SacarVideo($this->web_descargada, $titulo); } elseif (enString($this->web_descargada, 'list-not-even')) { dbug('multi'); $p = strpos($this->web_descargada, '<div class="apartado">'); $titulo = entre1y2_a($this->web_descargada, $p, '<h2>', '</h2>'); //en la pagina principal y otras el titulo estará mal, por lo que poner uno genérico if (enString($titulo, '<')) { $titulo = 'Aragon TV'; } $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $videos = substr_count($this->web_descargada, '<span>Ver video</span>'); dbug('total videos=' . $videos); $last = 0; for ($i = 0; $i < $videos; $i++) { $last = strposF($this->web_descargada, '<div id="idv', $last); $url = 'http://alacarta.aragontelevision.es/ajax/ajax.php?id=' . entre1y2_a($this->web_descargada, $last, '_', '"'); //encontrar ya el titulo del vídeo $f = strpos($this->web_descargada, 'fecha', $last); $parte = substr($this->web_descargada, $last, $f - $last); $p = strrpos($parte, '<a'); $nombre = entre1y2_a($parte, $p, 'title="', '"'); $extracto = CargaWebCurl($url); $obtenido['enlaces'][] = $this->SacarVideoPorId($extracto, $nombre); } } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
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() { //title: "Matalobos quotAno 1 A familiaquot", $titulo = entre1y2($this->web_descargada, '<title>', '<'); if (enString($titulo, ' |')) { $titulo = entre1y2($titulo, 0, ' |'); } $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); if (enString($this->web_descargada, "id=\$(this).attr('id').split('|');")) { dbug('modo 1'); preg_match("#url:.*?'(.*?)',#i", $this->web_descargada, $matches); dbug_r($matches); $url = $matches[1]; if ($url[0] === '/') { $url = 'http://www.crtvg.es' . $url; } else { if ($url[0] !== 'h') { $url = substr($this->web, 0, strrposF($this->web, '/')) . $url; } } dbug_r($url); preg_match_all("#<div class='cap' id='([0-9]+?)\\|([0-9]+?)'>#", $this->web_descargada, $matches); dbug_r($matches); $obtenido = array('titulo' => $titulo, 'imagen' => '/canales/tvg.jpg', 'enlaces' => array()); for ($i = 0, $i_t = count($matches[0]); $i < $i_t; $i++) { $ret = CargaWebCurl($url, 'idSerie=' . $matches[1][$i] . '&idCapitulo=' . $matches[2][$i]); //dbug_($ret); $tit = entre1y2($ret, '<div id="titulo">', '</div'); $tit = strip_tags($tit); $this->parsefragment($obtenido['enlaces'], $ret, $tit, true); } } else { dbug('modo 2'); //backgroundImage: "url(http://www.crtvg.es/files/web/000020120911000003.jpg)" if (enString($this->web_descargada, 'backgroundImage:')) { $p = strpos($this->web_descargada, 'backgroundImage:'); $imagen = entre1y2_a($this->web_descargada, $p, 'url(', ')'); } else { $imagen = entre1y2($this->web_descargada, '"playlist":[{"url":"', '"'); $imagen = str_replace('\\', '', $imagen); } dbug('imagen=' . $imagen); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array()); $this->parsefragment($obtenido['enlaces'], $this->web_descargada, $titulo); } finalCadena($obtenido); }
function soundcloud() { global $web; $client_id = "b45b1aa10f1ac2941910a7f0d10f8e28"; $res = CargaWebCurl('https://api.sndcdn.com/search/sounds?facet=genre&limit=10&offset=0&linked_partitioning=1&client_id=' . $client_id . '&q=' . urlencode($web)); $resultados = array('buscador' => 'soundcloud.com', 'enlaces' => array()); $p1 = 0; for ($i = 0; $i < 10 && ($p1 = strpos($res, '"kind":"track"', $p1)); $i++) { //streamable? $p = strposF($res, '"streamable":', $p1); $f = strpos($res, ',', $p); $streamable = substr($res, $p, $f - $p); if ($streamable == "true") { //url $p = strposF($res, '"id":', $p1); $f = strpos($res, ",", $p); $modoUrl = "stream"; $url = 'http://api.soundcloud.com/tracks/' . substr($res, $p, $f - $p) . '/' . $modoUrl . '?client_id=' . $client_id; //título $p = strposF($res, '"title":"', $p1); $f = strpos($res, '"', $p); $tit = utf8_encode(jsonRemoveUnicodeSequences(substr($res, $p, $f - $p))); //duración $p = strposF($res, '"duration":', $p1); $f = strpos($res, ',', $p); $duracion = (double) substr($res, $p, $f - $p) / 1000; $min = (int) ($duracion / 60); $seg = $duracion - $min * 60; $seg = substr($seg, 0, 2); while (enString($seg, ".")) { $seg = "0" . substr($seg, 0, 1); } $duracion = $min . ":" . $seg; //peso /*$p=strposF($res,'"original_content_size":',$p1); $f=strpos($res,",",$p); $tam=substr($res,$p,$f-$p); $tam=((float)$tam)/1048576; $tam=substr($tam,0,strpos($tam,".")+2);*/ $r = array('url' => $url, 'titulo' => $tit, 'duracion' => $duracion, 'preview' => 1); $resultados['enlaces'][] = $r; } $p1++; } dbug_r($resultados); return $resultados; }
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() { preg_match('@/[a-z]/[0-9]+@', $this->web, $matches); dbug_r($matches); $url = 'https://api.twitch.tv/api/videos/' . str_replace('/', '', $matches[0]) . '?as3=t'; dbug_($url); $json = CargaWebCurl($url); $json = json_decode($json, true); dbug_r($json); $obtenido = array('titulo' => entre1y2($this->web_descargada, 'title>', '</') . ' | [' . $json['start_offset'] . '->' . $json['end_offset'] . ']', 'imagen' => $json['preview'], 'enlaces' => array()); $suma = 0; foreach ($json['chunks']['live'] as $url) { $suma += $url['length']; $obtenido['enlaces'][] = array('url' => $url['url'], 'tipo' => 'http', 'url_txt' => $suma); } 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); }
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() { $url = 'http://mmp.streamuk.com//api_v3/index.php?service=multirequest&action=null&kalsig=f5bf715cb3bf8c099fc8a26b3ffc8ecc'; $post = "Referer: http://open.http.mmp.streamuk.com/p/2000092/sp/200009200/flash/kdp3/v3.9.3.3.1.31/kdp3.swf\r\n" . "Content-type: application/x-www-form-urlencoded\r\n" . "Content-length: 728\r\n" . urlencode("2:action=getContextData&" . "2:contextDataParams:objectType=KalturaEntryContextDataParams&" . "3:filter:objectType=KalturaCuePointFilter&" . "3:action=list&" . "ignoreNull=1&" . "2:contextDataParams:streamerType=rtmp&" . "2:contextDataParams:referrer={$this->web}&" . "2:entryId=0_ln0d3cfl&" . "1:entryId=0_ln0d3cfl&" . "apiVersion=3.1.5&" . "1:service=baseentry&" . "ks=" . base64_encode("d2e000426e5d32a45a4eb1f30e26a5a2238ee163|2000092;2000092;1413585766;0;1413499366.0907;0;view:*,widget:1;;") . "&" . "3:filter:entryIdEqual=0_ln0d3cfl&" . "1:action=get&" . "3:service=cuepoint_cuepoint&" . "2:service=baseentry&" . "1:version=-1&" . "clientTag=kdp:v3.9.3,cache_st:1405425098"); $ret = CargaWebCurl($url, $post); if (enString($this->web_descargada, "mp4:")) { //http://www.intereconomia.com/sites/default/files/videos/rosa_paya.mp4 $url = "http://www.intereconomia.com/sites/default/files/videos/" . entre1y2($this->web_descargada, 'mp4:', '.mp4') . '.mp4'; } elseif (enString($this->web_descargada, "mp3:")) { $url = "http://www.intereconomia.com/sites/default/files/videos/" . entre1y2($this->web_descargada, 'mp3:', '.mp3') . '.mp3'; } //titulo $titulo = entre1y2($this->web_descargada, "'Start','", "'"); //imagen $p = strpos($this->web_descargada, '/sites/default/files/imagecache/'); $f = strposF($this->web_descargada, '.', $p) + 3; //así se soporta .jpg y .gif $imagen = "http://www.intereconomia.com" . substr($this->web_descargada, $p, $f - $p); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => $url, 'tipo' => 'http'))); finalCadena($obtenido); }
function goear() { global $web; $res = CargaWebCurl('http://www.goear.com/search/' . urlencode($web) . '/'); //recortar a solo los enlaces $p = strposF($res, 'id="search_results"'); $f = strpos($res, '</ol', $p); $res = substr($res, $p, $f - $p); $resultados = array('buscador' => 'goear.com', 'enlaces' => array()); $p1 = 0; for ($i = 0; $i < 10 && ($p1 = strpos($res, '<li>', $p1)); $i++) { $p1++; //título $p = strpos($res, '<a', $p1); $p = strposF($res, '>', $p); $f = strpos($res, '</a', $p); $tit = substr($res, $p, $f - $p); $tit = strip_tags($tit); //url $p = strposF($res, "http://www.goear.com/listen/", $p1); $f = strpos($res, "/", $p + 1); $id = substr($res, $p, $f - $p); $url = buscaMP3($id); //bitrate $p = strpos($res, '<li class="kbps', $p1); $p = strposF($res, '>', $p); $f = strpos($res, "<", $p); $bitrate = substr($res, $p, $f - $p); //duración $p = strpos($res, '<li class="length', $p1); $p = strposF($res, '>', $p); $f = strpos($res, "</li", $p); $duracion = substr($res, $p, $f - $p); $duracion = trim($duracion); $r = array('url' => $url, 'titulo' => $tit, 'bitrate' => $bitrate, 'duracion' => $duracion, 'preview' => 1); $resultados['enlaces'][] = $r; } dbug_r($resultados); return $resultados; }
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 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); }
function calcula() { $obtenido = array('enlaces' => array()); $pageId = substr($this->web, strrposF($this->web, '/')); dbug_($pageId); if (preg_match('#"pageId":"' . $pageId . '".+?"urls":\\[(.+?)[,\\]]#', $this->web_descargada, $matches)) { $jsonurl = $matches[1]; } else { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } dbug_($jsonurl); $jsonurl = json_decode($jsonurl, true); dbug_($jsonurl); $json = CargaWebCurl($jsonurl); dbug_($json); $json2 = json_decode($json, true); $titulo = $json2['title']; // http://www.arucitys.com.usrfiles.com/html/5eb649_d2c495cc1c5e09ffcb959aa180074c3d.html $html = desde1a2($json, '"html/', '"', true); $html = json_decode($html, true); $html = 'http://www.arucitys.com.usrfiles.com/' . $html; dbug_($html); $html = CargaWebCurl($html); dbug_($html); $app_flash = trim(entre1y2($html, 'app_flash=', '&')); dbug_($app_flash); $ubicacion_fichero = trim(entre1y2($html, 'ubicacion_fichero=', '&')); dbug_($ubicacion_fichero); $rtmpbase = 'rtmp://178.33.166.26/' . $app_flash; $rtmp = $rtmpbase . '/mp4:' . $ubicacion_fichero; $obtenido['enlaces'] = array(array('url' => $rtmp, 'rtmpdump' => '-r "' . $rtmpbase . '" -y "' . $ubicacion_fichero . '" -o "' . generaNombreWindowsValido($titulo) . '.mp4"', 'url_txt' => 'Descargar', 'tipo' => 'rtmpConcreto')); $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
function de_cipher_yt($html, $si) { //dbug('$si = '.$si); $js_decipher = 'http://s.ytimg.com/yts/jsbin/html5player-' . strtr(entre1y2($html, 'html5player-', '"'), array('\\' => '')); //$js_decipher = 'http://s.ytimg.com/yts/jsbin/html5player-'.$this->CIPHER_TEST[0].'.js'; dbug('$js_decipher = ' . $js_decipher); $js_decipher_contenido = CargaWebCurl($js_decipher); // El contenido de $js_decipher_contenido es demasiado grande para imprimirlo, por no tengo idea qué razón $js_decipher_contenido = strtr($js_decipher_contenido, array("\n" => '')); $expr = '@([a-zA-Z])=[a-zA-Z\\.]+?\\.split\\(""\\).*?\\}+@'; preg_match($expr, $js_decipher_contenido, $matches, PREG_OFFSET_CAPTURE); dbug_r($matches); if (count($matches) > 0) { $var = $matches[1][0]; dbug('$var=' . $var); $instrucciones_raw = $matches[0][0] . ';'; // Identificar funciones. Ver si están cerca. $txt_cerca = substr($js_decipher_contenido, $matches[0][1] - 500, 500); dbug($txt_cerca); $funciones = array(); $expr = '@([a-zA-Z][a-zA-Z0-9]{1,3})[:=]function\\(.*?\\){(.+?)}@'; preg_match_all($expr, $txt_cerca, $m); dbug('$m'); dbug_r($m); for ($i = 0, $i_t = count($m[0]); $i < $i_t; $i++) { if (strpos($m[2][$i], 'lice') !== false) { $funciones[$m[1][$i]] = 'slice'; } elseif (strpos($m[2][$i], 'reverse') !== false) { $funciones[$m[1][$i]] = 'reverse'; } elseif (strpos($m[2][$i], 'var c=a[0];a[0]=a[b%a.length];a[b]=c') !== false) { $funciones[$m[1][$i]] = 'switch'; } } dbug_r($funciones); preg_match_all('@(.*?)(,' . $var . '|;)@', $instrucciones_raw, $matches); //dbug_r($matches); foreach ($matches[1] as $orden) { dbug($orden); if (enString($orden, 'split')) { continue; } foreach ($funciones as $o => $f) { if (strpos($orden, $o) !== false) { switch ($f) { case 'slice': preg_match('@\\(.*?(\\d+)@', $orden, $n); $this->y_slice($si, $n[1]); break; case 'reverse': $this->y_reverse($si); break; case 'switch': preg_match('@\\(.*?(\\d+)@', $orden, $n); $this->y_switch($si, $n[1]); break; default: break; } continue 2; } } if (enString($orden, 'slice')) { $this->y_slice($si, intval(entre1y2($orden, '(', ')'))); continue; } elseif (preg_match('@\\(' . $var . ',(\\d+?)\\)@', $orden, $res)) { $this->y_switch($si, $res[1]); continue; } elseif (preg_match('@\\[(\\d+?)%' . $var . '.length\\]@', $orden, $res)) { dbug('switch sin función: ' . $b); $this->y_switch($si, $res[1]); continue; } elseif (enString($orden, 'reverse')) { $this->y_reverse($si); continue; } } return $si; } return false; }
function calcula() { /* // Nada de vídeos con filtro parental because adsense if(!enString($this->web_descargada, 'sequence=')){ dbug('Desactivando filtro familiar'); $this->web_descargada = CargaWebCurl($this->web,'','','ff=off'); } */ if (strpos($this->web, 'http://www.dailymotion.com/embed/') === 0) { dbug('embed'); if ($this->normal_desde_bookmarklet) { dbug('embed'); $info = entre1y2($this->web_descargada, 'var info = ', ",\n"); $info = json_decode($info, true); dbug_r($info); $webPrincipal = CargaWebCurl($info['url']); $urlContenedor = urldecode(entre1y2($webPrincipal, 'sequence=', '"')); //dbug_($urlContenedor); $jsonUrlContenedor = json_decode($urlContenedor, true); //dbug_r($jsonUrlContenedor); $obtenido = array('titulo' => entre1y2($this->web_descargada, 'title>', '<'), 'imagen' => strtr(entre1y2($this->web_descargada, '"thumbnail_url":"', '"'), array('\\' => '')), 'enlaces' => array()); /* "stream_h264_url", "stream_h264_ld_url", "stream_h264_hq_url", "stream_h264_hd_url", "stream_h264_hd1080_url", "stream_audio_url" "stream_live_hls_url" */ $posibilidades = array('1080p' => 'stream_h264_hd1080_url', '720p' => 'stream_h264_hd_url', '480p' => 'stream_h264_hq_url', '360p' => 'stream_h264_url', '240p' => 'stream_h264_ld_url'); foreach ($posibilidades as $nombre => $calidad) { if (enString($this->web_descargada, $calidad . '":"h')) { $url = strtr(entre1y2($this->web_descargada, $calidad . '":"', '"'), array('\\' => '')); dbug('url ' . $nombre . ': ' . $url); $obtenido['enlaces'][] = array('titulo' => $nombre, 'url' => $url, 'url_txt' => 'Descargar', 'tipo' => 'http'); } } finalCadena($obtenido, false); return; } else { $preweb = entre1y2($this->web_descargada, 'var info = ', ",\n"); $preweb = json_decode($preweb, true); dbug_r($preweb); $this->web_descargada = CargaWebCurl($preweb['url']); } } $urlContenedor = urldecode(entre1y2($this->web_descargada, 'sequence=', '"')); dbug_($urlContenedor); $jsonUrlContenedor = json_decode($urlContenedor, true); dbug_r($jsonUrlContenedor); $obtenido = array('titulo' => $jsonUrlContenedor['config']['metadata']['title'], 'imagen' => $jsonUrlContenedor['config']['preview_url'], 'enlaces' => array()); foreach ($jsonUrlContenedor['sequence'][0]['layerList'][0]['sequenceList'][2]['layerList'] as $preManifest) { if (isset($preManifest['param']['autoURL'])) { $manifest = $preManifest['param']['autoURL']; } } // ff=off permite tmbn descargar porno y esto va contra adsense. //$preEnlaces = CargaWebCurl($manifest,'','','ff=off'); $preEnlaces = CargaWebCurl($manifest); dbug_($preEnlaces); $preEnlaces = json_decode($preEnlaces, true); dbug_r($preEnlaces); // Todas las calidades for ($i = count($preEnlaces['alternates']) - 1; $i >= 0; --$i) { $obtenido['enlaces'][] = array('titulo' => $preEnlaces['alternates'][$i]['name'] . 'p', 'url' => $this->parseaTemplateDailyMotion($preEnlaces['alternates'][$i]['template']), 'extension' => 'm3u8', 'url_txt' => 'Descargar', 'tipo' => 'm3u8'); } finalCadena($obtenido, false); }
function calcula() { $obtenido = array('enlaces' => array()); $imagen = 'http://www.' . DOMINIO . '/canales/goear.png'; //varias canciones (de un usuario) if (enString($this->web_descargada, '<h3>Audios</h3>')) { //titulo generico $titulo = "Goear"; $canciones = substr_count($this->web_descargada, 'id="sound_'); dbug('canciones=' . $canciones); $last = 0; for ($i = 0; $i < $canciones; $i++) { $last = strpos($this->web_descargada, 'id="sound_', $last); $id = entre1y2_a($this->web_descargada, $last, 'id="sound_', '"'); dbug('id ' . $i . '=' . $id); $p = strpos($this->web_descargada, '<a', $last); $tit = entre1y2_a($this->web_descargada, $p, '>', '</a'); $tit = strip_tags($tit); dbug('tit=' . $tit); $mp3 = $this->buscaMP3($id); dbug('mp3=' . $mp3); array_push($obtenido['enlaces'], array('url' => $mp3, 'tipo' => 'http', 'url_txt' => $tit)); $last++; } } elseif (enString($this->web_descargada, "playlistid = '")) { $titulo = entre1y2($this->web_descargada, 'title>', '<'); $titulo = limpiaTitulo($titulo); dbug('título=' . $titulo); $id = entre1y2($this->web_descargada, "playlistid = '", "'"); $xml = CargaWebCurl('http://www.goear.com/elplaylist.php?f=' . $id); $canciones = substr_count($xml, 'title='); dbug('canciones=' . $canciones); $last = 0; for ($i = 0; $i < $canciones; $i++) { $p = strposF($xml, 'path="', $last); $f = strpos($xml, '"', $p); $last = $f + 2; $id = substr($xml, $p, $f - $p); dbug('id ' . $i . '=' . $id); $tit = entre1y2_a($xml, $last, 'title="', '"'); $tit = html_entity_decode($tit); dbug('tit=' . $tit); $mp3 = $this->buscaMP3($id); dbug('mp3=' . $mp3); array_push($obtenido['enlaces'], array('url' => $mp3, 'tipo' => 'http', 'url_txt' => $tit)); } } elseif (enString($this->web_descargada, "soundid = '")) { $titulo = entre1y2($this->web_descargada, 'title>', '<'); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); $id = entre1y2($this->web_descargada, "soundid = '", "'"); dbug('id=' . $id); $mp3 = $this->buscaMP3($id); array_push($obtenido['enlaces'], array('url' => $mp3, 'url_txt' => 'Descargar', 'tipo' => 'http')); } else { setErrorWebIntera('No se ha encontrado ninguna canción'); return; } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; //no comprobar los enlaces finalCadena($obtenido, false); }
function calcula() { /* $proxy = '189.174.63.36:8080'; $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,'http://tvnpod.tvolucion.com/indom/delivery/6dd74f0d-18d9-412a-bd59-5071182ffdbd/indom-c120.mp4_970k.mp4'); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_PROXY,$proxy); curl_setopt($ch,CURLOPT_HEADER,1); curl_setopt($ch,CURLOPT_RANGE,'1-200'); $t=curl_exec($ch); if(curl_errno($ch))dbug('Curl error: '.curl_error($ch)); curl_close($ch); dbug_($t); exit; */ if (enString($this->web, '//m.')) { $this->web = str_replace('//m.', '//www.', $this->web); dbug('Movil -> escritorio'); $this->web_descargada = CargaWebCurl($this->web, '', 0, '', array('Referer: ' . $this->web)); if (!enString($this->web_descargada, '<html')) { $this->web_descargada = CargaWebCurl($this->web); } } //usarse a sí mismo como réferer if (!enString($this->web_descargada, '<html')) { $this->web_descargada = CargaWebCurl($this->web, '', 0, '', array('Referer: ' . $this->web)); } if (!enString($this->web_descargada, '<html')) { $this->web_descargada = CargaWebCurl($this->web); } //dbug_($this->web_descargada); $obtenido = array('enlaces' => array()); //para televisa.com/novelas if (stringContains($this->web_descargada, array('showVideo(', 'data-idvideo="', 'embed.php?id='))) { if (enString($this->web_descargada, 'showVideo(')) { dbug('-1-'); preg_match('@showVideo\\(([0-9]+)\\)@', $this->web_descargada, $match); } elseif (enString($this->web_descargada, 'data-id="')) { dbug('-2-'); preg_match('@data-id="([0-9]+)"@', $this->web_descargada, $match); } elseif (enString($this->web_descargada, 'data-idvideo="')) { dbug('-2.5-'); preg_match('@data-idvideo="([0-9]+)"@', $this->web_descargada, $match); } elseif (enString($this->web_descargada, 'embed.php?id=')) { dbug('-3-'); preg_match('@embed.php\\?id=([0-9]+)@', $this->web_descargada, $match); } if (isset($match[1])) { $idVideo = $match[1]; dbug($idVideo); // $this->web='http://amp.televisa.com/embed/embed.php?id='.$idVideo.'&w=620&h=345'; $this->web = 'http://tvolucion.esmas.com/embed/embed.php?id=' . $idVideo . '&w=620&h=345'; $this->web_descargada = CargaWebCurl($this->web, '', 0, '', array('Referer: ' . $this->web)); if (enString($this->web_descargada, 'ya no se encuentra disponible')) { setErrorWebIntera('Éste vídeo ya no se encuentra disponible.'); return; } //dbug_($this->web_descargada); } } if (enString($this->web_descargada, 'params_dvr.json')) { if (!isset($idVideo)) { preg_match('#/([0-9]+?)/params_dvr.json#', $this->web_descargada, $matches); $idVideo = $matches[1]; } $hostname = 'tvolucion.esmas.com'; $json = "http://{$hostname}/tvenvivofiles/{$idVideo}/params_dvr.json"; $json = CargaWebCurl($json); $json = utf8_encode($json); $json = json_decode($json, true); dbug_r($json); $titulo = $json['channel']['item']['title']; $imagen = $json['channel']['item']['media-group']['media-thumbnail']['@attributes']['url']; foreach ($json['channel']['item']['media-group']['media-content'] as &$elem) { if (enString($elem['@attributes']['url'], '.f4m')) { $obtenido['enlaces'][] = array('url' => $elem['@attributes']['url'], 'nombre_archivo' => generaNombreWindowsValido($titulo), 'tipo' => 'f4m'); } elseif (enString($elem['@attributes']['url'], '.m3u8')) { $obtenido['enlaces'][] = array('url' => $elem['@attributes']['url'], 'tipo' => 'm3u8'); } } $obtenido['alerta_especifica'] = 'Es necesario usar un proxy de México. El programa F4M-Downloader permite indicar un proxy.'; } else { //http://c.brightcove.com/services/messagebroker/amf?playerKey=AQ~~,AAAAEUA28vk~,ZZqXLYtFw-ADB2SpeHfBR3cyrCkvIrAe if (enString($this->web_descargada, 'playerKey:"')) { $playerKey = entre1y2($this->web_descargada, 'playerKey:"', '"'); } elseif (enString($this->web_descargada, '<param name="playerKey"')) { $playerKey = entre1y2($this->web_descargada, '<param name="playerKey" value="', '"'); } if (!isset($playerKey)) { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } dbug('playerKey -> ' . $playerKey); $messagebroker = 'http://c.brightcove.com/services/messagebroker/amf?playerKey=' . $playerKey; if (enString($this->web_descargada, 'playerID:"')) { $experienceID = entre1y2($this->web_descargada, 'playerID:"', '"'); } elseif (enString($this->web_descargada, '<param name="playerID"')) { $experienceID = entre1y2($this->web_descargada, '<param name="playerID" value="', '"'); } if (!isset($experienceID)) { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } dbug('experienceID -> ' . $experienceID); if (enString($this->web_descargada, 'videoId:"')) { $contentId = entre1y2($this->web_descargada, 'videoId:"', '"'); } elseif (enString($this->web_descargada, '<param name="videoId"')) { $contentId = entre1y2($this->web_descargada, '<param name="videoId" value="', '"'); } if (!isset($contentId)) { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } dbug('contentId -> ' . $contentId); include 'brightcove-funciones.php'; //$aa = 'AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAe8KAAAAAgIAKDcyOTBiYTVlOTQzZGM0MmI3ZDY4NmE1NjJmOTZkNWI0MGI0ZjE3OTIRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdBlleHBlcmllbmNlSWQhY29udGVudE92ZXJyaWRlcxFUVExUb2tlbhlkZWxpdmVyeVR5cGUTcGxheWVyS2V5B1VSTAVCYrdWAacgAAkDAQqBA1Njb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkNvbnRlbnRPdmVycmlkZRtjb250ZW50UmVmSWRzDXRhcmdldBVmZWF0dXJlZElkE2NvbnRlbnRJZBdjb250ZW50VHlwZRtmZWF0dXJlZFJlZklkFWNvbnRlbnRJZHMZY29udGVudFJlZklkAQYXdmlkZW9QbGF5ZXIFf////+AAAAAFQoo2IT7sSAAEAAEBAQYBBX/////gAAAABmVBUX5+LEFBQUFFVUEyOHZrfixaWnFYTFl0RnctQURCMlNwZUhmQlIzY3lyQ2t2SXJBZQaBGWh0dHA6Ly9ub3RpY2llcm9zLnRlbGV2aXNhLmNvbS9wcm9ncmFtYXMtbm90aWNpZXJvLWNvbi1qb2FxdWluLWxvcGV6LWRvcmlnYS8='; //dbug_r(brightcove_decode(base64_decode($aa))); $a_encodear = array('target' => 'com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience', 'response' => '/1', 'data' => array('0' => '7290ba5e943dc42b7d686a562f96d5b40b4f1792', '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(new SabreAMF_TypedObject('com.brightcove.experience.ContentOverride', array('contentRefId' => null, 'contentIds' => null, 'featuredRefId' => null, 'contentRefIds' => null, 'contentType' => 0, 'target' => 'videoPlayer', 'featuredId' => NAN, 'contentId' => $contentId)))))))); // FALLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA $post = brightcove_encode($a_encodear); dbug(base64_encode($post)); //dbug_r(brightcove_decode($post)); //dbug_r(brightcove_decode(base64_decode('AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAhYKAAAAAgIAKDcyOTBiYTVlOTQzZGM0MmI3ZDY4NmE1NjJmOTZkNWI0MGI0ZjE3OTIRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdBlkZWxpdmVyeVR5cGUHVVJMGWV4cGVyaWVuY2VJZCFjb250ZW50T3ZlcnJpZGVzE3BsYXllcktleRFUVExUb2tlbgV/////4AAAAAaBZ2h0dHA6Ly90dm9sdWNpb24uZXNtYXMuY29tL3RlbGVub3ZlbGFzL2RyYW1hL2xhLXJvc2EtZGUtZ3VhZGFsdXBlLzIzNjM0OS9yb3NhLWd1YWRhbHVwZS1wZXF1ZW5hLWdyYW4taGlzdG9yaWEtYW1vci8FQmK3VgGnIAAJAwEKgQNTY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5Db250ZW50T3ZlcnJpZGUNdGFyZ2V0FWZlYXR1cmVkSWQTY29udGVudElkG2ZlYXR1cmVkUmVmSWQVY29udGVudElkcxljb250ZW50UmVmSWQbY29udGVudFJlZklkcxdjb250ZW50VHlwZQYXdmlkZW9QbGF5ZXIFf////+AAAAAFQoNbrQiDiAABAQEBBAAGZUFRfn4sQUFBQUVVQTI4dmt+LFpacVhMWXRGdy1BREIyU3BlSGZCUjNjeXJDa3ZJckFlBgE='))); dbug('a descargar: ' . $messagebroker); $t = brightcove_curl_web($messagebroker, $post); $res_decoded = brightcove_decode($t); dbug_r($res_decoded); $titulo1 = $res_decoded['data']->getAMFData(); $titulo2 = $titulo1['programmedContent']['videoPlayer']->getAMFData(); dbug_r($titulo2); $titulo3 = $titulo2['mediaDTO']->getAMFData(); $titulo = $titulo3['displayName']; //scar todas las URL //preg_match_all('@http(s)?://[a-z0-9A-Z.?/%_=~-]+@i', $t, $match); preg_match_all('@http(s)?://[a-z0-9A-Z./%_-]+@i', $t, $match); //buscar qué URLs son las pics y los vídeos para usarlas dbug_r($match[0]); $imagen = $match[0][1]; $urls_total = count($match[0]); for ($i = 0; $i < $urls_total; $i++) { if (esVideoAudioAnon($match[0][$i])) { $obtenido['enlaces'][] = array('url' => strtr($match[0][$i], array('http://tvnhds.tvolucion.com/z/' => 'http://tvnpod.tvolucion.com/')), 'tipo' => 'http'); } } } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
function calcula() { //dbug_($this->web_descargada); $obtenido = array('enlaces' => array()); if (!enString($this->web_descargada, 'catalog.video.msn.com/image.aspx')) { dbug('modo nuevo'); // No soportado // http://m.telemundo.com/video.php?show=elsenordeloscieloscapitulosecreto&id=najcVXTKRqnrWKiVUmcE&key=video // http://m.telemundo.com/video.php?show=lavozkids&id=oWvtdFNRlmwOemyqHpCF&key=video //setErrorWebIntera('No se encuentra ningún vídeo o no está soportado'); // http://now.telemundo.com/caso-cerrado/full-episodes/abuso-polic%C3%ADaco/322424899858 // http://player.theplatform.com/p/HNK2IC/telemundo_vod_noauth/embed/select/uLCEWFk911nP?autoPlay=true&mbr=true&FWsiteSection=tm_tveverywhere_vod_hub#playerurl=http%3A//now.telemundo.com/caso-cerrado/full-episodes/abuso-polic%25C3%25ADaco/322424899858 // https://player.theplatform.com/p/HNK2IC/telemundo_vod_noauth/embed/select/uLCEWFk911nP?autoPlay=false // https://link.theplatform.com/s/HNK2IC/uLCEWFk911nP?mbr=true&policy=2713557&player=Telemundo VOD No Auth Player (pub7)&manifest=f4m&format=SMIL&Tracking=true&Embedded=true&formats=F4M,MPEG4 // No va // https://link.theplatform.com/s/HNK2IC/uLCEWFk911nP?mbr=true&policy=2713557&player=Telemundo VOD No Auth Player (pub7) // Parece que se puede arreglar así: /* http://www.telemundo.com/shows/2014/11/20/maestros-armados-por-defensa-y-gemelas-con-el-mismo-marido-caso-cerrado-video "clip_image":"http:\/\/www.telemundo.com\/sites\/nbcutelemundo\/files\/images\/mpx\/2014\/11\/21\/141120_2829830_Maestros_armados_por_defensa_y_gemelas_con_e_0.jpg" "clip_title":"Maestros armados por defensa y gemelas con el mismo marido. Caso Cerrado (VIDEO)" "clip_descr":"Marlene es profesora, y quiere ir a dar clase con una pistola para poder defenderse en caso de una asesino en serie. Y, Karla y Tania tienen el mismo marido y reclaman la herencia que les dej\u00f3 su padre.\u00a0" iframe //player.theplatform.com/p/0L7ZPC/ztJiSNFd5ggr/embed/select/iWUW_xbJZGrj?siteSectionId=telemundo_video_hub_vod&autoPlay=true //theplatform.com/p/0L7ZPC/ztJiSNFd5ggr/embed/select/iWUW_xbJZGrj?siteSectionId=telemundo_shows_vod&autoPlay=true http://proxymexico.com http://link.theplatform.com/s/0L7ZPC/iWUW_xbJZGrj?mbr=true&player=P7%20VOD%20Player&policy=40180 http://link.theplatform.com/s/0L7ZPC/EuIyUv4n0nlm?mbr=true&player=P7%20VOD%20Player&policy=40180&switch=progressive&formats=mpeg4&format=SMIL&embedded=true&tracking=true */ if (enString($this->web, '//now.')) { // now.telemundo.com $desde = 1; // "episode_thumbnail":{"url":"http:\/\/tve_static-telemundo.nbcuni.com\/prod\/image\/478\/1007\/141117_2828781_Andrea_del_Junco_anvver_1_560x315_362507843555.jpg" // "synopsis":"Scarlet Gruber es Andrea del Junco, una joven seria, reservada y competente que anhela ser como su madre." $p = strpos($this->web_descargada, '//player.'); $imagen = entre1y2_a($this->web_descargada, $p, 'src="', '"'); dbug_($imagen); $titulo = entre1y2($this->web_descargada, '<meta property="og:title" content="', '"'); $player = 'http:' . desde1a2($this->web_descargada, $p, '"'); dbug_($player); } else { $desde = 2; $imagen = entre1y2($this->web_descargada, '"clip_image":"', '"'); $imagen = json_decode('"' . $imagen . '"'); dbug_($imagen); $titulo = entre1y2($this->web_descargada, '"clip_title":"', '"'); $titulo = json_decode('"' . $titulo . '"'); dbug_($titulo); // buscar si es una parte. if (enString($this->web_descargada, '<li class="player--nav-item-active">')) { $titulo .= ', parte ' . trim(strip_tags(entre1y2($this->web_descargada, '<li class="player--nav-item-active">', '</li'))); } $descripcion = entre1y2($this->web_descargada, '"clip_descr":"', '"'); $descripcion = json_decode('"' . $descripcion . '"'); dbug_($descripcion); $iframe = entre1y2($this->web_descargada, '<iframe', '<'); dbug_($iframe); $player = 'http://' . desde1a2($iframe, 'player.', '"'); dbug_($player); $obtenido['descripcion'] = $descripcion; } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; $ret = CargaWebCurl($player); $releaseUrl = entre1y2($ret, 'releaseUrl="', '"'); dbug_($releaseUrl); $releaseUrl .= '&switch=progressive&formats=mpeg4&format=SMIL&embedded=true&tracking=true'; dbug_($releaseUrl); $ret = CargaWebCurlProxy($releaseUrl, 'MX'); dbug_($ret); if (preg_match_all('@"(https?://[^"]+\\.(?:mp4|flv).+?)".+?bitrate="(.+?)"@i', $ret, $matches)) { dbug_r($matches); $links = array_unique($matches[1]); $calidades = array_unique($matches[2]); dbug_r($links); for ($i = 0, $i_t = count($links); $i < $i_t; $i++) { $obtenido['enlaces'][] = array('url' => $desde === 1 ? $this->quitar_akami_telemundo($links[$i]) : $links[$i], 'url_txt' => 'Descargar en calidad ' . intval($calidades[$i] / 1024), 'tipo' => 'http'); } } else { dbug('Adivinar urls a partir de la imagen'); dbug_($imagen); $posibles_calidades = array('4000', '2500', '1800', '1696', '1296', '1200', '896', '700', '696', '496', '400', '306', '240', '200'); if (preg_match('#anvver#', $imagen, $matches) || preg_match('#[0-9]+x[0-9]+#', $imagen, $matches)) { dbug_r($matches); $supuesta_url_base = entre1y2($imagen, 0, $matches[0]); $supuesta_url_base = str_replace('/image/', '/video/', $supuesta_url_base); for ($i = 0, $i_t = count($posibles_calidades); $i < $i_t; $i++) { $obtenido['enlaces'][] = array('url' => $supuesta_url_base . $posibles_calidades[$i] . '.mp4', 'url_txt' => 'Descargar en calidad ' . $posibles_calidades[$i], 'tipo' => 'http'); } $obtenido['alerta_especifica'] = 'No se ha podido encontrar ningún enlace para el vídeo pero alguno de los siguientes podría funcionar.'; } } } else { dbug('modo antiguo'); $imagen = 'http://img3.catalog.video.msn.com/image.aspx' . entre1y2($this->web_descargada, 'catalog.video.msn.com/image.aspx', '"'); dbug_($imagen); $uuid = entre1y2($imagen, 'uuid=', '&'); dbug_($uuid); $imagen = 'http://img3.catalog.video.msn.com/image.aspx?uuid=' . $uuid . '&w=500&h=250&so=4'; dbug_($imagen); $url = "http://hub.video.msn.com/services/videodata/?callback=JsonpCb0&ids={$uuid}&detailed=true&responseEncoding=json&v=2"; $ret = CargaWebCurl($url); $ret = substr($ret, 9, -1); $ret = str_replace("'", '"', $ret); $ret = preg_replace('/(\\w+):/i', '"\\1":', $ret); $ret = preg_replace_callback('/\\\\x.{2}/i', function ($a) { return chr('0' . substr($a[0], 1)); }, $ret); dbug_($ret); $ret = json_decode($ret, true); dbug(json_last_error()); dbug_r($ret); $titulo = $ret['videos'][0]['title']; $calidades = array('105' => '1080p', '104' => '720p', '103' => '480p', '102' => '360p', '101' => '240p', '1005' => '1080p', '1004' => '720p', '1003' => '480p', '1002' => '360p', '1001' => '240p'); foreach ($ret['videos'][0]['files'] as &$elem) { $ret['videos'][0]['files'][$elem['formatCode']] =& $elem; } foreach ($calidades as $i => $calidad) { if (isset($ret['videos'][0]['files'][$i])) { $elem =& $ret['videos'][0]['files'][$i]; if (!stringContains($elem['url'], array('.mp4', '.flv'))) { continue; } foreach ($obtenido['enlaces'] as &$enl) { if (substr($enl['url'], 20) === substr($elem['url'], 20)) { continue 2; } } $obtenido['enlaces'][] = array('url' => $elem['url'], 'url_txt' => 'Descargar en ' . $calidad, 'tipo' => 'http'); } } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; } finalCadena($obtenido, false); }
function calcula() { $obtenido = array('enlaces' => array()); /* http://www.nbcuniverso.com/shows/a-toda-gloria/toda-gloria-extended-scene-gloria-llega-peru-episode-13 http://mun2-static.nbcuni.com/MPX/image/NBCU_mun2/978/1019/141224_2836917_A_Toda_Gloria_extended_scene__Gloria_llega_a.jpg http://mun2-pmd.edgesuite.net/MPX/video/NBCU_mun2/978/1019/141224_2836917_A_Toda_Gloria_extended_scene__Gloria_llega_a_4000.mp4 http://mun2-pmd.edgesuite.net/MPX/video/NBCU_mun2/978/1019/141224_2836917_A_Toda_Gloria_extended_scene__Gloria_llega_a_2500.mp4 */ $titulo = entre1y2($this->web_descargada, '<meta property="og:title" content="', '"'); $obtenido['descripcion'] = entre1y2($this->web_descargada, '<meta name="description" content="', '"'); if (enString($this->web, '/now/')) { dbug('now'); // now.telemundo.com $desde = 1; $player = 'http:' . desde1a2($this->web_descargada, '//player.theplatform.com/p/', '"'); dbug_($player); } else { dbug('no now'); $desde = 2; //$imagen = entre1y2($this->web_descargada, '<meta property="og:image" content="', '"'); if (enString($this->web_descargada, '<li class="player--nav-item-active">')) { $titulo .= ', parte ' . trim(strip_tags(entre1y2($this->web_descargada, '<li class="player--nav-item-active">', '</li'))); } $player = desde1a2($this->web_descargada, 'http://player.theplatform.com', '"'); dbug_($player); $player = str_replace('/swf/', '/embed/', $player); dbug_($player); } $obtenido['titulo'] = $titulo; $ret = CargaWebCurl($player); $imagen = entre1y2($ret, '<meta property="og:image" content="', '"'); dbug_($imagen); $obtenido['imagen'] = $imagen; if (enString($this->web, '/now/')) { $obtenido['alerta_especifica'] = 'No se ha podido encontrar ningún enlace para el vídeo pero alguno de los siguientes podría funcionar.'; $urlNuevo = preg_replace('#http://.*?/image/#', 'https://tvenbcuniverso-vh.akamaihd.net/i/prod/video/', $imagen); $urlViejo = preg_replace('#http://.*?/image/#', 'https://tvenbcuniverso-vh.akamaihd.net/i/prod/video/', $imagen); $nuevoAgregado = false; if (preg_match('#anvver_([0-9])_#', $urlNuevo, $matches)) { dbug_r($matches); $urlNuevo = desde1a2($urlNuevo, 0, $matches[0]) . 'anvver_' . ($matches[1] - 1) . '_,40,25,18,12,7,4,2,00.mp4.csmil/master.m3u8'; dbug_($urlNuevo); $obtenido['enlaces'][] = array('titulo' => 'Calidades nuevas', 'url' => $urlNuevo, 'tipo' => 'm3u8'); $nuevoAgregado = true; } if (preg_match('#anvver#', $urlViejo, $matches) || preg_match('#[0-9]+x[0-9]+#', $urlViejo, $matches)) { dbug_r($matches); $urlViejo = entre1y2($urlViejo, 0, $matches[0]) . ',1696,1296,896,696,496,240,306,.mp4.csmil/master.m3u8'; dbug_($urlViejo); $obtenido['enlaces'][] = array('titulo' => 'Calidades antiguas', 'url' => $urlViejo, 'tipo' => 'm3u8'); if (!$nuevoAgregado) { $urlNuevo = entre1y2($urlNuevo, 0, $matches[0]) . ',40,25,18,12,7,4,2,00.mp4.csmil/master.m3u8'; dbug_($urlNuevo); $obtenido['enlaces'][] = array('titulo' => 'Calidades nuevas', 'url' => $urlNuevo, 'tipo' => 'm3u8'); } } finalCadena($obtenido, false); return; } $releaseUrl = entre1y2($ret, 'releaseUrl="', '"'); dbug_($releaseUrl); $releaseUrl .= '&switch=progressive&formats=mpeg4&format=SMIL&embedded=true&tracking=true'; dbug_($releaseUrl); $ret = CargaWebCurlProxy($releaseUrl, 'MX'); dbug_($ret); if (preg_match_all('@"(https?://[^"]+\\.(?:mp4|flv).+?)".+?bitrate="(.+?)"@i', $ret, $matches)) { dbug_r($matches); $links = array_unique($matches[1]); $calidades = array_unique($matches[2]); dbug_r($links); for ($i = 0, $i_t = count($links); $i < $i_t; $i++) { $obtenido['enlaces'][] = array('url' => $desde === 1 ? $this->quitar_akami_telemundo($links[$i]) : $links[$i], 'url_txt' => 'Descargar en calidad ' . intval($calidades[$i] / 1024), 'tipo' => 'http'); } } else { dbug('Adivinar urls a partir de la imagen'); $posibles_calidades = array('4000', '2500', '1800', '1696', '1296', '1200', '896', '700', '696', '496', '400', '306', '240', '200'); $supuesta_url_base = entre1y2($imagen, 0, 'anvver'); $supuesta_url_base = str_replace('/image/', '/video/', $supuesta_url_base); for ($i = 0, $i_t = count($posibles_calidades); $i < $i_t; $i++) { $obtenido['enlaces'][] = array('url' => $supuesta_url_base . $posibles_calidades[$i] . '.mp4', 'url_txt' => 'Descargar en calidad ' . $posibles_calidades[$i], 'tipo' => 'http'); } $obtenido['alerta_especifica'] = 'No se ha podido encontrar ningún enlace para el vídeo pero alguno de los siguientes podría funcionar.'; } finalCadena($obtenido, false); }