From 201c3fb086db1b676ff0f388a948fd3263ba505a Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 21 Dec 2017 03:40:32 -0500 Subject: [PATCH] Tumblr ripper can now rip raw images --- .../com/rarchives/ripme/ripper/rippers/TumblrRipper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/TumblrRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/TumblrRipper.java index 018cd9e4..26242af9 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/TumblrRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/TumblrRipper.java @@ -207,7 +207,14 @@ public class TumblrRipper extends AlbumRipper { for (int j = 0; j < photos.length(); j++) { photo = photos.getJSONObject(j); try { - fileURL = new URL(photo.getJSONObject("original_size").getString("url").replaceAll("http", "https")); + if (Utils.getConfigBoolean("tumblr.get_raw_image", false)) { + String urlString = photo.getJSONObject("original_size").getString("url").replaceAll("http", "https"); + urlString = urlString.replaceAll("https://[a-sA-z0-9_-]*\\.tumblr", "https://data.tumblr"); + urlString = urlString.replaceAll("_\\d+\\.", "_raw."); + fileURL = new URL(urlString); + } else { + fileURL = new URL(photo.getJSONObject("original_size").getString("url").replaceAll("http", "https")); + } m = p.matcher(fileURL.toString()); if (m.matches()) { addURLToDownload(fileURL);