update
This commit is contained in:
@ -60,7 +60,11 @@ class BaiduRecordCommand extends BaseSpider
|
||||
{
|
||||
$cache = [];
|
||||
$requestCookie = '';
|
||||
$query = AppNews::query()->where('is_delete', 0)->where('is_record', 0);
|
||||
$query = AppNews::query()
|
||||
->where('is_delete', 0)
|
||||
->where('is_record', 0)
|
||||
->orderBy(Db::raw('RAND()'))
|
||||
->limit(10);
|
||||
if ($id) {
|
||||
$query = $query->where('id', $id);
|
||||
}
|
||||
@ -90,6 +94,8 @@ class BaiduRecordCommand extends BaseSpider
|
||||
|
||||
if (stripos($res, '验证') !== false || stripos($res, 'wappass') !== false) {
|
||||
$this->log->info('有验证码!!');
|
||||
// 有验证码就跳出
|
||||
return;
|
||||
}
|
||||
|
||||
(new Crawler($res))?->filter('.abs')?->each(function ($node) use ($domain, $item) {
|
||||
|
@ -4,4 +4,4 @@ use Hyperf\Crontab\Schedule;
|
||||
|
||||
// 百度自动查收录
|
||||
// 每12个小时运行一次
|
||||
Schedule::command('spider:baidu-record')->setName('spider:baidu-record')->setRule('0 */12 * * *');
|
||||
Schedule::command('spider:baidu-record')->setName('spider:baidu-record')->setRule('*/5 * * * *');
|
Reference in New Issue
Block a user