From c0e6dd9b125abb0c84db6fd14f5353cdbdc7eed7 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] =?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'];