Skip to content

Commit

Permalink
fix: get_threads failed #222
Browse files Browse the repository at this point in the history
  • Loading branch information
lumina37 committed Feb 24, 2025
1 parent 55ecafb commit 4588ad9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions aiotieba/api/get_threads/_api.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions aiotieba/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]
urls = { Repository = "https://github.com/lumina37/aiotieba/", Documentation = "https://aiotieba.cc/" }
Expand Down

0 comments on commit 4588ad9

Please sign in to comment.