From 78346bf1c438fd04f10c762838f92dd4b7bedd2d Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Tue, 28 Mar 2017 22:20:58 -0400 Subject: [PATCH] added themonsterunderthebed.net --- .../ripper/rippers/WordpressComicRipper.java | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 df8e9321..44aad7a4 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/WordpressComicRipper.java @@ -22,7 +22,7 @@ public class WordpressComicRipper extends AbstractHTMLRipper { super(url); } - public static List explicit_domains = Arrays.asList("www.totempole666.com", "buttsmithy.com"); + public static List explicit_domains = Arrays.asList("www.totempole666.com", "buttsmithy.com", "themonsterunderthebed.net"); @Override public String getHost() { String host = url.toExternalForm().split("/")[2]; @@ -51,6 +51,12 @@ public class WordpressComicRipper extends AbstractHTMLRipper { return true; } + Pattern theMonsterUnderTheBedPat = Pattern.compile("https?://themonsterunderthebed.net/\\?comic=([a-zA-Z0-9_-]*)/?$"); + Matcher theMonsterUnderTheBedMat = theMonsterUnderTheBedPat.matcher(url.toExternalForm()); + if (theMonsterUnderTheBedMat.matches()) { + return true; + } + } return false; } @@ -68,6 +74,13 @@ public class WordpressComicRipper extends AbstractHTMLRipper { if (buttsmithyMat.matches()) { return "totempole666.com" + "_" + "Alfie"; } + + Pattern theMonsterUnderTheBedPat = Pattern.compile("https?://themonsterunderthebed.net/?comic=([a-zA-Z0-9_-])/?$"); + Matcher theMonsterUnderTheBedMat = theMonsterUnderTheBedPat.matcher(url.toExternalForm()); + if (theMonsterUnderTheBedMat.matches()) { + return "themonsterunderthebed.net_TheMonsterUnderTheBed"; + } + return super.getAlbumTitle(url); } @@ -93,7 +106,9 @@ public class WordpressComicRipper extends AbstractHTMLRipper { // Find next page String nextPage = ""; Element elem = null; - if (explicit_domains.contains("www.totempole666.com") == true || explicit_domains.contains("buttsmithy.com") == true) { + if (explicit_domains.contains("www.totempole666.com") == true + || explicit_domains.contains("buttsmithy.com") == true + || explicit_domains.contains("themonsterunderthebed.net")) { elem = doc.select("a.comic-nav-next").first(); if (elem == null) { throw new IOException("No more pages"); @@ -111,7 +126,9 @@ public class WordpressComicRipper extends AbstractHTMLRipper { @Override public List getURLsFromPage(Document doc) { List result = new ArrayList(); - if (explicit_domains.contains("www.totempole666.com") == true || explicit_domains.contains("buttsmithy.com") == true) { + if (explicit_domains.contains("www.totempole666.com") == true + || explicit_domains.contains("buttsmithy.com") == true + || explicit_domains.contains("themonsterunderthebed.net")) { Element elem = doc.select("div.comic-table > div#comic > a > img").first(); // If doc is the last page in the comic then elem.attr("src") returns null // because there is no link to the next page