日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > php >内容正文

php

php querylist 404,Querylist批量采集碰到404咋办

發(fā)布時(shí)間:2023/12/29 php 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php querylist 404,Querylist批量采集碰到404咋办 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

public function makeids()

{

$index = input('param.index');//接收id用于半自動(dòng)采集

$last = input('param.last');//接收id用于半自動(dòng)采集

set_time_limit(3600);

$urlmake = [];

$ql = QueryList::getInstance();

for ($i = $index; $i <=$last; $i++) {

for ($j = $i . '000'; $j <= $i . '999'; $j++) {

if (ISCESHI){

$url = LOCALURL."/index.php/index/index/getlists/id/" . $i . '_' . $j;

}else{

$url = SERVICE."/index.php/index/index/getlists/id/" . $i . '_' . $j;

}

$urlmake [] = $url;

if(count($urlmake)>=5){

$ql->use(CurlMulti::class);

$ql->curlMulti($urlmake)

->success(function (QueryList $ql, CurlMulti $curl, $r) {

echo "Current url:{$r['info']['url']} \r\n";

// ? ? ? ? ? ? ? ?if (!empty($r)){

$this->getlists($r['info']['url']);

// ? ? ? ? ? ? ? ?}

unset($urlmake);

$ql->destruct();

})

->start([

// 最大并發(fā)數(shù),這個(gè)值可以運(yùn)行中動(dòng)態(tài)改變。

'maxThread' => 1999,

// 觸發(fā)curl錯(cuò)誤或用戶錯(cuò)誤之前最大重試次數(shù),超過(guò)次數(shù)$error指定的回調(diào)會(huì)被調(diào)用。

'maxTry' => 3,

// 全局CURLOPT_*

'opt' => [

CURLOPT_TIMEOUT => 3600,

// ? ? ? ? ? ? ? ? ? ?CURLOPT_CONNECTTIMEOUT => 1,

CURLOPT_CONNECTTIMEOUT => 0,

CURLOPT_RETURNTRANSFER => true

],

// 緩存選項(xiàng)很容易被理解,緩存使用url來(lái)識(shí)別。如果使用緩存類庫(kù)不會(huì)訪問(wèn)網(wǎng)絡(luò)而是直接返回緩存。

'cache' => ['enable' => false, 'compress' => false, 'dir' => null, 'expire' => 86400, 'verifyPost' => false]

]);

}

}

}

}

總結(jié)

以上是生活随笔為你收集整理的php querylist 404,Querylist批量采集碰到404咋办的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。