From 0c4ec95ca4943bb0c067ca33a944a9623913d822 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 19 Jul 2018 00:21:39 -0400 Subject: [PATCH] Fixed xhamster getNextPage --- .../rarchives/ripme/ripper/rippers/XhamsterRipper.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java index 96f20ec3..86bb81b3 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/XhamsterRipper.java @@ -69,11 +69,13 @@ public class XhamsterRipper extends AbstractHTMLRipper { @Override public Document getNextPage(Document doc) throws IOException { - if (!doc.select("a.next").first().attr("href").equals("")) { - return Http.url(doc.select("a.next").first().attr("href")).get(); - } else { - throw new IOException("No more pages"); + if (doc.select("a.next").first() != null) { + if (doc.select("a.next").first().attr("href").startsWith("http")) { + return Http.url(doc.select("a.next").first().attr("href")).get(); + } } + throw new IOException("No more pages"); + } @Override