1.七牛抓取第三方资源 始终返回404 找不到第三方资源
2.这是我写的抓取部分代码,用的是thinkphp3.2自带的七牛类
//第三方资源抓取
public function fetch($url, $key)
{
$url = self::Qiniu_Encode($url);
$request_url = "http://iovip.qbox.me/fetch/{$url}/to/" . self::Qiniu_Encode("{$this->bucket}:{$key}");
$accessToken = $this->accessToken($request_url);
$response = $this->request($request_url, 'POST', array('Content-Type:' => 'application/x-www-form-urlencoded', 'Authorization' => "QBox $accessToken"));
return $response;
}
3.抓取的资源:https://www.baidu.com/img/bd_...
4.返回的错误提示: [HTTP/1.1 404 Not Found]:Not Found]"
I found the problem. The host provided by Qiniu official website is: iovip.qbox.me. This host can no longer be used as a resource crawler. It has been changed to iovip-z2.qbox.me. This is the host in Qiniu PHP SDK. After replacement It can be used normally. No problem