aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorDocile-Alligator <chineseperson5@gmail.com>2021-01-22 16:13:07 +0000
committerGitHub <noreply@github.com>2021-01-22 16:13:07 +0000
commita7ab7e514eca77c4bc36df8a22b9c491f299d71c (patch)
treea5b4cb69a1c92b4a1c36c3f5b122391e32b68509 /app/src/main
parent0243a48ad712b8d025023a48dc0ac32e411db176 (diff)
parent3c77a34e0a0f5f36f2b3c65ba50aa3867ef23b61 (diff)
downloadinfinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar.gz
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar.bz2
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar.lz
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar.xz
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.tar.zst
infinity-for-reddit-a7ab7e514eca77c4bc36df8a22b9c491f299d71c.zip
Merge pull request #253 from anonymous-developer-12/master
Fix redgif schema change
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java5
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java3
2 files changed, 7 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 32769529..d6c0a470 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java
@@ -100,7 +100,10 @@ public class FetchGfycatOrRedgifsVideoLinks {
protected Void doInBackground(Void... voids) {
try {
JSONObject jsonObject = new JSONObject(response);
- webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.WEBM_URL_KEY);
+ webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY)
+ .getJSONObject(JSONUtils.GFY_CONTENT_KEY)
+ .getJSONObject(JSONUtils.WEBM_KEY)
+ .getString(JSONUtils.GFY_URL_KEY);
mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY);
} catch (JSONException e) {
e.printStackTrace();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java
index 7832d74c..fe3d064c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/JSONUtils.java
@@ -130,4 +130,7 @@ public class JSONUtils {
public static final String TOTAL_KARMA_KEY = "total_karma";
public static final String AWARDER_KARMA_KEY = "awarder_karma";
public static final String AWARDEE_KARMA_KEY = "awardee_karma";
+ public static final String GFY_CONTENT_KEY = "content_urls";
+ public static final String GFY_URL_KEY = "url";
+ public static final String WEBM_KEY = "webm";
}