From 530eb55e2a8e0eccdb7ba3725e252d679b46d5ca Mon Sep 17 00:00:00 2001 From: huajiqaq <85773533+huajiqaq@users.noreply.github.com> Date: Fri, 3 May 2024 10:44:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bilibili.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bilibili.py b/bilibili.py index 3ac2e24..fe6593e 100644 --- a/bilibili.py +++ b/bilibili.py @@ -39,13 +39,14 @@ # 获取当日投币情况 COIN_LOG = " https://api.bilibili.com/x/member/web/coin/log" - -class BiliBili: - headers = { +headers = { "user-agent": "Mozilla/5.0", "Content-Type": "application/x-www-form-urlencoded", "Referer": "https://www.bilibili.com/", - } +} + +class BiliBili: + headers = headers.copy() def __init__(self, **config) -> None: self.cookie = config.get("cookie") @@ -204,7 +205,7 @@ def video_suggest(ps: int = 50, pn: int = 1) -> list or None: ] """ - rep = req.get(RECOMMAND, params={"ps": ps, "pn": pn}).json() + rep = req.get(RECOMMAND, params={"ps": ps, "pn": pn},headers=headers).json() if rep["code"] == 0: res = [] @@ -223,7 +224,7 @@ def video_suggest(ps: int = 50, pn: int = 1) -> list or None: return res else: - failed(f"获取视频推荐列表失败") + failed(f"获取视频推荐列表失败, 原因: {rep['message']}") return [{"bvid": "BV1LS4y1C7Pa"}] From ba4c39c1890aac4a03742f62cd00565a9eaee3be Mon Sep 17 00:00:00 2001 From: huajiqaq <85773533+huajiqaq@users.noreply.github.com> Date: Fri, 3 May 2024 10:45:25 +0800 Subject: [PATCH 2/2] Update config.py --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 5d0123d..91d0e35 100644 --- a/config.py +++ b/config.py @@ -44,7 +44,7 @@ }, ], "push": { - # 合并发送消息, 只合并未单独配置 push 的账号 + # 只作用于在multi并未配置 push 的组 "type": "pushplus", "key": "xxx", },