v2.1.14-20240414

This commit is contained in:
MI15\Win
2024-04-14 15:42:25 +08:00
parent fe1244b099
commit 1aa4bb0634
26 changed files with 106 additions and 262 deletions

View File

@@ -521,6 +521,9 @@ function Get_IP() {
//获取URL状态码
function get_http_code($url,$TIMEOUT = 10 ,$NOBODY = true) {
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
return false;
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 1);
@@ -535,6 +538,9 @@ function get_http_code($url,$TIMEOUT = 10 ,$NOBODY = true) {
}
function ccurl($url,$overtime = 3,$Referer = false,$post_data = false){
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
return false;
}
try {
$curl = curl_init ( $url ) ; //初始化
curl_setopt($curl, CURLOPT_TIMEOUT, $overtime ); //超时
@@ -565,6 +571,9 @@ function ccurl($url,$overtime = 3,$Referer = false,$post_data = false){
}
function downFile($url, $file = '', $savePath = './data/temp/',$referer = '',$TIMEOUT = 60,$post_data = false){
if(!preg_match("/^(http:\/\/|https:\/\/).*/",$url)){
return false;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, $TIMEOUT); //超时/秒