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

Merge pull request #1888 from charan2628/Reddit-Gifs

Added extra condition to include reddit gallery gifs urls
This commit is contained in:
cyian-1756
2021-06-09 19:33:30 +00:00
committed by GitHub

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