mirror of
https://gitee.com/ledc/IYUUAutoReseed
synced 2026-10-23 21:33:59 +00:00
新增城市,优化下载函数
This commit is contained in:
1 parent
9e688e86d2
commit
b54695f084
6 files changed
+221
-3
No files matched your search
@@ -143,8 +143,14 @@ function download($url, $cookies, $useragent, $method = 'GET')
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,60);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT,600);
|
||||
$data = curl_exec($ch);
|
||||
$status = curl_getinfo($ch);
|
||||
curl_close($ch);
|
||||
return $data;
|
||||
if (isset($status['http_code']) && $status['http_code'] == 200) {
|
||||
return $data;
|
||||
}
|
||||
if (isset($status['http_code']) && $status['http_code'] == 302) {
|
||||
return download($status['redirect_url'], $cookies, $useragent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user