From d8254b6e03c84551e6de206bcb3ef52bac601505 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 13 Apr 2018 18:52:38 -0400 Subject: [PATCH] Fixed url encoding error with Blackbrickroadofoz --- .../ripme/ripper/rippers/Blackbrickroadofoz.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/Blackbrickroadofoz.java b/src/main/java/com/rarchives/ripme/ripper/rippers/Blackbrickroadofoz.java index c290170f..2c9b14eb 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/Blackbrickroadofoz.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/Blackbrickroadofoz.java @@ -22,12 +22,12 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper { @Override public String getHost() { - return "cfake"; + return "blackbrickroadofoz"; } @Override public String getDomain() { - return "cfake.com"; + return "blackbrickroadofoz.com"; } @Override @@ -49,7 +49,8 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper { @Override public Document getNextPage(Document doc) throws IOException { - Element elem = doc.select("nav.cc-nav > a.cc-next").first(); + sleep(1000); + Element elem = doc.select("div[id=topnav] > nav.cc-nav > a.cc-next").first(); if (elem == null) { throw new IOException("No more pages"); } @@ -67,8 +68,9 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper { @Override public List getURLsFromPage(Document doc) { List result = new ArrayList<>(); - Element elem = doc.select("img[id=cc-comic]").first(); - result.add(elem.attr("src")); + Element elem = doc.select("div[id=cc-comicbody] > a > img[id=cc-comic]").first(); + // The site doesn't return properly encoded urls we replace all spaces ( ) with %20 + result.add(elem.attr("src").replaceAll(" ", "%20")); return result; }