diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java index 143c396a3..f532b6bc2 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java @@ -45,7 +45,9 @@ public WordpressComicRipper(URL url) throws IOException { "shipinbottle.pepsaga.com", "8muses.download", "spyingwithlana.com", - "comixfap.net" + "comixfap.net", + "manytoon.me", + "manhwahentai.me" ); private static List theme1 = Arrays.asList( @@ -58,6 +60,11 @@ public WordpressComicRipper(URL url) throws IOException { "spyingwithlana.com" ); + private static List webtoonTheme = Arrays.asList( + "manhwahentai.me", + "manytoon.me" + ); + @Override public String getHost() { return url.toExternalForm().split("/")[2]; @@ -176,6 +183,18 @@ public boolean canRip(URL url) { if (mat.matches()) { return true; } + + pat = Pattern.compile("https?://manytoon.me/manhwa/([a-zA-Z0-9_-]+)/chapter-\\d+/?$"); + mat = pat.matcher(url.toExternalForm()); + if (mat.matches()) { + return true; + } + + pat = Pattern.compile("https://manhwahentai.me/webtoon/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-])+/?"); + mat = pat.matcher(url.toExternalForm()); + if (mat.matches()) { + return true; + } } @@ -299,6 +318,19 @@ public String getAlbumTitle(URL url) throws MalformedURLException { return "comixfap_" + mat.group(1); } + pat = Pattern.compile("https?://manytoon.me/manhwa/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-])+/?"); + mat = pat.matcher(url.toExternalForm()); + if (mat.matches()) { + return "manytoon.me_" + mat.group(1) + "_" + mat.group(2); + } + + pat = Pattern.compile("https://manhwahentai.me/webtoon/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-])+/?"); + mat = pat.matcher(url.toExternalForm()); + if (mat.matches()) { + return "manhwahentai.me_" + mat.group(1) + "_" + mat.group(2); + } + + return super.getAlbumTitle(url); } @@ -371,6 +403,11 @@ public List getURLsFromPage(Document doc) { } result.add(elem.attr("src")); + } else if (webtoonTheme.contains(getHost())) { + for (Element el : doc.select("img.wp-manga-chapter-img")) { + LOGGER.info(el.toString()); + result.add(getWebtoonImageUrl(el)); + } } // freeadultcomix gets it own if because it needs to add http://freeadultcomix.com to the start of each link @@ -406,6 +443,14 @@ public List getURLsFromPage(Document doc) { return result; } + private String getWebtoonImageUrl(Element el) { + if (el.attr("src").contains("http")) { + return el.attr("src"); + } else { + return el.attr("data-src"); + } + } + @Override public void downloadURL(URL url, int index) { // Download the url with the page title as the prefix