我我的本地機器上進行投入是
Array ([stream_h264_sd_url] => http://www.dailymotion.com/cdn/H264-320x240/video/xt27x1.mp4?auth=1409329979-2562-powad7sw-c7d26f9df92ba4975d710020e793bd6d [stream_h264_hq_url] => [stream_h264_url] => http://www.dailymotion.com/cdn/H264-512x384/video/xt27x1.mp4?auth=1409329979-2562-s4iclgxy-6f7a4eed9658bc22bf4551c3991bb400 [stream_h264_hd_url] =>)
確保您的捲曲和PHP是最新上運行代碼
也請注意,我改變$會話$ _SESSION是一個全球性的並且還可能導致問題
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.dailymotion.com/json/video/xt27x1?fields=stream_h264_sd_url,stream_h264_hq_url,stream_h264_url,stream_h264_hd_url");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($ch);
curl_close($ch);
print_r(json_decode($content,true));
複製你的代碼到這裏似乎工作:http://www.compileonline.com/execute_php_online.php難道說可以快速連續多次請求的意思是請求IGN因爲我得到了一些警告。 – 2014-08-27 16:24:16
嗨,我只是更新我的文章,可以看到新的代碼。謝謝。 – OPUS 2014-08-27 18:57:10