support get more articles
This commit is contained in:
parent
ce10e4fbf2
commit
69dc818c73
Binary file not shown.
|
|
@ -122,6 +122,18 @@ class TruthSocialRetriever:
|
|||
posts = data.get("posts", [])[:limit]
|
||||
else:
|
||||
posts = data.get("posts", [])
|
||||
|
||||
if len(posts) == 1:
|
||||
try:
|
||||
max_id = posts[0].get("id")
|
||||
params["next_max_id"] = max_id
|
||||
response = requests.get(base_url, headers=headers, params=params)
|
||||
response.raise_for_status() # 检查 HTTP 错误
|
||||
data = response.json()
|
||||
posts.extend(data.get("posts", []))
|
||||
except Exception as e:
|
||||
logger.error(f"获取下一页帖子失败: {e}")
|
||||
pass
|
||||
|
||||
results = []
|
||||
if posts:
|
||||
|
|
|
|||
Loading…
Reference in New Issue