Forced https for tumblr image links

This commit is contained in:
cyian-1756 2017-12-16 00:13:35 -05:00
parent 57a53688e4
commit dbe39a89b8

View File

@ -192,7 +192,7 @@ 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 {
fileURL = new URL(photo.getJSONObject("original_size").getString("url")); 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);
@ -206,7 +206,7 @@ public class TumblrRipper extends AlbumRipper {
} }
} else if (post.has("video_url")) { } else if (post.has("video_url")) {
try { try {
fileURL = new URL(post.getString("video_url")); fileURL = new URL(post.getString("video_url").replaceAll("http", "https"));
addURLToDownload(fileURL); addURLToDownload(fileURL);
} catch (Exception e) { } catch (Exception e) {
logger.error("[!] Error while parsing video in " + post, e); logger.error("[!] Error while parsing video in " + post, e);