diff --git a/code/app/task/crawler/zw/page/ChapterPage.php b/code/app/task/crawler/zw/page/ChapterPage.php index 3c26414..9cb1c7b 100644 --- a/code/app/task/crawler/zw/page/ChapterPage.php +++ b/code/app/task/crawler/zw/page/ChapterPage.php @@ -96,10 +96,10 @@ class ChapterPage extends BasePage } else { $this->arrChapterInfo['c_page_data'] = NULL; - if(config('log.task_debug_log_open_status')){ + $incKey = config('task.app_name').'_getChapterInfo_lastread_null:' . date('Y-m-d'); + $this->redisDailyInc($incKey); - $incKey = config('task.app_name').'_getChapterInfo_lastread_null:' . date('Y-m-d'); - $this->redisDailyInc($incKey); + if(config('log.task_debug_log_open_status')){ // 记录失败原因 \think\facade\Log::error("Request getChapterInfo_lastread == NULL , c_page_data == NULL, "); diff --git a/code/app/task/crawler/zw/page/Site.php b/code/app/task/crawler/zw/page/Site.php index 167ce93..0706b12 100644 --- a/code/app/task/crawler/zw/page/Site.php +++ b/code/app/task/crawler/zw/page/Site.php @@ -296,6 +296,13 @@ class Site continue; } + // 如果不匹配有这个 说明没有请求到小说章节 或者 章节为空 + $strPattern = "/lastread\.set\((.*?)\);/"; + if (!preg_match($strPattern, $strContent, $arrMatches)) { + var_dump(mb_substr($strContent, 0, 300)); // 防止输出太长 + continue; + } + $ChapterPage = $this->getChapterPage($this, $arrFilter[$intKey]['uri']); $ChapterPage->setContent($strContent); $ChapterPage->setData($arrFilter[$intKey]);