Ufak bi kod lazım olmuştu yazdım paylaşayım dedim.
Bu kodla flvnin bulunduğu servere kadar bulabliyoruz.
Örnek verirsek
"---x4KIJVQ0" idli videonun adresi : http://lax-v97.lax.youtube.com/get_v...id=---x4KIJVQ0
Kodlar :
function baglanti($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "MSIE 6.0; Windows NT 5.0");
curl_setopt($ch, CURLOPT_URL, "$url" );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
$sonuc = curl_exec($ch);
curl_close($ch);
return $sonuc;
}
$vid = "---x4KIJVQ0";
$tal= baglanti("http://www.youtube.com/v/$vid");
preg_match("#t=(.*?)&#si",$tal,$tid);
$tid = $tid[1];
$val = baglanti("http://www.youtube.com/get_video?video_id=$vid&t=$tid");
preg_match("#Location: (.*?).youtube.com#si",$val,$son);
$video = $son[1].".youtube.com/get_video?video_id=".$vid;
if(eregi("cache.google",$video)) {
preg_match("#origin=(.*?).youtube.com#si",$video,$son2);
$video= "http://".$son2[1].".youtube.com/get_video?video_id=".$vid;
}
echo $video;$vid = "---x4KIJVQ0";Burdaki $vid videonun id si. Bunu değiştirrek deneyebilirsiniz
(