From e20b047f1321bce65fe100da71c624dc17f554d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8B=97?= <794329728@qq.com> Date: Mon, 23 Aug 2021 15:37:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[fix]=E8=8E=B7=E5=8F=96=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E5=B8=96=E5=A4=B1=E8=B4=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/Dynamic.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugin/Dynamic.php b/src/plugin/Dynamic.php index 6fa868b..7cd5b6f 100644 --- a/src/plugin/Dynamic.php +++ b/src/plugin/Dynamic.php @@ -49,6 +49,10 @@ class Dynamic $url = 'https://api.vc.bilibili.com/topic_svr/v1/topic_svr/topic_new?topic_id=' . $t_id; $data = Curl::request('get', $url); $data = json_decode($data, true); + if (!isset($data['data'])) { + Log::warning("获取抽奖贴失败: {$data['message']}"); + continue; + } // new foreach ($data['data']['cards'] as $article) { From 22712d1826e480405475399ce9f864d85f43840c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8B=97?= <794329728@qq.com> Date: Mon, 23 Aug 2021 15:42:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[fix]=E8=8E=B7=E5=8F=96=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E5=B8=96=E5=A4=B1=E8=B4=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/Dynamic.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugin/Dynamic.php b/src/plugin/Dynamic.php index 7cd5b6f..c61c38b 100644 --- a/src/plugin/Dynamic.php +++ b/src/plugin/Dynamic.php @@ -48,12 +48,10 @@ class Dynamic Log::info("获取关键字 $t_name - $t_id"); $url = 'https://api.vc.bilibili.com/topic_svr/v1/topic_svr/topic_new?topic_id=' . $t_id; $data = Curl::request('get', $url); - $data = json_decode($data, true); - if (!isset($data['data'])) { - Log::warning("获取抽奖贴失败: {$data['message']}"); - continue; - } + // 失败跳过 + if (is_null($data)) continue; + $data = json_decode($data, true); // new foreach ($data['data']['cards'] as $article) { $article_id = $article['desc']['dynamic_id']; From 8aae9d99537829446497bbb28e487b8b73306c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8B=97?= <794329728@qq.com> Date: Tue, 16 Nov 2021 15:44:27 +0800 Subject: [PATCH 3/3] fix return --- src/plugin/LiveReservation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugin/LiveReservation.php b/src/plugin/LiveReservation.php index 45961fc..e5da383 100644 --- a/src/plugin/LiveReservation.php +++ b/src/plugin/LiveReservation.php @@ -130,5 +130,6 @@ class LiveReservation 'text' => $data['lottery_prize_info']['text'], // "预约有奖:小电视年糕抱枕、哔哩哔哩小电视樱花毛绒抱枕大号、哔哩哔哩小夜灯" ]; } + return false; } } \ No newline at end of file