eski eklenen videolarda sıkıntı yok çalıştırıyor ancak yeni eklenen videolarda videoyu çekmiyor sistem..
kullandıgım sistem ise herkezin kullandıgı sistem.
<?php
function faceduzelt($q){
if(stristr($q,'http://')){
preg_match('/([\d]+)*_[\d]+\./',$q,$fastphp);
}else{
$fastphp[1]=$q;
}
if(@file_exists('cache/video_'.$fastphp[1].'.txt')){
$gdsy=@file_get_contents('cache/video_'.$fastphp[1].'.txt');
$headers = get_headers($gdsy, 1);
if( $headers[0] == 'HTTP/1.1 200 OK' || $headers[0] == 'HTTP/1.0 200 OK' || $headers[1] == 'HTTP/1.1 200 OK' || $headers[1] == 'HTTP/1.0 200 OK' ){
return $gdsy;
}else{
$veri = stripslashes(file_get_contents("http://www.facebook.com/ajax/flash/expand_inline.php?target_div=u879823_18&__a=1&v=".$fastphp[1]));
preg_match('#"video_src"\,"(.*?)"#',$veri,$fastphp2);
$json = json_decode('{"url": "'.$fastphp2[1].'"}');
$cache_file = fopen('cache/video_'.$fastphp[1].'.txt' , 'w');
fwrite ($cache_file, urldecode($json->{'url'})) ;
fclose ($cache_file);
return urldecode($json->{'url'});
}
}else{
$veri = stripslashes(file_get_contents("http://www.facebook.com/ajax/flash/expand_inline.php?target_div=u879823_18&__a=1&v=".$fastphp[1]));
preg_match('#"video_src"\,"(.*?)"#',$veri,$fastphp2);
$json = json_decode('{"url": "'.$fastphp2[1].'"}');
$cache_file = fopen('cache/video_'.$fastphp[1].'.txt' , 'w');
fwrite ($cache_file, urldecode($json->{'url'})) ;
fclose ($cache_file);
return urldecode($json->{'url'});
}
}
$adres = faceduzelt(addslashes(htmlspecialchars($_GET['vid'])));
header("Location: ".$adres);
?>