diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md index 5387b9a4..2b749769 100644 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -1,7 +1,7 @@ --- name: 文档勘误 about: 使用该模板汇报文档错误 -title: "[文档] 这里填写标题" +title: "[文档] 这里填写标题" labels: 'documentation' assignees: '' diff --git a/.github/ISSUE_TEMPLATE/features.md b/.github/ISSUE_TEMPLATE/features.md index 63b7163d..d9d9e5f3 100644 --- a/.github/ISSUE_TEMPLATE/features.md +++ b/.github/ISSUE_TEMPLATE/features.md @@ -1,7 +1,7 @@ --- name: 提交需求/新功能 about: 使用该模板进行提交需求/新功能 -title: "[新功能] {这里填写标题}" +title: "[新功能] 这里填写标题" labels: 'features' assignees: '' diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index bbe95c71..651b722e 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,7 +1,7 @@ --- name: 提出疑问 about: 使用该模板进行提问 -title: "[提问] {这里填写标题}" +title: "[提问] 这里填写标题" labels: 'question' assignees: '' diff --git a/.github/ISSUE_TEMPLATE/suggestion.md b/.github/ISSUE_TEMPLATE/suggestion.md index 09ac939d..a1e6d8ae 100644 --- a/.github/ISSUE_TEMPLATE/suggestion.md +++ b/.github/ISSUE_TEMPLATE/suggestion.md @@ -1,7 +1,7 @@ --- name: 建言献策 about: 使用该模板提建议 -title: "[建议] {这里填写标题}" +title: "[建议] 这里填写标题" labels: '建议' assignees: 'enhancement' diff --git a/.github/ISSUE_TEMPLATE/troubleshooting.md b/.github/ISSUE_TEMPLATE/troubleshooting.md index ea226b87..1727faae 100644 --- a/.github/ISSUE_TEMPLATE/troubleshooting.md +++ b/.github/ISSUE_TEMPLATE/troubleshooting.md @@ -1,7 +1,7 @@ --- name: 漏洞反馈 about: 使用该模板进行漏洞反馈 -title: "[漏洞] {这里填写标题}" +title: "[漏洞] 这里填写标题" labels: 'bug' assignees: '' diff --git a/bilibili_api/comment.py b/bilibili_api/comment.py index 8fb6be22..5c76bc0c 100644 --- a/bilibili_api/comment.py +++ b/bilibili_api/comment.py @@ -433,9 +433,7 @@ async def get_comments( async def get_comments_lazy( oid: int, type_: CommentResourceType, - # pagination_str: str = "", - pn: int = 1, - ps: int = 20, + offset: str = '', order: OrderType = OrderType.TIME, credential: Union[Credential, None] = None, ) -> dict: @@ -449,11 +447,7 @@ async def get_comments_lazy( type_ (CommentsResourceType) : 资源类枚举。 - pagination_str (str, optional) : 分页依据 Defaults to `{"offset":""}`. 弃用 #658 - - pn (int, optional) : 页码. Defaults to 1. - - ps (int, optional) : 每页数量. Defaults to 20. + offset (str, optional) : 偏移量。每次请求可获取下次请求对应的偏移量,类似单向链表。 order (OrderType, optional) : 排序方式枚举. Defaults to OrderType.TIME. @@ -462,12 +456,14 @@ async def get_comments_lazy( Returns: dict: 调用 API 返回的结果 """ + offset = offset.replace('"', '\\"') + offset = '{"offset":"' + offset + '"}' api = API["comment"]["reply_by_session_id"] params = { "oid": oid, "type": type_.value, "mode": order.value, - "next": pn - 1, - "ps": ps, + "pagination_str": offset, + "web_location": "1315875", } return await Api(**api, credential=credential).update_params(**params).result diff --git a/docs/modules/comment.md b/docs/modules/comment.md index d8a5df4b..b06c3363 100644 --- a/docs/modules/comment.md +++ b/docs/modules/comment.md @@ -262,9 +262,7 @@ from bilibili_api import comment | - | - | - | | oid | int | 资源 ID。 | | type_ | CommentsResourceType | 资源类枚举。 | -| pagination_str | Union[str, None] | 分页依据 Defaults to `{"offset" | -| pn | Union[int, None] | 页码. Defaults to 1. | -| ps | Union[int, None] | 每页数量. Defaults to 20. | +| offset | Union[str, None] | 偏移量。每次请求可获取下次请求对应的偏移量,类似单向链表。 | | order | Union[OrderType, None] | 排序方式枚举. Defaults to OrderType.TIME. | | credential | Union[Credential, None] | 凭据。Defaults to None. |