From 4232f8342447e77bfcd5a97f731f9c322da8c5d0 Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Mon, 26 May 2025 15:07:41 +0800 Subject: [PATCH] =?UTF-8?q?cookie=E5=AD=98=E5=88=B0redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/weibo.php | 2 ++ model/mSpider.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/control/weibo.php b/control/weibo.php index b93a462..bec104f 100644 --- a/control/weibo.php +++ b/control/weibo.php @@ -113,6 +113,8 @@ class weibo extends publicBase { public function ajax_update_cookie() { $cookie = trim($this->get('cookie')); + if(empty($cookie)) $this->ajax_json(false, '参数错误'); + $type = $this->get('type') + 0; $obj = new mWeiboBehavior(); $robj = $obj->initRedis(); diff --git a/model/mSpider.php b/model/mSpider.php index 47b6c3b..6e8057a 100644 --- a/model/mSpider.php +++ b/model/mSpider.php @@ -267,7 +267,8 @@ class mSpider extends mBase { $this->proxy_ip = $ipdata['ip']; $this->proxy_port = $ipdata['port']; - $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);; + $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE); + if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE; $url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&hasori=1"; $headers = array( "Cookie: SUB={$cookie}", @@ -378,7 +379,8 @@ class mSpider extends mBase { $this->proxy_ip = $ipdata['ip']; $this->proxy_port = $ipdata['port']; - $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);; + $cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE); + if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE; $endtime = strtotime("tomorrow"); $url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&endtime={$endtime}&hasret=1&hastext=1&haspic=1&hasvideo=1&hasmusic=1"; $headers = array(