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; }