Merge pull request #760 from cyian-1756/imageFapFix

Imagefap ripper now downloads full sized images
This commit is contained in:
cyian-1756 2018-07-03 02:25:39 -04:00 committed by GitHub
commit 7eeb6b8378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,11 +125,7 @@ public class ImagefapRipper extends AbstractHTMLRipper {
if (!thumb.hasAttr("src") || !thumb.hasAttr("width")) { if (!thumb.hasAttr("src") || !thumb.hasAttr("width")) {
continue; continue;
} }
String image = thumb.attr("src"); String image = getFullSizedImage("https://www.imagefap.com" + thumb.parent().attr("href"));
image = image.replaceAll(
"http://x.*.fap.to/images/thumb/",
"http://fap.to/images/full/");
image = image.replaceAll("w[0-9]+-h[0-9]+/", "");
imageURLs.add(image); imageURLs.add(image);
if (isThisATest()) { if (isThisATest()) {
break; break;
@ -160,4 +156,13 @@ public class ImagefapRipper extends AbstractHTMLRipper {
return super.getAlbumTitle(url); 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;
}
}
} }