Skip to content

Commit

Permalink
Merge pull request #775 from mokurin000/sub-comments-page_size
Browse files Browse the repository at this point in the history
feat: allow to edit page_size of sub_comments
  • Loading branch information
z0z0r4 authored Jun 25, 2024
2 parents a2af11b + cf42208 commit 499ed6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bilibili_api/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,13 @@ async def delete(self) -> dict:
del data["action"]
return await Api(**api, credential=self.credential).update_data(**data).result

async def get_sub_comments(self, page_index: int = 1) -> dict:
async def get_sub_comments(self, page_index: int = 1, page_size: int = 10) -> dict:
"""
获取子评论。即评论下的评论。
Args:
page_index (int, optional): 页码索引,从 1 开始。Defaults to 1.
page_size (int, optional): 每页评论数。设置大于20的数值不会起作用。Defaults to 10.
Returns:
dict: 调用 API 返回的结果
Expand All @@ -254,7 +255,7 @@ async def get_sub_comments(self, page_index: int = 1) -> dict:
api = API["comment"]["sub_reply"]
params = {
"pn": page_index,
"ps": 10,
"ps": page_size,
"type": self.__type.value,
"oid": self.__oid,
"root": self.__rpid,
Expand Down

0 comments on commit 499ed6e

Please sign in to comment.