php - 七牛抓取第三方资源返回404?
滿天的星座
滿天的星座 2017-05-16 13:06:56
0
1
426

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]"

滿天的星座
滿天的星座

reply all(1)
Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!