bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 955 forks source link

GetListMembers returning only 100 users #661

Closed matinas closed 2 years ago

matinas commented 4 years ago

The GetListMembers call is returning only 100 members (default value for the GetListMembersPaged), because for some reason, that last call always returns the same value for next_cursorand previous_cursor, so the comparison next_cursor == previous_cursor is being always true, thus making the loop to break and return only the first page.

Don't know if it's due to a Twitter API change or something, but according to the latest docs in the Twitter API the only way to check whether we have reached the bottom of the list is by comparing next_cursor to 0:

"You will know that you have requested the last available page of results when the API responds with a next_cursor = 0"

My actual call is: auth.api.GetListMembers(None,slug,user,None,False,False)

matinas commented 4 years ago

Just in case it helps, for now I solved the issue by replacing:

if next_cursor == 0 or next_cursor == previous_cursor:

with:

if next_cursor == 0:

palewire commented 1 year ago

I am getting this bug again in version 3.5