Merge pull request #897 from cyian-1756/remove_tumblr_raw

Removed option to download raw images from tumblr
This commit is contained in:
cyian-1756 2018-09-10 05:28:27 -04:00 committed by GitHub
commit 81bc542853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,18 +235,9 @@ public class TumblrRipper extends AlbumRipper {
for (int j = 0; j < photos.length(); j++) { for (int j = 0; j < photos.length(); j++) {
photo = photos.getJSONObject(j); photo = photos.getJSONObject(j);
try { try {
String imageUrl = photo.getJSONObject("original_size").getString("url");
// If the url is shorter than 65 chars long we skip it because it's those images don't support grabbing them in fullsize // If the url is shorter than 65 chars long we skip it because it's those images don't support grabbing them in fullsize
if (Utils.getConfigBoolean("tumblr.get_raw_image", false) && fileURL = new URL(photo.getJSONObject("original_size").getString("url").replaceAll("http:", "https:"));
imageUrl.replaceAll("https", "http").length() > 65) {
// We have to change the link to http because tumblr uses an invalid cert for data.tumblr.com
String urlString = imageUrl.replaceAll("https", "http");
urlString = urlString.replaceAll("https?://[a-sA-Z0-9_\\-\\.]*\\.tumblr", "http://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()); m = p.matcher(fileURL.toString());
if (m.matches()) { if (m.matches()) {
addURLToDownload(fileURL); addURLToDownload(fileURL);