function calcula() { $titulo = entre1y2($this->web_descargada, '<title', '<'); $titulo = substr($titulo, strposF($titulo, '>')); $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array()); $datos = desde1a2($this->web_descargada, '[["params","', '.forEach'); dbug_($datos); $datos = json_decode($datos, true); dbug_r($datos); foreach ($datos as $dato) { if ($dato[0] === 'params') { $datos = urldecode($dato[1]); $datos = json_decode($datos, true); break; } } dbug_r($datos); if (isset($datos['video_data'][0]['hd_src_no_ratelimit'])) { $hd = $datos['video_data'][0]['hd_src_no_ratelimit']; } elseif (isset($datos['video_data'][0]['hd_src'])) { $hd = $datos['video_data'][0]['hd_src']; } if (isset($hd)) { $obtenido['enlaces'][] = array('url_txt' => 'Calidad HD', 'url' => $hd, 'tipo' => 'http'); } if (isset($datos['video_data'][0]['sd_src_no_ratelimit'])) { $sd = $datos['video_data'][0]['sd_src_no_ratelimit']; } elseif (isset($datos['video_data'][0]['sd_src'])) { $sd = $datos['video_data'][0]['sd_src']; } if (isset($hd)) { $obtenido['enlaces'][] = array('url_txt' => 'Calidad SD', 'url' => $sd, 'tipo' => 'http'); } 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 $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() { $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() { //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 SacarVideo(&$entrada, $nombre) { //url:'mp4%3A%2Fweb%2F4311%2F4311.mp4', $retfull = strtr($entrada, array(' ' => '')); $url = urldecode(entre1y2($retfull, "url:'", "'")); dbug($url); $rtmpbase = urldecode(entre1y2($retfull, "netConnectionUrl:'", "'")); dbug_($rtmpbase); // http://alacarta.aragontelevision.es/_archivos/videos'.$url; $videos = array('url' => 'rtmp://aragontvvodfs.fplive.net/aragontvvod' . $url, 'rtmpdump' => '-r "' . $rtmpbase . '" -y "' . $url . '" -o "' . generaNombreWindowsValido($nombre) . '.mp4"', 'tipo' => 'rtmpConcreto', 'extension' => 'mp4'); return $videos; }
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('@/[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() { $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() { //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() { $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 calcula() { $obtenido = array('enlaces' => array()); // https://www.toons.tv/channels/Angry_Birds_Toons/2836878488001 // $contentId = 2836878488001; preg_match("@/([0-9]*?)\$@", $this->web, $matches); dbug_r($matches); $contentId = $matches[1]; $playerID = 2575783636001; $playerKey = "AQ~~,AAAB4eGoB7k~,qFXAwsXF0CNH_yigPCPuBhmMwKcWfpTc"; include 'brightcove-funciones.php'; //2836878488001 /* $lol = "AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAABFYKAAAAAgIAKDc1Mzg0ZjZkNmJiMTdmOWJkZDQ0YjgxNTc0ODdiOWE2NGY0MGY2YjQRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdBlkZWxpdmVyeVR5cGUTcGxheWVyS2V5B1VSTBlleHBlcmllbmNlSWQhY29udGVudE92ZXJyaWRlcxFUVExUb2tlbgV/////4AAAAAZlQVF+fixBQUFCNGVHb0I3a34scUZYQXdzWEYwQ05IX3lpZ1BDUHVCaG1Nd0tjV2ZwVGMGimdodHRwczovL3NhZG1pbi5icmlnaHRjb3ZlLmNvbS92aWV3ZXIvdXMyMDE0MDEzMC4xMzIwL0JyaWdodGNvdmVCb290bG9hZGVyLnN3Zj9wbGF5ZXJJRD0yNTc1NzgzNjM2MDAxJnBsYXllcktleT1BUSU3RSU3RSUyQ0FBQUI0ZUdvQjdrJTdFJTJDcUZYQXdzWEYwQ05IX3lpZ1BDUHVCaG1Nd0tjV2ZwVGMmc2VjdXJlQ29ubmVjdGlvbnM9dHJ1ZSZwdXJsPWh0dHBzJTNBJTJGJTJGd3d3LnRvb25zLnR2JTJGY2hhbm5lbHMlMkZBbmdyeV9CaXJkc19Ub29ucyUyRjI4MzY4Nzg0ODgwMDEmYXV0b1N0YXJ0PSZiZ2NvbG9yPSUyMzQ5NDk0OSZkZWJ1Z2dlcklEPSZkeW5hbWljU3RyZWFtaW5nPXRydWUmZmxhc2hJRD1teUV4cGVyaWVuY2UmaGVpZ2h0PTM2MCZodG1sRGVmYXVsdEJpdHJhdGU9ODk2MDAwJmluY2x1ZGVBUEk9dHJ1ZSZpc1VJPXRydWUmaXNWaWQ9dHJ1ZSZvcmlnaW5hbFRlbXBsYXRlUmVhZHlIYW5kbGVyPUJDTC5vblRlbXBsYXRlUmVhZHkmc2VjdXJlSFRNTENvbm5lY3Rpb25zPXRydWUmc3RhcnRUaW1lPTEzOTE0NjU2ODk4NzYmdGVtcGxhdGVMb2FkSGFuZGxlcj1CQ0wub25UZW1wbGF0ZUxvYWQmdGVtcGxhdGVSZWFkeUhhbmRsZXI9YnJpZ2h0Y292ZSU1QiUyMnRlbXBsYXRlUmVhZHlIYW5kbGVybXlFeHBlcmllbmNlJTIyJTVEJnZpZGVvSUQ9MjgzNjg3ODQ4ODAwMSZ3aWR0aD02NDAmd21vZGU9b3BhcXVlBUKCvcVZYQgACQMBCoEDU2NvbS5icmlnaHRjb3ZlLmV4cGVyaWVuY2UuQ29udGVudE92ZXJyaWRlFWZlYXR1cmVkSWQTY29udGVudElkG2ZlYXR1cmVkUmVmSWQVY29udGVudElkcxljb250ZW50UmVmSWQNdGFyZ2V0G2NvbnRlbnRSZWZJZHMXY29udGVudFR5cGUFf////+AAAAAFQoSkGROOCAABAQEGF3ZpZGVvUGxheWVyAQQABgE="; $lol = base64_decode($lol); dbug_r(brightcove_decode($lol)); */ //http://c.brightcove.com/services/messagebroker/amf?playerKey=AQ~~,AAAAEUA28vk~,ZZqXLYtFw-ADB2SpeHfBR3cyrCkvIrAe $messagebroker = "https://secure.brightcove.com/services/messagebroker/amf?playerKey=" . $playerKey; $a_encodear = array("target" => "com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience", "response" => "/1", "data" => array("0" => "75384f6d6bb17f9bdd44b8157487b9a64f40f6b4", "1" => new SabreAMF_AMF3_Wrapper(new SabreAMF_TypedObject("com.brightcove.experience.ViewerExperienceRequest", array("deliveryType" => NAN, "playerKey" => $playerKey, "URL" => $this->web, "experienceId" => $playerID, "contentOverrides" => array("0" => new SabreAMF_TypedObject("com.brightcove.experience.ContentOverride", array("featuredId" => NAN, "contentId" => $contentId, "featuredRefId" => null, "contentIds" => null, "contentRefId" => null, "target" => "videoPlayer", "contentRefIds" => null, "contentType" => 0))), "TTLToken" => null))))); $post = brightcove_encode($a_encodear); 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); // http://roviohdhd-f.akamaihd.net/hd/2069665155001/2069665155001_28369,42536,43153,38732,39126,001_ABT-E0530-SLUMBERMILL-Panama-MASTER.mp4.csmil/bitrate=3?videoId=2836878488001&lineUpId=&pubId=2069665155001&playerId=2575783636001&affiliateId=&v=&fp=&r=&g= $base = $res_decoded["data"]->getAMFData(); $base2 = $base["programmedContent"]["videoPlayer"]->getAMFData(); $base3 = $base2["mediaDTO"]->getAMFData(); $titulo = $base3["shortDescription"]; $imagen = $base3["videoStillURL"]; dbug('titulo = ' . $titulo); dbug('imagen = ' . $imagen); $mediaId = $base2["mediaId"]; dbug('mediaId = ' . $mediaId); // http://roviohdhd-f.akamaihd.net/hd/2069665155001/2069665155001_28369,42536,43153,38732,39126,001_ABT-E0530-SLUMBERMILL-Panama-MASTER.mp4.csmil/bitrate=3?videoId=2836878488001&lineUpId=&pubId=2069665155001&playerId=2575783636001&affiliateId=&v=&fp=&r=&g= $finalURL = '.csmil/bitrate=3?videoId=' . $mediaId . '&pubId=&playerId=&v=&fp=&r=&g='; $aPartir = array(); $URLBase = ''; $inicio = 0; dbug('renditions'); $renditions = $base3["renditions"]; for ($i = 0, $i_t = count($renditions); $i < $i_t; $i++) { $temp = $renditions[$i]->getAMFData(); $URLBase = $temp["defaultURL"]; $inicio = strpos($URLBase, '_') + 1; $final = strpos($URLBase, '_', $inicio); $n1 = substr($URLBase, $inicio, 5); $n2 = substr($URLBase, $inicio + 5, 5); $n3 = substr($URLBase, $inicio + 10, 3); $aPartir[] = substr($URLBase, $inicio, $final - $inicio); } dbug_r($aPartir); dbug('$URLBase => ' . $URLBase); $principio = substr($URLBase, 0, $inicio); $inicio2 = strpos($URLBase, '_', $inicio); $final = substr($URLBase, $inicio2); dbug('$principio => ' . $principio); dbug('$final => ' . $final); dbug('$finalURL => ' . $finalURL); //Se supone que todos son igual de largos. Los número separados por comas se formar a partir de el inicio común de todos como primer número, el final común como último número, y los intermedios son lo que cambia. /* Las siguientes son todas URL válidas: http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_28405,62175,77044,77622,001_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_284,05621750,05770440,05776220,01_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_,2840562175001,2840577044001,2840577622001,_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN */ $obtenido['enlaces'] = array(array('url_txt' => 'Descargar', 'url' => $principio . ',' . implode(',', $aPartir) . ',' . $final . $finalURL, 'tipo' => 'http', 'extension' => 'mp4')); $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 resuelveIDMetodo2($id, &$enlaces_array, &$titulo, &$imagen, $ignoraCaducados = false) { //http://www.tv3.cat/pvideo/FLV_bbd_media.jsp?ID=4048670&QUALITY=H&FORMAT=MP4 $server2 = 'http://www.tv3.cat/pvideo/FLV_bbd_dadesItem.jsp?idint=' . $id; dbug('server2=' . $server2); $ret = CargaWebCurl($server2); dbug('obtenido=' . $ret); if (enString($ret, '<title>')) { //rectificar titulo dbug('rectificar titulo'); //<h1>Amb Fidel, passi el que passi</h1> $titulo = entre1y2($ret, '<title>', '</'); $titulo = utf8_encode($titulo); $titulo = limpiaTitulo($titulo); dbug('nuevo titulo=' . $titulo); } //<format>MP4GES</format> //PARA VIDEOS LIMITADOS //http://www.tv3.cat/pvideo/FLV_bbd_media.jsp?ID=3932951&QUALITY=H&FORMAT=MP4GES if (enString($ret, '<imgsrc>') && !isset($imagen)) { $p = strrposF($ret, '<imgsrc>'); $f = strrpos($ret, '</imgsrc>', $p); $imagen = substr($ret, $p, $f - $p); } $formato = 'MP4'; if (enString($ret, '<format>')) { //ENCUENTRA EL PRIMERO EN LA LISTA; NO EL MEJOR dbug('formato encontrado'); $p = strrposF($ret, '<format>'); $f = strrpos($ret, '</format>', $p); $formato = substr($ret, $p, $f - $p); } $server3 = 'http://www.tv3.cat/pvideo/FLV_bbd_media.jsp?' . 'ID=' . $id . '&QUALITY=H&FORMAT=' . $formato; dbug('server3=' . $server3); $server4 = 'http://www.tv3.cat/pvideo/FLV_bbd_media.jsp?' . 'ID=' . $id . '&QUALITY=H&PROFILE=APPMOB&FORMAT=' . $formato; dbug('server4=' . $server4); $ret = CargaWebCurl($server4); dbug('obtenido='); dbug_($ret); if (enString($ret, 'err.service.expired')) { if (!$ignoraCaducados) { setErrorWebIntera('El vídeo fue borrado de TV3'); } return; } elseif (enString($ret, '<media')) { //a sacer el video. si falla la busqueda, entonces hay un error //<media videoname="La Costa Brava en caiac/Thalassa/13042012/BB_THALASS"> //http://mp4-medium-dwn.media.tv3.cat/g/tvcatalunya/0/2/1394113435120.mp4 //</media> $p = strrpos($ret, '<media'); $ret = entre1y2_a($ret, $p, '>', '<'); if (enString($ret, 'mp4:') || enString($ret, 'http://')) { dbug('urlFinal=' . $ret); if (strpos($ret, 'rtmp://') === 0) { $ret = preg_replace('@rtmp://.*?mp4:(.*?)$@', 'http://mp4-medium-dwn.media.tv3.cat/$1', $ret); dbug('urlFinal (mediante preg replace=' . $ret); } $enlaces_array[] = array('titulo' => 'Calidad media', 'url' => $ret, 'tipo' => 'http'); } } $ret = CargaWebCurl($server3); dbug('obtenido='); dbug_($ret); if (enString($ret, '<media')) { //http://www.tv3.cat/feeds/videos/fitxaVideo.jsp?id=4874451&device=and-h&format=xml&version=1 //a sacer el video. si falla la busqueda, entonces hay un error //<media videoname="La Costa Brava en caiac/Thalassa/13042012/BB_THALASS"> //rtmp://mp4-500-str.tv3.cat/ondemand/mp4:g/tvcatalunya/2/2/1334322726322.mp4 //</media> $p = strrpos($ret, '<media'); $ret = entre1y2_a($ret, $p, '>', '<'); if (enString($ret, 'mp4:')) { preg_match('@^(.*?/)(mp4:.*?)$@', $ret, $matches); dbug_r($matches); // 4/09/2012 metodo rectificado dbug('urlFinal=' . $ret); $enlaces_array[] = array('titulo' => 'Calidad alta', 'url' => $ret, 'rtmpdump' => '-r "' . $matches[1] . '" -y "' . $matches[2] . '" -o "' . generaNombreWindowsValido($titulo) . '.mp4"', 'tipo' => 'rtmpConcreto', 'extension' => 'mp4'); } else { // 2/06/2014 dbug('urlFinal=' . $ret); $ext = substr($ret, -3, 3); $enlaces_array[] = array('url' => $ret, 'rtmpdump' => '-r "' . $ret . '" -o "' . generaNombreWindowsValido($titulo) . '.' . $ext . '"', 'tipo' => 'rtmpConcreto', 'extension' => '.' . $ext); } } }
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); }
function calcula() { $obtenido = array('enlaces' => array()); if (enString($this->web_descargada, '<param name="publisherID"')) { $publisherId = entre1y2($this->web_descargada, '<param name="publisherID" value="', '"'); } if (!isset($publisherId)) { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } if (enString($this->web_descargada, '<param name="@videoPlayer"')) { $contentId = entre1y2($this->web_descargada, '<param name="@videoPlayer" value="', '"'); } if (!isset($contentId)) { setErrorWebIntera('No se ha encontrado ningún vídeo.'); return; } if (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('$publisherId -> ' . $publisherId); dbug('$contentId -> ' . $contentId); dbug('experienceID = playerId -> ' . $experienceID); $messagebroker = 'http://c.brightcove.com/services/messagebroker/amf?playerId=' . $experienceID; include 'brightcove-funciones.php'; /* $lol="AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAcsKAAAAAgIAKDBhMGVmYTdhMTBjMTg2M2IyZjk5MmE2MGQ3MjJiYTlkNDExMzg4NGQRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdCFjb250ZW50T3ZlcnJpZGVzE3BsYXllcktleRFUVExUb2tlbhlkZWxpdmVyeVR5cGUHVVJMGWV4cGVyaWVuY2VJZAkDAQqBA1Njb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkNvbnRlbnRPdmVycmlkZRtmZWF0dXJlZFJlZklkFWNvbnRlbnRJZHMZY29udGVudFJlZklkF2NvbnRlbnRUeXBlDXRhcmdldBtjb250ZW50UmVmSWRzFWZlYXR1cmVkSWQTY29udGVudElkAQEBBAAGF3ZpZGVvUGxheWVyAQV/////4AAAAAVChKrndlYIAAYBBgEFf////+AAAAAGgTVodHRwOi8vd3d3LnRlbGVtYWRyaWQuZXMvcHJvZ3JhbWFzL21hZHJpbGVub3MtcG9yLWVsLW11bmRvL21hZHJpbGVub3MtcG9yLWVsLW11bmRvLXNpY2lsaWEFQjoHC+3hAAA="; print_r(brightcove_decode(base64_decode($lol))); */ $a_encodear = array('target' => 'com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience', 'response' => '/1', 'data' => array('0' => '0a0efa7a10c1863b2f992a60d722ba9d4113884d', '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(base64_encode($post)); $t = 'AAMAAAABAEZjb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkV4cGVyaWVuY2VSdW50aW1lRmFjYWRlLmdldERhdGFGb3JFeHBlcmllbmNlAAIvMQAAAa8KAAAAAgIAKDBhMGVmYTdhMTBjMTg2M2IyZjk5MmE2MGQ3MjJiYTlkNDExMzg4NGQRCmNjY29tLmJyaWdodGNvdmUuZXhwZXJpZW5jZS5WaWV3ZXJFeHBlcmllbmNlUmVxdWVzdCFjb250ZW50T3ZlcnJpZGVzEVRUTFRva2VuGWRlbGl2ZXJ5VHlwZRNwbGF5ZXJLZXkHVVJMGWV4cGVyaWVuY2VJZAkDAQqBA1Njb20uYnJpZ2h0Y292ZS5leHBlcmllbmNlLkNvbnRlbnRPdmVycmlkZRtjb250ZW50UmVmSWRzF2NvbnRlbnRUeXBlFWZlYXR1cmVkSWQTY29udGVudElkDXRhcmdldBtmZWF0dXJlZFJlZklkFWNvbnRlbnRJZHMZY29udGVudFJlZklkAQQABX/////gAAAABUKMGgqQeggABhd2aWRlb1BsYXllcgEBAQYBBX/////gAAAABgEGf2h0dHA6Ly93d3cudGVsZW1hZHJpZC5lcy9wcm9ncmFtYXMvcnV0YS0xNzkvcnV0YS0xNzktbGEtY2FicmVyYQVCOgcL7eEAAA=='; dbug_($t); $t = base64_decode($t); $t = brightcove_decode($t); //dbug_r($t); $t = brightcove_encode($t); dbug(base64_encode($t)); $t = brightcove_decode($t); dbug_r($t); exit; */ 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(); $publisherId = $base['publisherId']; $base2 = $base['programmedContent']['videoPlayer']->getAMFData(); $base3 = $base2['mediaDTO']->getAMFData(); $titulo = $base3['shortDescription']; $titulo = limpiaTitulo($titulo); $imagen = $base3['videoStillURL']; dbug('titulo = ' . $titulo); dbug('imagen = ' . $imagen); $mediaId = $base2['mediaId']; dbug('mediaId = ' . $mediaId); dbug('renditions'); $renditions = $base3['renditions']; $t = $renditions[0]->getAMFData(); if (enString($t['defaultURL'], '/hd/')) { // Modo url larga //http://telemadrid-f.akamaihd.net/hd/104403117001/201312/104403117001_2893,100922,090935,103695,001_6760d109-240a-432a-a857-f4434542ea55.mp4.csmil/bitrate=2?videoId=2892867548001&pubId=104403117001&playerId=111787372001&lineUpId=&affiliateId=&bandwidthEstimationTest=true&v=&fp=&r=&g= $finalURL = '.csmil/bitrate=2?videoId=' . $mediaId . '&pubId=' . $publisherId . '&playerId=' . $experienceID . '&v=&fp=&r=&g='; $aPartir = array(); $URLBase = ''; dbug('renditions'); $renditions = $base3['renditions']; for ($i = 0, $i_t = count($renditions); $i < $i_t; $i++) { $temp = $renditions[$i]->getAMFData(); $URLBase =& $temp['defaultURL']; $inicio = strposF($URLBase, '_'); $final = strpos($URLBase, '_', $inicio); $n1 = substr($URLBase, $inicio, 5); $n2 = substr($URLBase, $inicio + 5, 5); $n3 = substr($URLBase, $inicio + 10, 3); $aPartir[] = substr($URLBase, $inicio, $final - $inicio); } dbug_r($aPartir); dbug('$URLBase => ' . $URLBase); $principio = substr($URLBase, 0, $inicio); $inicio2 = strpos($URLBase, '_', $inicio); $final = substr($URLBase, $inicio2); dbug('$principio => ' . $principio); dbug('$final => ' . $final); dbug('$finalURL => ' . $finalURL); //Se supone que todos son igual de largos. Los número separados por comas se formar a partir de el inicio común de todos como primer número, el final común como último número, y los intermedios son lo que cambia. /* Las siguientes son todas URL válidas: http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_28405,62175,77044,77622,001_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_284,05621750,05770440,05776220,01_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN http://telemadridhdhd-f.akamaihd.net/hd/104403117001/104403117001_,2840562175001,2840577044001,2840577622001,_e9b9daed-e008-470c-b1d4-6463de1bb823.mp4.csmil/bitrate=2?videoId=2840532536001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=&bandwidthEstimationTest=true&v=3.1.0&fp=WIN%2011,9,900,170&r=PBMXA&g=DBNLQTFOYOHN */ $obtenido['enlaces'] = array(array('url_txt' => 'Descargar', 'url' => $principio . ',' . implode(',', $aPartir) . ',' . $final . $finalURL, 'tipo' => 'http', 'extension' => 'mp4')); } else { $url = array('', 0); for ($i = 0, $i_t = count($renditions); $i < $i_t; $i++) { $temp = $renditions[$i]->getAMFData(); if ($url[1] < $temp['encodingRate']) { $url[0] = $temp['defaultURL']; $url[1] = $temp['encodingRate']; } } dbug('$url => ' . $url[0]); /* rtmpdump -r "rtmp://telemadrid2-bc-od-flashfs.fplive.net:1935/telemadrid2-bc-od-flash?videoId=3712633770001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=" -a "telemadrid2-bc-od-flash?videoId=3712633770001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=" -f "WIN 14,0,0,145" -W "http://admin.brightcove.com/viewer/us20140807.1543/federatedVideoUI/BrightcovePlayer.swf?uid=1407518049436" -p "http://www.telemadrid.es/programas/aqui-en-madrid/aqui-en-madrid-04082014" -y "mp4:rtmp_uds/104403117001/201408/951/104403117001_3712803353001_d721fb63-a0b2-4ec6-a3cf-85641c726e34.mp4?videoId=3712633770001&lineUpId=&pubId=104403117001&playerId=111787372001&affiliateId=" -o 104403117001_371280335 3001_d721fb63-a0b2-4ec6-a3cf-85641c726e34.flv */ /* $dominio = entre1y2($url[0], 'http://','/'); dbug($dominio); //$url[0] = strtr($url[0], array($dominio => 'brightcove04.o.brightcove.com')); */ $andpos = strpos($url[0], '&'); $end = '?videoId=' . $mediaId . '&lineUpId=&pubId=' . $publisherId . '&playerId=' . $experienceID . '&affiliateId='; $r = substr($url[0], 0, $andpos); if ($r[strlen($r) - 1] === '/') { $r = substr($r, 0, strlen($r) - 1); } $obtenido['enlaces'] = array(array('url' => '-', 'rtmpdump' => '-r "' . $r . $end . '" ' . '-y "' . substr($url[0], $andpos + 1) . $end . '"', 'nombre_archivo' => generaNombreWindowsValido($titulo) . '.mp4', 'tipo' => 'rtmpConcreto', 'extension' => 'mp4')); } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }
function CargaWebCurlProxy($web, $pais = 'ESP', $post = '', $cabeceras = array()) { global $cargawebcurl_proxyarray; $redir = ''; $actualizaredir = ''; // http://teleport.to // http://www.publicproxyservers.com/proxy/list1.html dbug('cargando web (Proxy): ' . $web); switch ($pais) { case 'ESP': $rand = rand(0, count($cargawebcurl_proxyarray) - 1); $redir = $cargawebcurl_proxyarray[$rand] . 'redir.php?a='; $actualizaredir = $cargawebcurl_proxyarray[$rand] . 'actualizar.php'; break; case 'MX': return CargaWebCurl('http://server.proxymexico.com/includes/process.php?action=update', 'u=' . urlencode($web) . ($post !== '' ? '&' . $post : ''), false, '', array_merge($cabeceras, array('Referer: http://proxymexico.com/'))); case 'US': return CargaWebCurl('http://anonymouse.org/cgi-bin/anon-www.cgi/' . $web, $post, false, '', array_merge($cabeceras, array('Referer: http://anonymouse.org/anonwww.html'))); default: case 'aleatorio': return CargaWebCurl($web, $post, 0, '', $cabeceras); } dbug_($redir); $cabecerasString = implode("\r\n", $cabeceras) . "\r\n"; $urlPreparada = $redir . urlencode($web) . ($post != '' ? '&p=' . urlencode(base64_encode($post)) : '') . (count($cabeceras) ? '&h=' . urlencode(base64_encode($cabecerasString)) : ''); dbug_($urlPreparada); dbug('<a href="' . $urlPreparada . '">' . $urlPreparada . '</a>'); $retfull = CargaWebCurl($urlPreparada); if (enString($retfull, 'solicitada no existe') || enString($retfull, 'class="error_404"') || enString($retfull, 'Page Not Found')) { dbug('actualizando redir...'); CargaWebCurl($actualizaredir); $retfull = CargaWebCurl($urlPreparada, '', 0, '', array(), true, true); } if ($retfull === '' || !$retfull || enString($retfull, 'solicitada no existe') || enString($retfull, 'class="error_404"') || enString($retfull, 'Page Not Found')) { $retfull = CargaWebCurl($web, $post, 0, '', $cabeceras); } return $retfull; }
function URLSDelArrayBrightCove($r, $tipo, &$obtenido_enlaces, $titulo) { if ($r["audioOnly"] != "1") { if ($tipo === 'rtmpConcreto') { $_r = substr($r["defaultURL"], 0, strpos($r["defaultURL"], 'mp4')); $_r = substr($_r, 0, strrposF($_r, '/')); $_y = 'mp4' . entre1y2($r["defaultURL"], 'mp4', '?'); $_ry = substr($r["defaultURL"], strpos($r["defaultURL"], '?')); dbug_($_r); dbug_($_y); dbug_($_ry); $elem = array('calidad_ordenar' => $r["encodingRate"], 'url' => $r["defaultURL"], 'tipo' => $tipo, 'rtmpdump' => '-r "' . $_r . $_ry . '" -y "' . $_y . $_ry . '" -o "' . $titulo . '.mp4"'); if ($r["encodingRate"] != 0) { $elem['titulo'] = 'Calidad: ' . floor($r["encodingRate"] / 1000) . " Kbps"; } $obtenido_enlaces[] = $elem; } else { $elem = array('calidad_ordenar' => $r["encodingRate"], 'url' => $r["defaultURL"], 'tipo' => $tipo); if ($r["encodingRate"] != 0) { $elem['titulo'] = 'Calidad: ' . floor($r["encodingRate"] / 1000) . " Kbps"; } $obtenido_enlaces[] = $elem; } } }
function univisionID($id) { dbug('univisionID'); $ret = 'http://cdn-download.mcm.univision.com/videos_mcm/' . $id . '.js'; dbug('url=' . $ret); $ret = CargaWebCurl($ret); if (enString($ret, "Access Denied")) { setErrorWebIntera("El vídeo de Univisión está bloqueado."); return; } $obtenido = array('enlaces' => array()); //imagen $imagen = entre1y2($ret, '"src_image_url":"', '"'); $imagen = strtr($imagen, array('\\' => '')); dbug('imagen=' . $imagen); //titulo $titulo = entre1y2($ret, '"def_title":"', '"'); $titulo = jsonRemoveUnicodeSequences($titulo); $titulo = limpiaTitulo($titulo); dbug('titulo=' . $titulo); if (!enString($ret, '"published_urls":[]')) { dbug('No aparece "published_urls":[]'); $json = substr($ret, strposF($ret, '(')); $json = substr($json, 0, strrpos($json, ')')); dbug_($json); $json = json_decode($json, true); dbug_r($json); $urls = array(); if (isset($json['published_urls'])) { foreach ($json['published_urls'] as &$url) { if (enString($url['embed_url'], '.mp4')) { $u =& $url['embed_url']; dbug_($u); $p = strrposF($u, '_'); $f = strpos($u, '.', $p); $calidad = substr($u, $p, $f - $p); $urls[] = array($u, $calidad); } } } dbug('urls: ' . count($urls)); //ya tenemos las urls en formato: /120615_2708697_El_Talisman_Capitulo_98_99___Ultimo_capitulo_1339800465_2000.mp4 //ordenar if (count($urls) > 0) { $urls = sortmulti($urls, 1, "123", true); } } if (enString($ret, '"published_urls":[]') || isset($urls) && count($urls) === 0) { dbug('No se pueden encontrar urls. Usando método 2'); // http://vmscdn-download.s3.amazonaws.com/videos_mcm/variant/2912557.m3u8 $m3u8FuenteUrls = 'http://vmscdn-download.s3.amazonaws.com/videos_mcm/variant/' . $id . '.m3u8'; dbug('$m3u8FuenteUrls = ' . $m3u8FuenteUrls); $m3u8FuenteUrls = CargaWebCurl($m3u8FuenteUrls); dbug($m3u8FuenteUrls); preg_match('@http://.*media(.*?)_[0-9]{3,4}.m3u8@', $m3u8FuenteUrls, $matches); dbug_r($matches); $urlBase = $matches[1]; $calidades = array(2000, 1200, 810, 800, 510, 500, 270, 150); $urls = array(); foreach ($calidades as $calidad) { $urlT = 'http://h.univision.com/media' . $urlBase . '_' . $calidad . '.mp4'; $urls[] = array($urlT, $calidad); } //ya tenemos las urls en formato: /120615_2708697_El_Talisman_Capitulo_98_99___Ultimo_capitulo_1339800465_2000.mp4 //ya está ordenado } $urls_length = count($urls); for ($i = 0; $i < $urls_length; $i++) { if ($urls[$i][1] == 2000) { $preContext = array('http' => array('method' => 'HEAD', 'header' => "User-agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0\r\n" . "Connection: close\r\n" . "Accept-Language: es-ES,es;en-US;en\r\n" . "Accept: text/html,application/xhtml+xml,application/xml\r\n", 'timeout' => 5, 'ignore_errors' => '1')); $preContext = stream_context_create($preContext); if (file_get_contents($urls[$i][0], false, $preContext) === false) { dbug('no se puede abrir la url de calidad 2000'); continue; } dbug_r($http_response_header); if (strpos($http_response_header[0], ' 404 ')) { dbug('la url de calidad 2000 da 404'); continue; } } if (esVideoAudioAnon($urls[$i][0])) { $obtenido['enlaces'][] = array('url' => $urls[$i][0], 'url_txt' => 'Calidad: ' . $urls[$i][1] . " Kbps", 'tipo' => 'http'); } } for ($i = 0, $ii = count($json['captions']); $i < $ii; $i++) { if ($json['captions'][$i]['language'] === 'es') { $url = $json['captions'][$i]['url']; $obtenido['enlaces'][] = array('url_txt' => 'Subtítulos en formato ' . substr($url, strrposF($url, '.')), 'url' => $url, 'tipo' => 'srt'); } } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; $obtenido['alerta_especifica'] = 'Si no puedes descargar el vídeo necesitas usar proxy.<br/>Descarga el programa ultrasurf (<a href="https://ultrasurf.us/download/u.zip">Descargar ultrasurf</a>), descomprime el archivo, ejecuta el programa y una vez hecho intenta descargar el vídeo de nuevo.<br/>Si 2000kbps da error prueba 1200kbps.'; finalCadena($obtenido, false); }
function parseaXMLNuevo(&$entrada, &$imagen, &$descripcion) { dbug('parseaXMLNuevo'); $ret_full = CargaWebCurl($entrada); dbug_($ret_full); if ($imagen === '') { $imagen = entre1y2($ret_full, '<background><![CDATA[', ']'); } if ($descripcion === '') { $descripcion = entre1y2($ret_full, '<description><![CDATA[', ']'); } return array('url' => strtr(entre1y2($ret_full, '<videoSource><![CDATA[', ']'), array('geodesprogresiva' => 'desprogresiva')), 'tipo' => 'http', 'url_txt' => entre1y2($ret_full, '<name><![CDATA[', ']')); }
function calcula() { $obtenido = array('enlaces' => array()); if (enString($this->web_descargada, 'href="/escucha2/"') && enString($this->web_descargada, 'href="/lo-mas/">m')) { $this->web_descargada = ReemplazaDeAPor($this->web_descargada, 'href="/escucha2/"', 0, 'href="/lo-mas/">m', ""); } //http://www.cadenaser.com/espana/articulo/rajoy-comparece-congreso-agosto/csrcsrpor/20130723csrcsrnac_4/Tes if (enString($this->web_descargada, "playerConfig")) { dbug("En la web oficial"); $ret = entre1y2($this->web_descargada, "playerConfig", "};"); $ret = strtr($ret, array(" " => "", '"' => "'")); if (enString($ret, "srcHTML5:'")) { $url = entre1y2($ret, "srcHTML5:'", "'"); } else { $url = entre1y2($ret, "src:'", "'"); } //imagen $obtenido['imagen'] = 'http://www.' . DOMINIO . '/canales/cadenaser.jpg'; if (enString($ret, "poster:'")) { dbug("imagen del vídeo"); $imagenTemp = entre1y2($ret, "poster:'", "'"); if ($imagenTemp != "") { $obtenido['imagen'] = $imagenTemp; } } //titulo $obtenido['titulo'] = utf8_encode(entre1y2($this->web_descargada, "<title>", "<")); $obtenido['enlaces'][] = array('url_txt' => "Descargar", 'url' => $url, 'tipo' => 'http'); } //http://www.cadenaser.com/espana/audios/antonio-alberca-ha-existido-parte-jaume-matas-delito-tipo/csrcsrpor/20130723csrcsrnac_24/Aes/ if (enString($this->web_descargada, "makePlayer")) { dbug("Insertado"); if (enString($this->web_descargada, '<li class="audios')) { $li = '<li class="audios'; $ret = '<li class="audios' . entre1y2($this->web_descargada, '<li class="audios', strrpos($this->web_descargada, "llévatelo</a></li>")); if (enString($ret, '<div id="lateral">')) { $ret = entre1y2($ret, 0, '<div id="lateral'); } } elseif (enString($this->web_descargada, '<ul class="audios modulo">')) { $li = "<li>"; $ret = entre1y2($this->web_descargada, '<ul class="audios modulo">', '</ul>'); } else { $li = "<li>"; $ret = entre1y2($this->web_descargada, 'class="audios', strrpos($this->web_descargada, "llévatelo</a></li>")); } dbug_($ret); $players = substr_count($ret, "makePlayer"); dbug("nº de makePlayers: " . $players); //titulo if (!isset($obtenido['titulo'])) { $obtenido['titulo'] = utf8_encode(entre1y2($this->web_descargada, "<title>", "<")); } $ini = count($obtenido['enlaces']); for ($i = 0, $p = 0; $i < $players; $i++) { $resTemp = $this->resuelvePlayer(entre1y2_a($ret, $p, $li, "</li>")); $obtenido['enlaces'][$ini + $players * 2 - $i * 2 - 2] = $resTemp[0]; $obtenido['enlaces'][$ini + $players * 2 - $i * 2 - 1] = $resTemp[1]; $p = strposF($ret, $li, $p); } //imagen if (!isset($obtenido['imagen'])) { $obtenido['imagen'] = entre1y2_a($this->web_descargada, strposF($this->web_descargada, '"og:image"'), '"', '"'); } } finalCadena($obtenido); }
function convierteID($asset, $modo = array('video', 'audio')) { $ret = ""; $modo_length = count($modo); for ($i = 0; $i < $modo_length && $ret == ''; $i++) { $codificado = $asset . '_banebdyede_' . $modo[$i] . '_es'; $codificado = self::encripta($codificado); $server5 = 'http://ztnr.rtve.es/ztnr/res/' . $codificado; dbug('idasset web=' . $server5); $ret = CargaWebCurl($server5); $ret = self::desencripta($ret); dbug_($ret); if (preg_match_all('@http://[^<^>]*?\\.(?:mp4|flv|mp3)[^<^>]*@', $ret, $m)) { dbug_r($m); foreach ($m[0] as $i) { dbug('Opcion (1): ' . $i); if (!enString($i, '1100000000000') && !enString($i, 'l3-onlinefs.rtve.es')) { $ret = $this->quita_geobloqueo($i); dbug('Opcion elejida: ' . $i); break; } } dbug('Opcion final: ' . $ret); } if (strpos($ret, 'http') !== 0 && preg_match_all('@http://[^<^>]*?\\.(?:flv)[^<^>]*@', $ret, $m)) { dbug_r($m); foreach ($m[0] as $i) { dbug('Opcion (2): ' . $i); if (!enString($i, '1100000000000')) { $ret = $this->quita_geobloqueo($i); dbug('Opcion elejida: ' . $i); break; } } } if (strpos($ret, 'http') !== 0) { dbug('$ret no es una web'); if (enString($ret, "code='state-not-valid'")) { $ret = ''; dbug('vídeo posíblemente borrado. Marcar error'); setErrorWebIntera('El vídeo ya no está disponible en RTVE. Lo sentimos.'); return false; } elseif (enString($ret, 'video-id-not-valid')) { setErrorWebIntera("No se ha podido encontrar ningún vídeo."); return false; } else { if (enString($ret, 'rtmpe://rtveod.fms.c.footprint.net/rtveod')) { $ret = strtr($ret, array('rtmpe://rtveod.fms.c.footprint.net/rtveod/' => 'http://mvod.lvlt.rtve.es/')); } $ret = 'http://' . entre1y2($ret, 'http://', '<'); $ret = $this->quita_geobloqueo($ret); } } } return $ret; }
function calcula() { /* http://www.mundofox.com/videos/quien-mato-patricia-soler-22664 https://player.ooyala.com/tframe.html?embedCode=FmZmowczoxwPru9zkOwKFWvZNW_K6JEH&amp;pbid=81a5821a635845fb8f8a1368a9b402e9#sthash.NnkiKZi8.dpuf <script type="text/javascript" src="//player.ooyala.com/v3/81a5821a635845fb8f8a1368a9b402e9?tweaks=android-enable-hls"></script> http://player.ooyala.com/v3/81a5821a635845fb8f8a1368a9b402e9?tweaks=android-enable-hls OO.ready(function() { OO.Player.create('ooyalaplayer', 'FmZmowczoxwPru9zkOwKFWvZNW_K6JEH'); }); "pcode":"NzYTAyOn6FTBAa0fo4wFfZoRHubJ" http://player.ooyala.com/player_api/v1/metadata/embed_code/81a5821a635845fb8f8a1368a9b402e9/FmZmowczoxwPru9zkOwKFWvZNW_K6JEH?videoPcode=NzYTAyOn6FTBAa0fo4wFfZoRHubJ& http://player.ooyala.com/info/primary/ respuesta: Vhor0n+Xh0BdBhI8INdUxJNndoWEZ5zeDYXPKxCfyCAY+/WCAU9AcfZYdiSUD+3sLZ0LnZVK2cqr5MFQv/7EfsxyC+kw1R+s9HhpuzMVDJ6YOKDcwNA4VSgs8JV7Ke9Nph6jjOOykyngC092EmUuS6c7ByJFCL369xt+23hrpNLzZsmmFrnagF0cDZlQsvo2xhOln6A25C8P0UqZMPx6rsflbKp2gGuOVU8WiBvk9DaplKfbTNxHSD4JWlFYMm1ZwEtIEFxOsLKfSK+fNNDvf8W0jHG3uPo4uYfV/1Jqc24vKlWC/dcmzy8Z/5SHSRKdpAUQT9Ea2aibNGzORFi4OLLsceN9sHkfhqhu/OIDIsSwxQpz38vLFA== http://player.ooyala.com/nuplayer?embedCode=FmZmowczoxwPru9zkOwKFWvZNW_K6JEH&playerBrandingId=81a5821a635845fb8f8a1368a9b402e9 respuesta: AmblfB/+bBWzUrZ3RwxRc9wa4Kaz95Rwd1caRsMiYT2AGJEps515LKtBaHrp v8r+KTNaluQJkrFQLd7eOXrWPl9qXmMCUpBwrNuyaVYd1VgEH/lQtUK0Q0ao k1mYAj7HQYSZjSG07VKt976VAiXfnC1XBHe/Kr3RN03byUqNRYNhKHVBfP5x 1eemRqsyhiARYJDoeMUVGOA55l/Lnn1hE+qSOP8jQKIGTm2kDVsw5EJcmGIV DqkVJLGmwUlceZdaNm7lSPpM3R2Pyi5Wv/tvT23VzGlQ82WAr50qAmi7optn soqV1DnZcj1s9f4Uv/Vk2QoPYvbze0uBCWyb+KZXmJyoM9gzz3gKf/bjq0p9 r8yS7xbYxvGWrnXnJtRNuxbS7SUNRjSSFYhjyYXggS7QNdcVYIib9LgAUsjx Co4ZAa3HENQ9l+s64sPmO9QFBl9McDewZnnIsf9uuwDwO6TCnbrydb/V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com/sas/authorized?analytics_params=%7B%22pcode%22%3A%22NzYTAyOn6FTBAa0fo4wFfZoRHubJ%22%7D&device=WIN%2016%2C0%2C0%2C305&domain=www.mundofox.com&embed_code_list=FmZmowczoxwPru9zkOwKFWvZNW_K6JEH&parent_authorized=true&playerType=full&signature=dMPkmR3luQfoR1vpnXrIra3D04gA8AznaIKxrVTbSno×tamp=1423361297617&token=AA-oI9kU1Dvf-0054d6c4d5-5xYuEbIJG1MKilRIiAxoWX.gksb9QkZhCUNEXxGs.04 respuesta: Zz6FR1Eq4YsJ4/hhMwTUqqZ/Ej4Z4vTeBS1Qp8AjLl6NEu5qkvHA97oiEPdR 8mGqNnneG5482VecYCob11IZQyTFDrHNTx6gM65fdZ36wg0RXNNVJpWxzZhQ ltFkBJW97gctNsp5m39ek10O3n148dScXzRz/lICStrwCdaVRXTTK2KX9Nch JtW+a+nRDoLQ1TomcsZJp5d5W6i3By60YyI6JzzrmBrfrxjSXQMEo6dwWbPF OYbZZ2KxNC4+0gXrlxEgNzjIsaKIlVnyKPMDKa6l5J46fy8bZHo5NjK2zgI3 The0IXK36fPL4/WkEQ8csU0JPSmOTZ9AVHWEtNXiL+siy7fqijBHQYi3kAZ8 6PkFDwDIh5kb5oLLZmxh/F+jn2c3reNm0ndpPgrMZf4fXuiPvcLLQR5ddCdt qVF8syD0YSEcLo1SYqd2DBdZeCQ6Zw4Q2oO9W5NEnGWhjwymhhnxweLmsMe5 jnMMm+02p83enLJLa5LXbxBHOc8zVXsc+t9OgtLSUEYmKJ3T18WTn/V/px9/ ToB+hG20u5Sj9dhOM07uoDy2VLVUs1fDM+q2uClCfiICZe91M9H36IF98ly6 6x3vDStgADKhv0xBP85nxf5RRNBD/wp/pYSIykYwMrEDJIYyYXOM5ZoYr/hJ aWtLpQ5FwClHy4Us9NVNdMqFgPW7VjcCIe2H6xpt2KIL6jMK222NY6u4y/JZ 37jJXlEoipfvrNiF/QQ9773demFMacC9GLX5S5W0CrM5k12tg4qfGdEACB0P WRosfMzJsg== Referer: http://player.ooyala.com/static/cacheable/947272d312bbb31971ab9ee0b28b5a1f/player_v2.swf?player=81a5821a635845fb8f8a1368a9b402e9 http://player.vimeo.com/external/117856376.hd.mp4?s=8c4b9b0d62db18eb3f0338b2b3963e43 http://pdl.vimeocdn.com/96029/918/329902523.mp4?token2=1423375948_2fde98bab4d75f510ef74a6c2616aaf4&aksessionid=72878d8fc8ad2a274ca033ecb04904639c6912c41423361548 http://player.ooyala.com/player.swf?player=81a5821a635845fb8f8a1368a9b402e9 http://player.ooyala.com/static/cacheable/947272d312bbb31971ab9ee0b28b5a1f/player_v2.swf?player=81a5821a635845fb8f8a1368a9b402e9 */ //Código if (preg_match('#OO\\.ready\\(function\\(\\).*?\'ooyalaplayer\'.*?\'(.+?)\'#', $this->web_descargada, $matches)) { dbug_r($matches); $embedCode = $matches[1]; } elseif (preg_match('#OO\\.Player\\.create\\(\'.+?\',\'(.+?)\'#', $this->web_descargada, $matches)) { dbug_r($matches); $embedCode = $matches[1]; } else { setErrorWebIntera('No se pudo encontrar algún vídeo.'); return; } $embedCode = trim($embedCode); if (preg_match('#player.ooyala.com/v3/(.+?)["\'\\?]#', $this->web_descargada, $matches)) { dbug_r($matches); $playerBrandingId = $matches[1]; } else { setErrorWebIntera('No se pudo encontrar algún vídeo.'); return; } $url = 'http://player.ooyala.com/nuplayer?autoplay=1&hide=all&embedCode=' . $embedCode; //$url = 'http://player.ooyala.com/nuplayer?embedCode='.$embedCode.'&playerBrandingId='.$playerBrandingId; $txt = CargaWebCurl($url); dbug_($txt); $res = ooyala_decrypt($txt); dbug_($res); $titulo = entre1y2($res, '<title>', '</'); if (enString($res, 'previewImages')) { $imagen = entre1y2_a($res, 'previewImages', '<url>', '</'); } else { preg_match('#<promo>.*:([a-zA-Z0-9]+?)<#', $res, $matches); dbug_r($matches); $imagen = entre1y2($res, '<shelfDomain>', '<') . '/' . $embedCode . '/' . $matches[1]; } $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array()); if (enString($res, '<flv_url>')) { $url = entre1y2($res, '<flv_url>', '</flv_url>'); $obtenido['enlaces'][] = array('url' => $url, 'url_txt' => 'Descargar', 'tipo' => 'http'); } else { $pcode = entre1y2($res, '<pcode>', '</pcode>'); $url = 'http://player.ooyala.com/sas/player_api/v1/authorization/embed_code/' . $pcode . '/' . $embedCode . '?device=android-html5&domain=www.mundofox.com&supportedFormats=m3u8,mp4&profiles=&_=1407599471980'; $txt = CargaWebCurlProxy($url, 'MX'); dbug_($txt); $data = entre1y2($txt, '"data":"', '"'); $m3u8 = base64_decode($data); //m3u8 downloade tiene un bug. Darle directamente el m3u8 que queremos $m3u8 = CargaWebCurl($m3u8); dbug_($m3u8); preg_match('#http[^\\r^\\n]*#', $m3u8, $matches); dbug_r($matches); $m3u8 = $matches[0]; $obtenido['enlaces'][] = array('url' => $m3u8, 'nombre_archivo' => generaNombreWindowsValido($titulo) . '.mp4', 'tipo' => 'm3u8'); } /* } else if (enString($res, '<httpDynamicStreamUrl>')) { $f4m = entre1y2($res, '<httpDynamicStreamUrl>', '</httpDynamicStreamUrl>'); $obtenido['enlaces'][] = array( 'url' => $f4m, 'nombre_archivo' => generaNombreWindowsValido($titulo) . '.mp4', 'tipo' => 'f4m' ); } */ finalCadena($obtenido); }
function bookmarklet() { if (strpos($this->web, 'http://www.dailymotion.com/embed/') === 0) { dbug('Lanza resultado'); return 'bookmarklet_form();'; } else { if (!enString($this->web_descargada, 'sequence=')) { return 'xhr("' . bm_scape($this->web) . '", null, function(data){lanzaDVxhr("' . bm_scape($this->web) . '", data);});'; } $urlContenedor = urldecode(entre1y2($this->web_descargada, 'sequence=', '"')); dbug_($urlContenedor); $jsonUrlContenedor = json_decode($urlContenedor, true); dbug_r($jsonUrlContenedor); dbug_($jsonUrlContenedor['config']['sharing']['embedCode']); $urlEmbed = entre1y2($jsonUrlContenedor['config']['sharing']['embedCode'], 'src="', '"'); dbug('Pedir embed'); return 'xhr("' . bm_scape($urlEmbed) . '", null, function(data){lanzaDVform("http:' . bm_scape($urlEmbed) . '", data);});'; } }
function calcula() { //soundcloud va a base de https, por lo que si alguna url http consigue llegar, toca pasarla a https $this->web = strtr($this->web, array("http://" => "https://")); $retfull = CargaWebCurl($this->web); $obtenido = array('enlaces' => array()); //<img class="waveform" src="http://w1.sndcdn.com/9y15N1tRAubf_m.png" unselectable="on" /> //detectar si hay varios enlaces o solo uno $canciones = substr_count($retfull, '<img class="waveform"'); //dbug('total canciones='.$canciones); $imagen = 'http://www.' . DOMINIO . '/canales/soundcloud.png'; //no sabemos cuantas queremos, pero es del modo nuevo y posiblemente varias. if (enString($retfull, "Next SoundCloud") || true) { dbug('Next SoundCloud'); $client_id = 'b45b1aa10f1ac2941910a7f0d10f8e28'; /* Lista de ids de clientes: Plug.dj => bd7fb07288b526f6f190bfd02b31b25e */ $carga = CargaWebCurl('https://api.sndcdn.com/resolve?url=' . $this->web . '&_status_code_map[302]=200&_status_format=json&client_id=' . $client_id, '', 0, '', array(), false); dbug_($carga); if (enString($carga, 'tracks/')) { //una cancion dbug('Una canción'); //Descargar la web para comprobar título y si tiene descarga gratis $carga = CargaWebCurl(entre1y2($carga, '"location":"', '"')); //comprobar si es stremeable. Si no lo es, fin del programa if (enString($carga, '<streamable type="boolean">false')) { setErrorWebIntera('La descarga de esta canción está bloqueada.'); return; } preg_match('#tracks/([0-9]+)#', $carga, $match); $uri = $match[1]; dbug($uri); $url = 'http://api.soundcloud.com/tracks/' . $uri . '/stream?client_id=' . $client_id; //titulo $titulo = entre1y2($this->web_descargada, '<title>', '</'); if (enString($carga, "<artwork-url>")) { $imagen = entre1y2($carga, '<artwork-url>', '</'); } if (enString($carga, '<downloadable type="boolean">true') || enString($carga, '"downloadable":true')) { $url = 'http://api.soundcloud.com/tracks/' . $uri . '/download?client_id=' . $client_id; } array_push($obtenido['enlaces'], array('url' => $url, 'tipo' => 'http', 'extension' => 'mp3')); dbug($titulo . ' - ' . $url); } else { //varias canciones dbug('Varias canciones'); //titulo generico $titulo = "SoundCloud"; //recortar web para sacar solo la id del user $f = strpos($this->web, '/', 8); $f2 = strpos($this->web, '/', $f + 1); if ($f2 > 0) { $webMod = substr($this->web, 0, $f2); } else { $webMod = $this->web; } //https://api.sndcdn.com/resolve?url=https%3A//soundcloud.com/forestrf&_status_code_map[302]=200&_status_format=json&client_id=b45b1aa10f1ac2941910a7f0d10f8e28 $id = CargaWebCurl('https://api.sndcdn.com/resolve?url=' . $webMod . '&_status_code_map[200]=200&_status_format=json&client_id=' . $client_id); dbug('user info=' . $id); $p = strpos($id, '<id'); $p = strposF($id, '>', $p); $f = strpos($id, '<', $p); $id = substr($id, $p, $f - $p); if (enString($id, '"')) { $id = entre1y2($id, '"id":', ','); } dbug('id=' . $id); $stack = 500; $maxResTotal = 500; //likes //favorites //sounds //sets //playlists if (enString($this->web, 'sets') || enString($this->web, 'playlists')) { $id = CargaWebCurl('https://api.soundcloud.com/resolve?url=' . $this->web . '&_status_code_map[200]=200&_status_format=json&client_id=' . $client_id, "", 0, "", array(), false); $p = strposF($id, 'playlists/'); $f = strpos($id, '?', $p); $id = substr($id, $p, $f - $p); $tipoUrl = 2; } elseif (enString($this->web, 'likes') || enString($this->web, 'favorites')) { $tipoUrl = 0; } else { $tipoUrl = 1; } $mult = 0; $acabado = false; while (!$acabado && $stack * $mult <= $maxResTotal) { $resResD = $stack * $mult; if ($tipoUrl == 0) { $carga = CargaWebCurl('http://api.soundcloud.com/users/' . $id . '/favorites.json?limit=' . $stack . '&offset=' . $resResD . '&client_id=' . $client_id); } elseif ($tipoUrl == 1) { $carga = CargaWebCurl('http://api.soundcloud.com/users/' . $id . '/tracks.json?limit=' . $stack . '&offset=' . $resResD . '&client_id=' . $client_id); } elseif ($tipoUrl == 2) { $carga = CargaWebCurl('http://api.soundcloud.com/playlists/' . $id . '.json?limit=' . $stack . '&offset=' . $resResD . '&client_id=' . $client_id); } if (enString($carga, '[{')) { dbug('mult => ' . $mult); $ronda = $ult = 0; $carga = entre1y2($carga, '[{', '}]'); while (strpos($carga, 'kind":"track"', $ult) > 0 && $ronda < $stack) { $ult = strpos($carga, 'kind":"track"', $ult); if (entre1y2_a($carga, $ult, '"downloadable":', ',') == "true") { $modoUrl = "download"; } else { $modoUrl = "stream"; } $tit = jsonRemoveUnicodeSequences(entre1y2_a($carga, $ult, '"title":"', '"')); $p = strpos($carga, '"uri":"', $ult); $p = strposF($carga, 'tracks/', $p); $f = strpos($carga, '"', $p); $f2 = strpos($carga, '/', $p); if ($f > $f2) { $f = $f2; } $url = 'http://api.soundcloud.com/tracks/' . substr($carga, $p, $f - $p) . '/' . $modoUrl . '?client_id=' . $client_id; dbug($tit . ' - ' . $url); //dbug($ult); array_push($obtenido['enlaces'], array('url' => $url, 'tipo' => 'http', 'extension' => 'mp3', 'url_txt' => $tit)); $ronda++; $ult++; } if ($ronda == $stack) { $mult++; } else { $acabado = true; } } else { $acabado = true; } } } } $obtenido['titulo'] = $titulo; $obtenido['imagen'] = $imagen; finalCadena($obtenido, false); }