Closed sanchezik closed 2 years ago
I am experiencing the same issue.
Meanwhile I noticed this Instagram's logic:
I've tried to make a wrapper for FriendshipsFeedsRequest, where there is an additional path param _searchsurface, but it didn't help. So the last difference betwen requests, which can cause an exception, is that encrypted _maxid param. Maybe it will help somehow somebody in solving the issue...
I found the solution:
while making the first request don't use FriendshipsFeedsRequest constructor with 3 params, use that one without _maxid field instead. Example:
FeedUsersResponse response = new FriendshipsFeedsRequest(9999999999L, FriendshipsFeedsRequest.FriendshipsFeeds.FOLLOWERS).execute(client).join();
after getting first "page" of followers, you can find correct _next_maxid field in the response (FeedUsersResponse.java). Just remember this value and iterate next requests using it. Example:
FeedUsersResponse response = new FriendshipsFeedsRequest(9999999999L, FriendshipsFeedsRequest.FriendshipsFeeds.FOLLOWERS, "MYLONGSTRINGFROMNEXTMAXIDPARAM").execute(client).join();
when all followers are downloaded, _Next_maxid param will be Null. So you can use this condition for defining the last request.
I faced with a problem in getting Followers (btw getting Followings is OK).
Here is my code:
FeedUsersResponse response = new FriendshipsFeedsRequest(9999999999L, FriendshipsFeedsRequest.FriendshipsFeeds.FOLLOWERS, "0") .execute(client).join();
It always throws this Exception:
StackTrace looks like that:
The same code works fine when I'm getting my own followings, using FriendshipsFeedsRequest.FriendshipsFeeds.FOLLOWING enumeration.
Also I've found that in library's tests in file friendships/FriendshipsTest.java -> method testFollowers() -> there are double testing of Followings. I suppose there should be Followers+Followings. Maybe the reason of that is the same as mine: it's just not worked properly for Followers :(