mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +01:00
Prevent a potential parsing error using the gfycat API.
This commit is contained in:
parent
f17350cc1d
commit
54ef23c357
@ -104,7 +104,12 @@ public class FetchGfycatOrRedgifsVideoLinks {
|
|||||||
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
|
.getJSONObject(JSONUtils.CONTENT_URLS_KEY)
|
||||||
.getJSONObject(JSONUtils.WEBM_KEY)
|
.getJSONObject(JSONUtils.WEBM_KEY)
|
||||||
.getString(JSONUtils.URL_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) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
parseFailed = true;
|
parseFailed = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user