Imagefap ripper now downloads full sized images

This commit is contained in:
cyian-1756 2018-07-01 22:45:35 -04:00
parent 33a692be24
commit 55c782dbab

View File

@ -125,11 +125,7 @@ public class ImagefapRipper extends AbstractHTMLRipper {
if (!thumb.hasAttr("src") || !thumb.hasAttr("width")) {
continue;
}
String image = thumb.attr("src");
image = image.replaceAll(
"http://x.*.fap.to/images/thumb/",
"http://fap.to/images/full/");
image = image.replaceAll("w[0-9]+-h[0-9]+/", "");
String image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href"));
imageURLs.add(image);
if (isThisATest()) {
break;
@ -160,4 +156,13 @@ public class ImagefapRipper extends AbstractHTMLRipper {
return super.getAlbumTitle(url);
}
private String getFullSizedImage(String pageURL) {
try {
Document doc = Http.url(pageURL).get();
return doc.select("img#mainPhoto").attr("src");
} catch (IOException e) {
return null;
}
}
}