pythorhead icon indicating copy to clipboard operation
pythorhead copied to clipboard

Getting more than 50 posts from a community

Open aconite33 opened this issue 2 years ago • 5 comments

Is there a way to retrieve more than 50 posts from a community? I'm playing around with a bot and trying to grab posts in a community. I can 50 and under, but I cannot grab more than 50 posts.

I get the error:

couldnt_get_posts

I am using the post.list in order to try and grab posts:

lemmy.post.list(1234,None,51,None,None.SortType.New,None)

I don't think this is a server side issue as my rate limits are the defaults and fairly large? Is it something in the library I am not setting?

aconite33 avatar Jul 24 '23 00:07 aconite33

I think there's limits to avoid overloading the DB. Try using the pagination

db0 avatar Jul 24 '23 08:07 db0

How would I continuously process posts? I assume I would need to break it down into chunks but when I call Lemmy.post.list I keep getting the same posts.

Darin755 avatar Apr 21 '24 22:04 Darin755

What do you mean by "continuously process" exactly? Retrieve all the new posts as they come?

db0 avatar Apr 22 '24 07:04 db0

I want the equivalent of hitting next on lemmy.

Although 50 might not be to bad

Darin755 avatar Apr 25 '24 14:04 Darin755

Just request page number 2 on the payload to the method?

db0 avatar Apr 25 '24 15:04 db0