1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-09-01 18:03:55 +02:00

Merge 'pr-1888' reddit gallery gifs urls

This commit is contained in:
soloturn
2021-06-04 13:11:49 +02:00

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