From 624c28befa811b2c205f8ed31158f082758a2d2e Mon Sep 17 00:00:00 2001 From: Wiiplay123 Date: Sat, 29 Apr 2017 21:07:49 -0500 Subject: [PATCH] Fixed deviantArt download link resolving Turns out getURL works perfectly fine, but the Location header doesn't. --- .../com/rarchives/ripme/ripper/rippers/DeviantartRipper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/DeviantartRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/DeviantartRipper.java index 24816992..5bb0fae3 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/DeviantartRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/DeviantartRipper.java @@ -363,7 +363,7 @@ public class DeviantartRipper extends AbstractHTMLRipper { if (els.size() > 0) { // Full-size image String downloadLink = els.get(0).attr("href"); - logger.info("Found download page: " + downloadLink); + logger.info("Found download button link: " + downloadLink); HttpURLConnection con = (HttpURLConnection) new URL(downloadLink).openConnection(); con.setRequestProperty("Referer",this.url.toString()); String cookieString = ""; @@ -376,10 +376,11 @@ public class DeviantartRipper extends AbstractHTMLRipper { con.setInstanceFollowRedirects(true); con.connect(); int code = con.getResponseCode(); - String location = con.getHeaderField("Location"); + String location = con.getURL().toString(); con.disconnect(); if (location.contains("//orig")) { fsimage = location; + logger.info("Found image download: " + location); } } if (fsimage != null) {