db0 / pythorhead

A python library for interacting with Lemmy
GNU Affero General Public License v3.0
78 stars 26 forks source link

Getting more than 50 posts from a community #64

Open aconite33 opened 1 year ago

aconite33 commented 1 year ago

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?

db0 commented 1 year ago

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

Darin755 commented 7 months ago

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.

db0 commented 7 months ago

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

Darin755 commented 7 months ago

I want the equivalent of hitting next on lemmy.

Although 50 might not be to bad

db0 commented 7 months ago

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