http://mmbiz.qpic.cn/mmbiz/k6icfiaupuzpxworf6eg7p9bgqvlwfyveupnttxhcgn...
如上面的图片,用curl获取就变成了
试着加user-agent等信息还是不行。
回复内容: http://mmbiz.qpic.cn/mmbiz/k6icfiaupuzpxworf6eg7p9bgqvlwfyveupnttxhcgn...
如上面的图片,用curl获取就变成了
试着加user-agent等信息还是不行。
可能微信资源服务器用了盗链技术吧、类似java里filter过滤器的东西
根据请求的浏览器类型之类的信息判定是否盗链。
是微信就正常返回,其他请求就直接返回盗链图。
评论中得出答案'user-agent' => 'mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, like gecko) chrome/41.0.2272.89 safari/537.36',
'mmbiz.qpic.cn',
'connection' => 'keep-alive',
'pragma' => 'no-cache',
'cache-control' => 'no-cache',
'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8',
'user-agent' => 'mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, like gecko) chrome/41.0.2272.89 safari/537.36',
'accept-encoding' => 'gzip, deflate, sdch',
'accept-language' => 'zh-cn,zh;q=0.8,en;q=0.6,zh-tw;q=0.4'
);
$options = array(
curlopt_httpheader => $httpheader,
curlopt_url => $url,
curlopt_timeout => 5,
curlopt_followlocation => 1,
curlopt_returntransfer => true
);
curl_setopt_array( $ch , $options );
$result = curl_exec( $ch );
curl_close($ch);
file_put_contents( './i.jpg', $result );
这个应该跟 refer 有关吧,网页中引用的refer相对于微信是外域网站,但是refer为空的情况下是可以打开该链接的,楼主可以把图片地址复制到一个新tab里打开试试
adsfasdfasd