From 17b4f5fc325ebe61f479fb5b27f0769037c31390 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Tue, 25 Apr 2017 07:31:04 -0400 Subject: [PATCH] Now cna rip all comics from jagodibuja.com --- .../ripper/rippers/JagodibujaRipper.java | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/JagodibujaRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/JagodibujaRipper.java index 962cb162..30443a84 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/JagodibujaRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/JagodibujaRipper.java @@ -33,12 +33,12 @@ public class JagodibujaRipper extends AbstractHTMLRipper { @Override public String getGID(URL url) throws MalformedURLException { - Pattern p = Pattern.compile("^https?://www.jagodibuja.com/webcomic-living-with-hipstergirl-and-gamergirl-english/?"); + Pattern p = Pattern.compile("^https?://www.jagodibuja.com/([a-zA-Z0-9_-]*)/?"); Matcher m = p.matcher(url.toExternalForm()); if (m.matches()) { - return "living-with-hipstergirl-and-gamergirl"; + return m.group(1); } - throw new MalformedURLException("Expected jagodibuja.com gallery formats hwww.jagodibuja.com/webcomic-living-with-hipstergirl-and-gamergirl-english/ got " + url + " instead"); + throw new MalformedURLException("Expected jagodibuja.com gallery formats hwww.jagodibuja.com/Comic name/ got " + url + " instead"); } @Override @@ -47,24 +47,6 @@ public class JagodibujaRipper extends AbstractHTMLRipper { return Http.url(url).get(); } - // @Override - // public Document getNextPage(Document doc) throws IOException { - // // Find next page - // String nextPage = ""; - // Element elem = null; - // elem = doc.select("div.entry-attachment > div.attachment > a").first(); - // if (elem == null) { - // throw new IOException("No more pages"); - // } - // nextPage = elem.attr("href"); - // if (nextPage == "") { - // throw new IOException("No more pages"); - // } - // else { - // return Http.url(nextPage).get(); - // } - // } - @Override public List getURLsFromPage(Document doc) { List result = new ArrayList(); @@ -81,7 +63,7 @@ public class JagodibujaRipper extends AbstractHTMLRipper { logger.warn("Malformed URL"); e.printStackTrace(); } - // result.add(elem.attr("href")); + result.add(elem.attr("href")); } catch(IOException e) { logger.info("Error loading " + comicPageUrl); @@ -92,8 +74,8 @@ public class JagodibujaRipper extends AbstractHTMLRipper { @Override public void downloadURL(URL url, int index) { - sleep(500); - addURLToDownload(url, getPrefix(index)); + // sleep(500); + // addURLToDownload(url, getPrefix(index)); }