Fixed url encoding error with Blackbrickroadofoz

This commit is contained in:
cyian-1756 2018-04-13 18:52:38 -04:00
parent 1bd9885fba
commit d8254b6e03

View File

@ -22,12 +22,12 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper {
@Override @Override
public String getHost() { public String getHost() {
return "cfake"; return "blackbrickroadofoz";
} }
@Override @Override
public String getDomain() { public String getDomain() {
return "cfake.com"; return "blackbrickroadofoz.com";
} }
@Override @Override
@ -49,7 +49,8 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper {
@Override @Override
public Document getNextPage(Document doc) throws IOException { 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) { if (elem == null) {
throw new IOException("No more pages"); throw new IOException("No more pages");
} }
@ -67,8 +68,9 @@ public class Blackbrickroadofoz extends AbstractHTMLRipper {
@Override @Override
public List<String> getURLsFromPage(Document doc) { public List<String> getURLsFromPage(Document doc) {
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
Element elem = doc.select("img[id=cc-comic]").first(); Element elem = doc.select("div[id=cc-comicbody] > a > img[id=cc-comic]").first();
result.add(elem.attr("src")); // The site doesn't return properly encoded urls we replace all spaces ( ) with %20
result.add(elem.attr("src").replaceAll(" ", "%20"));
return result; return result;
} }