Fix a JSON key naming issue.

This commit is contained in:
Alex Ning 2021-01-23 00:27:47 +08:00
parent a7ab7e514e
commit f17350cc1d
2 changed files with 3 additions and 5 deletions

View File

@ -101,9 +101,9 @@ public class FetchGfycatOrRedgifsVideoLinks {
try {
JSONObject jsonObject = new JSONObject(response);
webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY)
.getJSONObject(JSONUtils.GFY_CONTENT_KEY)
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
.getJSONObject(JSONUtils.WEBM_KEY)
.getString(JSONUtils.GFY_URL_KEY);
.getString(JSONUtils.URL_KEY);
mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY);
} catch (JSONException e) {
e.printStackTrace();

View File

@ -109,7 +109,6 @@ public class JSONUtils {
public static final String RESIZED_ICONS_KEY = "resized_icons";
public static final String GFY_ITEM_KEY = "gfyItem";
public static final String MP4_URL_KEY = "mp4Url";
public static final String WEBM_URL_KEY = "webmUrl";
public static final String TYPE_KEY = "type";
public static final String MP4_KEY = "mp4";
public static final String THINGS_KEY = "things";
@ -130,7 +129,6 @@ 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 CONTENT_URLS_KEY = "content_urls";;
public static final String WEBM_KEY = "webm";
}