From ecca3c123cd88151fc39706e86063a05a36ca08e Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Tue, 28 Mar 2017 22:49:42 -0400 Subject: [PATCH] added support for prismblush.com --- .../ripper/rippers/WordpressComicRipper.java | 21 ++++++++++++++++--- 1 file changed, 18 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 f61cc1b3..15ed3671 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,8 @@ public class WordpressComicRipper extends AbstractHTMLRipper { super(url); } - public static List explicit_domains = Arrays.asList("www.totempole666.com", "buttsmithy.com", "themonsterunderthebed.net"); + public static List explicit_domains = Arrays.asList("www.totempole666.com", + "buttsmithy.com", "themonsterunderthebed.net", "prismblush.com"); @Override public String getHost() { String host = url.toExternalForm().split("/")[2]; @@ -57,6 +58,12 @@ public class WordpressComicRipper extends AbstractHTMLRipper { return true; } + Pattern prismblushPat = Pattern.compile("https?://prismblush.com/comic/([a-zA-Z0-9_-]*)/?$"); + Matcher prismblushMat = prismblushPat.matcher(url.toExternalForm()); + if (prismblushMat.matches()) { + return true; + } + } return false; } @@ -81,6 +88,12 @@ public class WordpressComicRipper extends AbstractHTMLRipper { return "themonsterunderthebed.net_TheMonsterUnderTheBed"; } + Pattern prismblushPat = Pattern.compile("https?://prismblush.com/comic/([a-zA-Z0-9_-]*)/?$"); + Matcher prismblushMat = prismblushPat.matcher(url.toExternalForm()); + if (prismblushMat.matches()) { + return "prismblush.com_" + prismblushMat.group(1).replaceAll("-pg-\\d+", ""); + } + return super.getAlbumTitle(url); } @@ -108,7 +121,8 @@ public class WordpressComicRipper extends AbstractHTMLRipper { Element elem = null; if (explicit_domains.contains("www.totempole666.com") == true || explicit_domains.contains("buttsmithy.com") == true - || explicit_domains.contains("themonsterunderthebed.net")) { + || explicit_domains.contains("themonsterunderthebed.net") + || explicit_domains.contains("prismblush.com")) { elem = doc.select("a.comic-nav-next").first(); if (elem == null) { throw new IOException("No more pages"); @@ -128,7 +142,8 @@ public class WordpressComicRipper extends AbstractHTMLRipper { List result = new ArrayList(); if (explicit_domains.contains("www.totempole666.com") == true || explicit_domains.contains("buttsmithy.com") == true - || explicit_domains.contains("themonsterunderthebed.net")) { + || explicit_domains.contains("themonsterunderthebed.net") + || explicit_domains.contains("prismblush.com")) { 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