获取帖子所有评论的JSON树?

时间:2015-07-24 00:23:01

标签: python json reddit

我正在寻找将subreddit备份到磁盘。到目前为止,Reddit API的工作方式似乎并不容易。获取包含所有注释(和嵌套注释)的单个JSON树的最佳选择似乎是将它们存储在数据库中并执行非常荒谬的递归查询以生成JSON。

是否有Reddit API方法会在预期的顺序中为我提供一个包含所有评论的树?

1 个答案:

答案 0 :(得分:0)

The number of comments you get from the API has a hard limit, for performance reasons; to ensure you're getting all comments, you have to parse through the child nodes and make additional calls as necessary.

Be aware that the subreddit listing will only include the latest 1000 posts, so if your target subreddit has more than that, you probably won't be able to obtain a full backup anyways.