Merge pull request #818 from cyian-1756/xhamsterFixes

Fixed xhamster getNextPage
This commit is contained in:
cyian-1756 2018-07-21 16:37:44 -04:00 committed by GitHub
commit 23c8fa5911
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,11 +69,13 @@ public class XhamsterRipper extends AbstractHTMLRipper {
@Override @Override
public Document getNextPage(Document doc) throws IOException { public Document getNextPage(Document doc) throws IOException {
if (!doc.select("a.next").first().attr("href").equals("")) { if (doc.select("a.next").first() != null) {
return Http.url(doc.select("a.next").first().attr("href")).get(); if (doc.select("a.next").first().attr("href").startsWith("http")) {
} else { return Http.url(doc.select("a.next").first().attr("href")).get();
throw new IOException("No more pages"); }
} }
throw new IOException("No more pages");
} }
@Override @Override