Retrieve curl data with client headers/IP

谁说我不能喝 提交于 2019-12-12 05:07:35

问题


$url_in = 'http://vk.com/video_ext.php?oid=3145131&id=159485516&hash=d821df23b7dc0b54&hd=1';  
function curl($url, $cookie = false, $post = false, $header = false, $follow_location = false)  
{ 
$ch = curl_init($url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_FAILONERROR, true); 
curl_setopt($ch, CURLOPT_HEADER, $header); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $follow_location); 
if ($cookie) { 
    curl_setopt ($ch, CURLOPT_COOKIE, $cookie); 
} 
if ($post) { 
    curl_setopt($ch, CURLOPT_POST, 1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
} 
$response = curl_exec ($ch); 
curl_close($ch); 
return $response; 
} 

$vk_video = curl($url_in); 
preg_match('|host=(.*)&|Uis', $vk_video, $link1); 
preg_match('|uid=(.*)&|Uis', $vk_video, $link2); 
preg_match('|vtag=(.*)&|Uis', $vk_video, $link3); 
$link= $link1['1'].'u'.$link2['1'].'/video/'.$link3['1'].'.360.mp4';
echo $link;

the problem is that vtag= is different for every ip client so how can i retrieve the vtag with client ip?

来源:https://stackoverflow.com/questions/13362874/retrieve-curl-data-with-client-headers-ip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!