Merge pull request #532 from cyian-1756/hf-nextpage-fix
Hentaifoundry ripper no long throws a null error when getting the nex…
This commit is contained in:
commit
4f3cc4a535
@ -74,12 +74,16 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
Elements els = doc.select("li.next > a");
|
Elements els = doc.select("li.next > a");
|
||||||
Element first = els.first();
|
Element first = els.first();
|
||||||
|
try {
|
||||||
String nextURL = first.attr("href");
|
String nextURL = first.attr("href");
|
||||||
nextURL = "http://www.hentai-foundry.com" + nextURL;
|
nextURL = "http://www.hentai-foundry.com" + nextURL;
|
||||||
return Http.url(nextURL)
|
return Http.url(nextURL)
|
||||||
.referrer(url)
|
.referrer(url)
|
||||||
.cookies(cookies)
|
.cookies(cookies)
|
||||||
.get();
|
.get();
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
throw new IOException("No more pages");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -97,13 +101,6 @@ public class HentaifoundryRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
Document imagePage;
|
Document imagePage;
|
||||||
try {
|
try {
|
||||||
Response resp = Http.url("http://www.hentai-foundry.com/").response();
|
|
||||||
cookies = resp.cookies();
|
|
||||||
resp = Http.url("http://www.hentai-foundry.com/?enterAgree=1&size=1500")
|
|
||||||
.referrer("http://www.hentai-foundry.com/")
|
|
||||||
.cookies(cookies)
|
|
||||||
.response();
|
|
||||||
cookies.putAll(resp.cookies());
|
|
||||||
|
|
||||||
logger.info("grabbing " + "http://www.hentai-foundry.com" + thumb.attr("href"));
|
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();
|
imagePage = Http.url("http://www.hentai-foundry.com" + thumb.attr("href")).cookies(cookies).get();
|
||||||
|
Loading…
Reference in New Issue
Block a user