Arkadaslar film sitem icin facebook kendi uploadlarımı yapıyorum. Fakat video gizliligini acmadan nasıl cekilcegini anlamadım. R10. da anlatılmıs fakat bilen biri bana acıklayabilirmi.
Kod:
//videoyu upload ettiğiniz account bilgileri//
$mailim="[email protected]";
$sifrem="şifreniz";
//////////////////////////////////////////////
function zuckerimberk($user,$pass)
{
global $ch;
curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_REFERER, 'http://www.facebook.com/');
curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?login_attempt=1');
curl_setopt($ch, CURLOPT_POSTFIELDS,'persistent=1&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&locale=en_US&email='.urlencode($user).'&pass='.urlencode($pass).'&pass_placeholder=&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84');
curl_setopt($ch, CURLOPT_POST, 1);
curl_exec($ch);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; tr; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$abartma=0;
function faceduzeltcache($videoid)
{
global $ch,$mailim,$sifrem,$abartma;
curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
curl_setopt($ch, CURLOPT_URL, "http://www.facebook.com/ajax/flash/expand_inline.php?target_div=u879823_18&__a=1&v=$videoid");
$al = curl_exec($ch);
$al = stripslashes($al);
// Privacy Check Failed
if(stristr($al,"Privacy Check Failed"))
{
// echo "gizli video";
if($abartma<3)
{
zuckerimberk($mailim,$sifrem);
return faceduzeltcache($videoid);
$abartma++;
}
else
{
break;
}
}
$exp=explode("\"video_src\", \"",$al);
$exp=explode("\");",$exp[1]);
$son=$exp[0];
$json = '{"url": "'.$son.'"}';
$json = json_decode($json);
$json= urldecode($json->{'url'});
return $json;
}
function faceduzelt2cache($urele,$zamanaraligi)
{
$explode=explode("/",$urele);
$say=count($explode);
$son=$explode[$say-1];
$explode2=explode("_",$son);
$videoaydi=$explode2[0];
// cache kısımları //
$kueri = mysql_query("select * from cache where videoid = '".$videoaydi."' order by id desc limit 1");
$cachevarmi=mysql_num_rows($kueri);
if($cachevarmi)
{
$alsana=mysql_fetch_assoc($kueri);
$expire=$alsana["expire"];
if(time() >= $expire)
{
$sonanlikveri=faceduzeltcache($videoaydi);
$expiresuresi=time()+$zamanaraligi;
mysql_query("update cache set expire='".$expiresuresi."', cache = '".$sonanlikveri."' where id ='".$alsana["id"]."' ");
return urlencode($sonanlikveri);
}
else
{
return urlencode($alsana["cache"]);
}
}
else
{
$sonanlikveri=faceduzeltcache($videoaydi);
$expiresuresi=time()+$zamanaraligi;
mysql_query("insert into cache (expire,cache,videoid) values ('".$expiresuresi."','".$sonanlikveri."','".$videoaydi."') ") or die(mysql_error());
return urlencode($sonanlikveri);
}
}
//videonun çalışan halini bu şekilde alıyoruz, sondaki 3600 rakamı cache süresi, yani 3600 saniye (1 saat), degiştirebilirsiniz.
echo faceduzelt2cache("http://cfs-ak-snc6.facebook.com/79079/657/434431932890_37287.mp4",3600);