diff --git a/aiotieba/api/get_threads/_api.py b/aiotieba/api/get_threads/_api.py index 6f359abf..0bc9599e 100644 --- a/aiotieba/api/get_threads/_api.py +++ b/aiotieba/api/get_threads/_api.py @@ -1,6 +1,6 @@ import yarl -from ...const import APP_BASE_HOST +from ...const import APP_BASE_HOST, MAIN_VERSION from ...core import HttpCore, WsCore from ...exception import TiebaServerError from ._classdef import Threads @@ -12,11 +12,11 @@ def pack_proto(fname: str, pn: int, rn: int, sort: int, is_good: bool) -> bytes: req_proto = FrsPageReqIdl_pb2.FrsPageReqIdl() req_proto.data.common._client_type = 2 - req_proto.data.common._client_version = "12.64.1.1" + req_proto.data.common._client_version = MAIN_VERSION req_proto.data.kw = fname - req_proto.data.pn = pn - req_proto.data.rn = 13 - req_proto.data.rn_need = rn if rn > 0 else 1 + req_proto.data.pn = 0 if pn == 1 else pn + req_proto.data.rn = rn + req_proto.data.rn_need = rn + 5 req_proto.data.is_good = is_good req_proto.data.sort_type = sort diff --git a/aiotieba/client.py b/aiotieba/client.py index 5f0cc40f..e9091a81 100644 --- a/aiotieba/client.py +++ b/aiotieba/client.py @@ -417,7 +417,7 @@ async def get_threads( /, pn: int = 1, *, - rn: int = 13, + rn: int = 30, sort: ThreadSortType = ThreadSortType.REPLY, is_good: bool = False, ) -> get_threads.Threads: @@ -427,7 +427,7 @@ async def get_threads( Args: fname_or_fid (str | int): 贴吧名或fid 优先贴吧名 pn (int, optional): 页码. Defaults to 1. - rn (int, optional): 请求的条目数. Defaults to 13. Max to 13. + rn (int, optional): 请求的条目数. Defaults to 30. Max to 100. sort (ThreadSortType, optional): HOT热门排序 REPLY按回复时间 CREATE按发布时间 FOLLOW关注的人. Defaults to ThreadSortType.REPLY. is_good (bool, optional): True则获取精品区帖子 False则获取普通区帖子. Defaults to False. diff --git a/pyproject.toml b/pyproject.toml index 0c93cffa..7c316cd5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aiotieba" -version = "4.6.0a1" +version = "4.6.0a2" description = "Asynchronous I/O Client for Baidu Tieba" authors = [{ name = "lumina37", email = "starry.qvq@gmail.com" }] urls = { Repository = "https://github.com/lumina37/aiotieba/", Documentation = "https://aiotieba.cc/" }