Skip to content

Commit 362ccef

Browse files
committed
feat: v17.1.4
1 parent bc83741 commit 362ccef

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

CHANGELOGS/v17.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v17.1.4 2025/03/16
2+
3+
- feat: opus.Opus.get_images, opus.Opus.get_images_raw_info
4+
- feat: module activity
5+
- fix: favorite_list related in #898
6+
- feat: centered paragraph of opus
7+
18
# v17.1.3 2025/03/01
29

310
- **[BREAKING CHANGE]: curl_cffi 不再默认模仿 `chrome131`,如需模仿浏览器需要手动设置(`request_settings.set("impersonate", "xxx")`**

bilibili_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
)
113113

114114

115-
BILIBILI_API_VERSION = "17.1.3"
115+
BILIBILI_API_VERSION = "17.1.4"
116116

117117

118118
def __register_all_clients():

docs/examples/activity.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
11
# 示例:抓取活动页面评论
22

3+
```python
4+
from bilibili_api import comment, activity, sync, Credential
5+
6+
7+
async def main() -> int:
8+
url = "https://www.bilibili.com/blackboard/topic/index_10years_web.html"
9+
aid = await activity.get_activity_aid(url)
10+
11+
comments = []
12+
page = 1
13+
count = 0
14+
while True:
15+
c = await comment.get_comments(
16+
aid,
17+
comment.CommentResourceType.ACTIVITY,
18+
page,
19+
credential=Credential(sessdata="xxx"),
20+
)
21+
22+
replies = c["replies"]
23+
if replies is None:
24+
break
25+
comments.extend(replies)
26+
count += c["page"]["size"]
27+
page += 1
28+
if count >= c["page"]["count"] or count >= 10:
29+
break
30+
31+
for cmt in comments:
32+
print(f"{cmt['member']['uname']}: {cmt['content']['message']}")
33+
print(f"\n\n共有 {count} 条评论(不含子评论)")
34+
35+
36+
sync(main())
37+
```

0 commit comments

Comments
 (0)