Skip to content

Commit

Permalink
fix: unstable rn of get_threads #83
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Jan 16, 2023
1 parent a1e5f72 commit 6a70a5b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aiotieba/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ async def get_threads(
Args:
fname_or_fid (str | int): 贴吧名或fid 优先贴吧名
pn (int, optional): 页码. Defaults to 1.
rn (int, optional): 请求的条目数. Defaults to 30.
rn (int, optional): 请求的条目数. Defaults to 30. Max to 100.
sort (int, optional): 排序方式 对于有热门分区的贴吧 0是热门排序 1是按发布时间 2报错 34都是热门排序 >=5是按回复时间
对于无热门分区的贴吧 0是按回复时间 1是按发布时间 2报错 >=3是按回复时间. Defaults to 5.
is_good (bool, optional): True则获取精品区帖子 False则获取普通区帖子. Defaults to False.
Expand Down
3 changes: 2 additions & 1 deletion aiotieba/client/get_threads/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def pack_proto(core: TiebaCore, fname: str, pn: int, rn: int, sort: int, is_good
req_proto.data.common._client_version = core.main_version
req_proto.data.fname = fname
req_proto.data.pn = pn
req_proto.data.rn = rn if rn > 0 else 1
req_proto.data.rn = 105
req_proto.data.rn_need = rn if rn > 0 else 1
req_proto.data.is_good = is_good
req_proto.data.sort = sort

Expand Down
1 change: 1 addition & 0 deletions aiotieba/client/get_threads/protobuf/FrsPageReqIdl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ message FrsPageReqIdl {
CommonReq common = 39;
string fname = 1;
int32 rn = 2;
int32 rn_need = 3;
int32 is_good = 4;
int32 cid = 5;
int32 pn = 15;
Expand Down
8 changes: 4 additions & 4 deletions aiotieba/client/get_threads/protobuf/FrsPageReqIdl_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a70a5b

Please sign in to comment.