Browse Source
fix feed oops
renovate/org.robolectric-robolectric-4.x
Austin Huang
4 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
2 changed files with
7 additions and
4 deletions
-
app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java
-
app/src/main/java/awais/instagrabber/webservices/FeedService.java
|
|
@ -671,6 +671,7 @@ public final class ResponseBodyUtils { |
|
|
|
} |
|
|
|
final JSONObject feedItem = itemJson.getJSONObject("node"); |
|
|
|
final String mediaType = feedItem.optString("__typename"); |
|
|
|
if ("GraphSuggestedUserFeedUnit".equals(mediaType)) return null; |
|
|
|
|
|
|
|
final boolean isVideo = feedItem.optBoolean("is_video"); |
|
|
|
final long videoViews = feedItem.optLong("video_view_count", 0); |
|
|
|
|
|
@ -84,10 +84,10 @@ public class FeedService extends BaseService { |
|
|
|
return; |
|
|
|
} |
|
|
|
final Map<String, String> queryMap = new HashMap<>(); |
|
|
|
queryMap.put("query_hash", "6b838488258d7a4820e48d209ef79eb1"); |
|
|
|
queryMap.put("query_hash", "c699b185975935ae2a457f24075de8c7"); |
|
|
|
queryMap.put("variables", "{" + |
|
|
|
"\"fetch_media_item_count\":" + maxItemsToLoad + "," + |
|
|
|
"\"has_threaded_comments\":true," + |
|
|
|
"\"fetch_like\":3,\"has_stories\":false,\"has_stories\":false,\"has_threaded_comments\":true," + |
|
|
|
"\"fetch_media_item_cursor\":\"" + (cursor == null ? "" : cursor) + "\"" + |
|
|
|
"}"); |
|
|
|
final Call<String> request = repository.fetch(queryMap); |
|
|
@ -154,8 +154,10 @@ public class FeedService extends BaseService { |
|
|
|
if (itemJson == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
final FeedModel feedModel = ResponseBodyUtils.parseItem(itemJson); |
|
|
|
feedModels.add(feedModel); |
|
|
|
final FeedModel feedModel = ResponseBodyUtils.parseGraphQLItem(itemJson); |
|
|
|
if (feedModel != null) { |
|
|
|
feedModels.add(feedModel); |
|
|
|
} |
|
|
|
} |
|
|
|
return new PostsFetchResponse(feedModels, hasNextPage, endCursor); |
|
|
|
} |
|
|
|