Fixed ImagearnRipper (#45)

This commit is contained in:
cyian-1756 2017-08-12 06:40:04 -04:00 committed by metaprime
parent 1214d19187
commit 3180372a9f

View File

@ -78,10 +78,15 @@ public class ImagearnRipper extends AbstractHTMLRipper {
@Override @Override
public List<String> getURLsFromPage(Document doc) { public List<String> getURLsFromPage(Document doc) {
List<String> imageURLs = new ArrayList<String>(); List<String> imageURLs = new ArrayList<String>();
for (Element thumb : doc.select("img.border")) { for (Element thumb : doc.select("div#gallery > div > a")) {
String image = thumb.attr("src"); String imageURL = thumb.attr("href");
image = image.replaceAll("thumbs[0-9]*\\.imagearn\\.com/", "img.imagearn.com/imags/"); try {
imageURLs.add(image); 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; return imageURLs;
} }