aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
index a2a7d129..0aeb5eeb 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
@@ -104,7 +104,12 @@ public class FetchGfycatOrRedgifsVideoLinks {
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
.getJSONObject(JSONUtils.WEBM_KEY)
.getString(JSONUtils.URL_KEY);
- mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY);
+ mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.MP4_URL_KEY) ?
+ jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY)
+ : jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY)
+ .getJSONObject(JSONUtils.CONTENT_URLS_KEY)
+ .getJSONObject(JSONUtils.MP4_KEY)
+ .getString(JSONUtils.URL_KEY);
} catch (JSONException e) {
e.printStackTrace();
parseFailed = true;