From 02a1a4a5f5d40bf91699eb2476c3da7357956072 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Wed, 13 Jan 2021 22:21:20 +0900 Subject: [PATCH] Fix live stories --- .../java/awais/instagrabber/utils/ResponseBodyUtils.java | 4 ++-- .../awais/instagrabber/webservices/StoriesService.java | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java index 63f6fd63..0fd2753f 100644 --- a/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java +++ b/app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java @@ -1150,8 +1150,8 @@ public final class ResponseBodyUtils { data.getString("cover_frame_url"), MediaItemType.MEDIA_TYPE_LIVE, data.optLong("published_time", 0), - data.getJSONObject("user").getString("username"), - data.getJSONObject("user").getLong("pk"), + data.getJSONObject("broadcast_owner").getString("username"), + data.getJSONObject("broadcast_owner").getLong("pk"), false); model.setVideoUrl(data.getString("dash_playback_url")); return model; diff --git a/app/src/main/java/awais/instagrabber/webservices/StoriesService.java b/app/src/main/java/awais/instagrabber/webservices/StoriesService.java index 7ed4e75b..00c863c1 100644 --- a/app/src/main/java/awais/instagrabber/webservices/StoriesService.java +++ b/app/src/main/java/awais/instagrabber/webservices/StoriesService.java @@ -205,11 +205,10 @@ public class StoriesService extends BaseService { ); final String id = node.getString("id"); final long timestamp = node.getLong("published_time"); - final JSONObject itemJson = node.has("items") ? node.getJSONArray("items").getJSONObject(0) : null; - StoryModel firstStoryModel = null; - if (itemJson != null) { - firstStoryModel = ResponseBodyUtils.parseBroadcastItem(itemJson); - } + // final JSONObject itemJson = node.has("items") ? node.getJSONArray("items").getJSONObject(0) : null; + final StoryModel firstStoryModel = ResponseBodyUtils.parseBroadcastItem(node); + // if (itemJson != null) { + // } feedStoryModels.add(new FeedStoryModel(id, user, false, timestamp, firstStoryModel, 1, true, false)); } callback.onSuccess(sort(feedStoryModels));