php - Qiniu crawls third-party resources and returns 404?
滿天的星座
滿天的星座 2017-05-16 13:06:56
0
1
539

1. Qiniu crawls third-party resources and always returns 404 Third-party resources not found

2. This is the crawling part code I wrote, using the Qiniu class that comes with thinkphp3.2

 //Third-party resource capture
    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. Fetched resources: https://www.baidu.com/img/bd_...

4. The error message returned: [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