Skip to content

Commit 4588ad9

Browse files
committed
fix: get_threads failed #222
1 parent 55ecafb commit 4588ad9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

aiotieba/api/get_threads/_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import yarl
22

3-
from ...const import APP_BASE_HOST
3+
from ...const import APP_BASE_HOST, MAIN_VERSION
44
from ...core import HttpCore, WsCore
55
from ...exception import TiebaServerError
66
from ._classdef import Threads
@@ -12,11 +12,11 @@
1212
def pack_proto(fname: str, pn: int, rn: int, sort: int, is_good: bool) -> bytes:
1313
req_proto = FrsPageReqIdl_pb2.FrsPageReqIdl()
1414
req_proto.data.common._client_type = 2
15-
req_proto.data.common._client_version = "12.64.1.1"
15+
req_proto.data.common._client_version = MAIN_VERSION
1616
req_proto.data.kw = fname
17-
req_proto.data.pn = pn
18-
req_proto.data.rn = 13
19-
req_proto.data.rn_need = rn if rn > 0 else 1
17+
req_proto.data.pn = 0 if pn == 1 else pn
18+
req_proto.data.rn = rn
19+
req_proto.data.rn_need = rn + 5
2020
req_proto.data.is_good = is_good
2121
req_proto.data.sort_type = sort
2222

aiotieba/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ async def get_threads(
417417
/,
418418
pn: int = 1,
419419
*,
420-
rn: int = 13,
420+
rn: int = 30,
421421
sort: ThreadSortType = ThreadSortType.REPLY,
422422
is_good: bool = False,
423423
) -> get_threads.Threads:
@@ -427,7 +427,7 @@ async def get_threads(
427427
Args:
428428
fname_or_fid (str | int): 贴吧名或fid 优先贴吧名
429429
pn (int, optional): 页码. Defaults to 1.
430-
rn (int, optional): 请求的条目数. Defaults to 13. Max to 13.
430+
rn (int, optional): 请求的条目数. Defaults to 30. Max to 100.
431431
sort (ThreadSortType, optional): HOT热门排序 REPLY按回复时间 CREATE按发布时间 FOLLOW关注的人. Defaults to ThreadSortType.REPLY.
432432
is_good (bool, optional): True则获取精品区帖子 False则获取普通区帖子. Defaults to False.
433433

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "aiotieba"
3-
version = "4.6.0a1"
3+
version = "4.6.0a2"
44
description = "Asynchronous I/O Client for Baidu Tieba"
55
authors = [{ name = "lumina37", email = "[email protected]" }]
66
urls = { Repository = "https://github.com/lumina37/aiotieba/", Documentation = "https://aiotieba.cc/" }

0 commit comments

Comments
 (0)