1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-16 02:44:10 +02:00

Added extra condition to include reddit gallery gifs urls

This commit is contained in:
schar
2021-05-24 22:39:19 +05:30
parent 3c4e303358
commit 8b3b60c105

View File

@@ -318,7 +318,12 @@ public class RedditRipper extends AlbumRipper {
prefix += String.format("%02d-", i + 1);
}
try {
URL mediaURL = new URL(media.getJSONObject("s").getString("u").replaceAll("&", "&"));
URL mediaURL;
if (!media.getJSONObject("s").isNull("gif")) {
mediaURL = new URL(media.getJSONObject("s").getString("gif").replaceAll("&", "&"));
} else {
mediaURL = new URL(media.getJSONObject("s").getString("u").replaceAll("&", "&"));
}
addURLToDownload(mediaURL, prefix, subdirectory);
} catch (MalformedURLException | JSONException e) {
LOGGER.error("[!] Unable to parse gallery JSON:\ngallery_data:\n" + data +"\nmedia_metadata:\n" + metadata);