View Single Post
  #8  
Old 07-05-2014, 01:08 AM
denobis denobis is offline
Senior Member
 
Join Date: Sep 2013
Posts: 568
denobis is on a distinguished road
Default

Re: Help me with myvideo.de


Hi,

also to complete the script you can generate the token manually

Code:
	function sprint($time)
		 {
		 $time		=getdate($time);
		 $sprint	=array("mon","mday","hours","minutes","seconds");				
                 foreach ($sprint as $x) $time[$x]=sprintf("%02d",$time[$x]);
		 	
		 return          $time["year"].$time["mon"].$time["mday"].
		 		 $time["hours"].$time["minutes"].$time["seconds"];		
		 }
	
	function generateUrlToken($path, $token, $duration)
		{

// $path as explode("/",$conn)[3]  i.e. myvideo3 or so
		 
		 $start_time	=time();
		
		 $expir		="start_time=".sprint($start_time)."&end_time=".sprint($start_time+$duration);					  		  			  
// $token normally "Berlinale"		 
	         return base64_encode($expir."&digest=".md5($path."?".$expir."#".$token));
	      	}
Reply With Quote