Fix null error, Now rips all file types
This commit is contained in:
parent
6d352fcdc5
commit
b8b706de90
@ -67,7 +67,7 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getNextPage(Document doc) throws IOException {
|
public Document getNextPage(Document doc) throws IOException {
|
||||||
if (doc.select("li.next.hidden").size() > 0) {
|
if (doc.select("li.next.hidden").size() != 0) {
|
||||||
// Last page
|
// Last page
|
||||||
throw new IOException("No more pages");
|
throw new IOException("No more pages");
|
||||||
}
|
}
|
||||||
@ -94,14 +94,33 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
logger.info("Couldn't find user & image ID in " + thumb.attr("href"));
|
logger.info("Couldn't find user & image ID in " + thumb.attr("href"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String[] titleSplit = thumb.attr("href").split("/");
|
Document imagePage;
|
||||||
String title = titleSplit[titleSplit.length -1];
|
try {
|
||||||
String user = imgMatcher.group(1),
|
Response resp = Http.url("http://www.hentai-foundry.com/").response();
|
||||||
imageId = imgMatcher.group(2);
|
cookies = resp.cookies();
|
||||||
String image = "http://pictures.hentai-foundry.com//";
|
resp = Http.url("http://www.hentai-foundry.com/?enterAgree=1&size=1500")
|
||||||
image += user.toLowerCase().charAt(0);
|
.referrer("http://www.hentai-foundry.com/")
|
||||||
image += "/" + user + "/" + imageId + "/" + user + "-" + imageId + title + ".png";
|
.cookies(cookies)
|
||||||
imageURLs.add(image);
|
.response();
|
||||||
|
cookies.putAll(resp.cookies());
|
||||||
|
|
||||||
|
logger.info("grabbing " + "http://www.hentai-foundry.com" + thumb.attr("href"));
|
||||||
|
imagePage = Http.url("http://www.hentai-foundry.com" + thumb.attr("href")).cookies(cookies).get();
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (IOException e) {
|
||||||
|
logger.debug(e.getMessage());
|
||||||
|
logger.debug("Warning: imagePage is null!");
|
||||||
|
imagePage = null;
|
||||||
|
}
|
||||||
|
// String[] titleSplit = thumb.attr("href").split("/");
|
||||||
|
// String title = titleSplit[titleSplit.length -1];
|
||||||
|
// String user = imgMatcher.group(1),
|
||||||
|
// imageId = imgMatcher.group(2);
|
||||||
|
// String image = "http://pictures.hentai-foundry.com//";
|
||||||
|
// image += user.toLowerCase().charAt(0);
|
||||||
|
// image += "/" + user + "/" + imageId + "/" + user + "-" + imageId + title + ".png";
|
||||||
|
imageURLs.add("http:" + imagePage.select("div.boxbody > center > img").attr("src"));
|
||||||
}
|
}
|
||||||
return imageURLs;
|
return imageURLs;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user