示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
<script>
	function xhr_swf(url){
		if(typeof DESCARGADOR_ARCHIVOS_SWF === "undefined"){
			setTimeout(function(){xhr_swf(url)}, 200)
		}
		else if(DESCARGADOR_ARCHIVOS_SWF === true){
			getFlashMovie("descargador_archivos").CargaWeb({
				"url":url
				,"metodo":"GET"
			}, "imprime");
		}
	}
	
	function imprime(txt){
		D.g("resultado").value += txt;
	}
	
	if(typeof descargador_archivos === "undefined"){
		D.g("enlaces").innerHTML += '<?php 
echo genera_swf_object('/util/fla/f/player.swf');
?>
';
		var descargador_archivos = D.g("descargador_archivos");
	}
</script>





示例#4
0
    function calcula()
    {
        // http://www.discoverymax.es/wp-content/plugins/dni_carrington_build_modules/modules/dni-video-playlist/video.php?instanceID=dni-video-playlist-611327198&instance_id=dni-video-playlist-611327198&video_player_id=3570805961001&video_player_key=AQ%7E%7E%2CAAAAAFIw8-k%7E%2CRzpKFESr-2ALjDz9LZTdOIeBssZPLQ5q&autostart=false&playlist=
        $obtenido = array('enlaces' => array(), 'alerta_especifica' => 'Todos los vídeos indican ocupar 2GB a pesar de no ser real. El tamaño de los vídeos que indica la descarga no es real.');
        $p = strpos($this->web_descargada, '<iframe');
        //http://c.brightcove.com/services/messagebroker/amf?playerKey=AQ~~,AAAAEUA28vk~,ZZqXLYtFw-ADB2SpeHfBR3cyrCkvIrAe
        if (enString($this->web_descargada, '<param name="playerKey"')) {
            $playerKey = entre1y2($this->web_descargada, '<param name="playerKey" value="', '"');
        } elseif (enString($this->web_descargada, 'video_player_key=')) {
            $playerKey = urldecode(entre1y2_a($this->web_descargada, $p, 'video_player_key=', '&'));
        } else {
            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, '<param name="playerID"')) {
            $experienceID = entre1y2($this->web_descargada, '<param name="playerID" value="', '"');
        } elseif (enString($this->web_descargada, 'video_player_id=')) {
            $experienceID = urldecode(entre1y2_a($this->web_descargada, $p, 'video_player_id=', '&'));
        } else {
            setErrorWebIntera('No se ha encontrado ningún vídeo.');
            return;
        }
        dbug('experienceID -> ' . $experienceID);
        if (preg_match('@#([0-9]+?)$@', $this->web, $matches)) {
            $contentId = $matches[1];
        } elseif (enString($this->web_descargada, 'playlist=')) {
            $contentId = urldecode(entre1y2_a($this->web_descargada, $p, 'playlist=', '"'));
        } else {
            setErrorWebIntera('No se ha encontrado ningún vídeo.');
            return;
        }
        dbug('contentId -> ' . $contentId);
        include 'brightcove-funciones.php';
        $a_encodear = array('target' => 'com.brightcove.experience.ExperienceRuntimeFacade.getDataForExperience', 'response' => '/1', 'data' => array('0' => '9445764b9bbb1dcb6ca98bb1b0c00cb2762cd3f8', '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('contentType' => 0, 'featuredId' => NAN, 'contentId' => $contentId, 'featuredRefId' => null, 'contentIds' => null, 'target' => 'videoPlayer', 'contentRefId' => null, 'contentRefIds' => null))))))));
        $post = brightcove_encode($a_encodear);
        // Por culpa de geobloqueo, la llamada la hará un swf en lugar de descargavideos y el js sacará las urls
        $urlJS = 'function lanzaDiscoveryMax(){
		if(typeof DESCARGADOR_ARCHIVOS_SWF === "undefined"){
			setTimeout(lanzaDiscoveryMax, 200)
		}
		else if(DESCARGADOR_ARCHIVOS_SWF === true){
			getFlashMovie("descargador_archivos").CargaWeb({
				"url":"' . $messagebroker . '"
				,"metodo":"POST"
				,"contentType":"application/x-amf"
				,"postBase64":"' . base64_encode($post) . '"
				,"resp":"base64"
			}, "procesaDiscoveryMax");
		}
	}
	
	function procesaDiscoveryMax(txt){
		var x = Base64Binary.decode(txt);
		var mediaDTO = decodeAMF(x).messages[0].body.programmedContent.videoPlayer.mediaDTO;
		var titulo = mediaDTO.displayName;
		var img = mediaDTO.videoStillURL;

		D.g("imagen_res").src = decode_utf8(img);
		D.g("titulo_res").innerHTML = decode_utf8(titulo);
		
		var res = mediaDTO.renditions[0];
		for(var i = 1; i < mediaDTO.renditions.length; i++){
			if(mediaDTO.renditions[i].encodingRate > res.encodingRate){
				res = mediaDTO.renditions[i];
			}
		}

		mostrarResultado(res.defaultURL);
	}
	
	function decode_utf8(s) {
  		return decodeURIComponent(escape(s));
	}
	
	
	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/player.swf') . '\';
		var descargador_archivos = D.g("descargador_archivos");
	}
	
	lanzaDiscoveryMax();';
        $titulo = '';
        $imagen = '';
        $obtenido = array('titulo' => $titulo, 'imagen' => $imagen, 'enlaces' => array(array('url' => strtr($urlJS, array("\t" => '', "\r" => '', "\n" => '')), 'tipo' => 'jsFlash')));
        /*
        dbug('a descargar: '.$messagebroker);
        
        $t=brightcove_curl_web($messagebroker,$post);
        echo bin2hex($t);
        /*
        $res_decoded=brightcove_decode($t);
        dbug('RESPUESTA BRIGHTCOVE:');
        dbug_r($res_decoded);
        
        
        if($res_decoded['data'] === null){
        	// Seguro que el vídeo no funciona en la página oficial.
        	setErrorWebIntera('No se puede reproducir el vídeo desde el enlace que ha indicado.');
        	return;
        }
        
        $base=$res_decoded['data']->getAMFData();
        $base=$base['programmedContent']['videoPlayer']->getAMFData();
        $base=$base['mediaDTO']->getAMFData();
        $titulo=$base['displayName'];
        $imagen=$base['videoStillURL'];
        dbug('titulo = '.$titulo);
        dbug('imagen = '.$imagen);
        
        
        $obtenido['enlaces'] = brightcove_genera_obtenido($this, $base, array(
        	'IOSRenditions' => 'm3u8',
        	'renditions' => 'http'
        ), $titulo);
        	
        
        $obtenido['titulo']=$titulo;
        $obtenido['imagen']=$imagen;
        */
        finalCadena($obtenido, false);
    }