support get more articles
This commit is contained in:
parent
ce10e4fbf2
commit
69dc818c73
Binary file not shown.
|
|
@ -123,6 +123,18 @@ class TruthSocialRetriever:
|
||||||
else:
|
else:
|
||||||
posts = data.get("posts", [])
|
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 = []
|
results = []
|
||||||
if posts:
|
if posts:
|
||||||
logger.info(f"获取{user_name}帖子: {len(posts)}条")
|
logger.info(f"获取{user_name}帖子: {len(posts)}条")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue