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"}] diff --git a/code_lite.zip b/code_lite.zip new file mode 100644 index 0000000..518a521 Binary files /dev/null and b/code_lite.zip differ 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", }, diff --git a/readme.md b/readme.md index 5f3abc5..52d0fab 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,5 @@ +该项目修改自https://github.com/arcturus-script/bilibili code_lite.zip为去除push的代码压缩包 无需安装任何包 解压设置配置即可用 + ## BiliBili(云函数版) ### 实现功能