Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

修复报错 优化描述 #38

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 = []
Expand All @@ -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"}]

Expand Down
Binary file added code_lite.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
],
"push": {
# 合并发送消息, 只合并未单独配置 push 的账号
# 只作用于在multi并未配置 push 的组
"type": "pushplus",
"key": "xxx",
},
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
本项目修改自https://github.com/arcturus-script/bilibili code_lite.zip为精简版的代码压缩包 只保留最基本的功能 去除push

## BiliBili(云函数版)

### 实现功能
Expand Down