From ef66706a603fb9f507dcb585abb7e0fed90406c8 Mon Sep 17 00:00:00 2001 From: longchao <1432334894@qq.com> Date: Wed, 16 Jul 2025 10:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/define.php | 2 +- queue/deal/spider_weibo_comment.php | 5 ++--- tools/set_weibo_login_cookie.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/define.php b/config/define.php index d2d421a..ed6f55b 100644 --- a/config/define.php +++ b/config/define.php @@ -91,7 +91,7 @@ define('SPIDER_COMMENT_STATUS_SUCCESS', 2); define('_RS_SPIDER_WEIBO_COMMENT', 'rs_spider_weibo_comment'); - define('_RC_WEIBO_LOGIN_COOKIE2', 'rc_weibo_login_cookie2'); + define('_RC_WEIBO_COMMENT_LOGIN_COOKIE2', 'rc_weibo_comment_login_cookie2'); define('WEIBO_LOGIN_COOKIE2', '_2A25FdJmRDeRhGeFG71sY9CbOyDuIHXVmC5NZrDV8PUNbmtAYLUj1kW9NeUknrDj_DFv7tUuAQqx1kWSg_y3B4Qe3'); diff --git a/queue/deal/spider_weibo_comment.php b/queue/deal/spider_weibo_comment.php index 400b07d..8ff1414 100644 --- a/queue/deal/spider_weibo_comment.php +++ b/queue/deal/spider_weibo_comment.php @@ -13,11 +13,10 @@ class spiderWeiboComment extends dealBase { } public function deal() { - exit; $obj = new mSpider(); $rdobj = $obj->initRedis(); - $cookie_json = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE2); + $cookie_json = $rdobj->get(_RC_WEIBO_COMMENT_LOGIN_COOKIE2); $baselog = PROC_CODE . "|"; if(empty($cookie_json)) { if($rdobj->llen(_RQ_SPIDER_WEIBO_COMMENT) + 0 > 0) $obj->writeLog(ZHISHIKU_SPIDER_LOG, ZHISHIKU_SPIDER_COMMENT, 'cookie为空:'.$baselog); @@ -76,7 +75,7 @@ class spiderWeiboComment extends dealBase { $obj->writeLog(ZHISHIKU_SPIDER_LOG, ZHISHIKU_SPIDER_COMMENT, '队列评论抓取失败,重试中:'.$error.'|'.$baselog.'|redis:'.$rds); unset($cookie_data[PROC_CODE]); - $rdobj->set(_RC_WEIBO_LOGIN_COOKIE2, json_encode($cookie_data)); + $rdobj->set(_RC_WEIBO_COMMENT_LOGIN_COOKIE2, json_encode($cookie_data)); if ($obj->is_change_ip && PROC_CODE == 0) $rdobj->del(_RC_SPIDER_WEIBO_COMMENT_USE_IP); $obj->sendMail(array('1432334894@qq.com'), date('Y年m月d日', time()) . '-微博评论数据抓取', $error); diff --git a/tools/set_weibo_login_cookie.php b/tools/set_weibo_login_cookie.php index 8e863c6..0ca3645 100644 --- a/tools/set_weibo_login_cookie.php +++ b/tools/set_weibo_login_cookie.php @@ -14,5 +14,5 @@ $cookies[] = '_2AkMfKU18f8NxqwFRmvoVzmPrZI11wwvEieKpdbynJRMxHRl-yT9xqmoitRB6NKlj $cookies[] = '_2A25FcbInDeRhGeFK4lEU9ijJwzSIHXVmD0vvrDV8PUNbmtAYLVLTkW9NQtaHPZxefLemxY2kP3YN6l7tyfSJeWvl'; // 张宇鹏 $cookies[] = '_2A25FcZ5ZDeRhGe5O6lAW9yvMyjiIHXVmDp-RrDV8PUNbmtAYLWvWkW9NdZ6KR3xnx51xA9uK5FmqkYlyilpy9NQI'; // 吴龙超2 -$rdobj->set(_RC_WEIBO_LOGIN_COOKIE2, json_encode($cookies)); +$rdobj->set(_RC_WEIBO_COMMENT_LOGIN_COOKIE2, json_encode($cookies)); exit; \ No newline at end of file