diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/CheveretoRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/CheveretoRipper.java index fe1ff1b9..b422f0a5 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/CheveretoRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/CheveretoRipper.java @@ -65,6 +65,27 @@ public class CheveretoRipper extends AbstractHTMLRipper { return Http.url(url).get(); } + @Override + public Document getNextPage(Document doc) throws IOException { + // Find next page + String nextUrl = ""; + // We use comic-nav-next to the find the next page + Element elem = doc.select("li.pagination-next > a").first(); + if (elem == null) { + throw new IOException("No more pages"); + } + String nextPage = elem.attr("href"); + // Some times this returns a empty string + // This for stops that + if (nextPage == "") { + logger.info("Got empty string for nextpage") + return null; + } + else { + return Http.url(nextPage).get(); + } + } + @Override public List getURLsFromPage(Document doc) { List result = new ArrayList();