From 3180372a9f5c7fe137c404b698ead27adbda8e9e Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Sat, 12 Aug 2017 06:40:04 -0400 Subject: [PATCH] Fixed ImagearnRipper (#45) --- .../ripme/ripper/rippers/ImagearnRipper.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java index 6f82a9c9..1175e8a0 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ImagearnRipper.java @@ -78,10 +78,15 @@ public class ImagearnRipper extends AbstractHTMLRipper { @Override public List getURLsFromPage(Document doc) { List imageURLs = new ArrayList(); - for (Element thumb : doc.select("img.border")) { - String image = thumb.attr("src"); - image = image.replaceAll("thumbs[0-9]*\\.imagearn\\.com/", "img.imagearn.com/imags/"); - imageURLs.add(image); + for (Element thumb : doc.select("div#gallery > div > a")) { + String imageURL = thumb.attr("href"); + try { + Document imagedoc = new Http("http://imagearn.com/" + imageURL).get(); + String image = imagedoc.select("a.thickbox").first().attr("href"); + imageURLs.add(image); + } catch (IOException e) { + logger.warn("Was unable to download page: " + imageURL); + } } return imageURLs; }