function curl($url){
set_time_limit(0);
$userAgent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_TIMEOUT, 0);
curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
$data = curl_exec($curl);
curl_close($curl);
return $data;
}
$json = curl("http://ok.ru/dk?cmd=videoPlayerMetadata&mid=9309783406");
$obj = json_decode($json);
foreach($obj->videos as $videos){
$string = $videos->url;
echo $string.'
';
}
?>
şu kodu denedim ve video linklerini veriyor ve videolar açılıyor bilginize