Merge pull request #253 from anonymous-developer-12/master

Fix redgif schema change
This commit is contained in:
Docile-Alligator 2021-01-23 00:13:07 +08:00 committed by GitHub
commit a7ab7e514e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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();

View File

@ -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";
}