added themonsterunderthebed.net

This commit is contained in:
cyian-1756 2017-03-28 22:20:58 -04:00
parent ec77beaa63
commit 78346bf1c4

View File

@ -22,7 +22,7 @@ public class WordpressComicRipper extends AbstractHTMLRipper {
super(url); super(url);
} }
public static List<String> explicit_domains = Arrays.asList("www.totempole666.com", "buttsmithy.com"); public static List<String> explicit_domains = Arrays.asList("www.totempole666.com", "buttsmithy.com", "themonsterunderthebed.net");
@Override @Override
public String getHost() { public String getHost() {
String host = url.toExternalForm().split("/")[2]; String host = url.toExternalForm().split("/")[2];
@ -51,6 +51,12 @@ public class WordpressComicRipper extends AbstractHTMLRipper {
return true; 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; return false;
} }
@ -68,6 +74,13 @@ public class WordpressComicRipper extends AbstractHTMLRipper {
if (buttsmithyMat.matches()) { if (buttsmithyMat.matches()) {
return "totempole666.com" + "_" + "Alfie"; 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); return super.getAlbumTitle(url);
} }
@ -93,7 +106,9 @@ public class WordpressComicRipper extends AbstractHTMLRipper {
// Find next page // Find next page
String nextPage = ""; String nextPage = "";
Element elem = null; 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(); elem = doc.select("a.comic-nav-next").first();
if (elem == null) { if (elem == null) {
throw new IOException("No more pages"); throw new IOException("No more pages");
@ -111,7 +126,9 @@ public class WordpressComicRipper extends AbstractHTMLRipper {
@Override @Override
public List<String> getURLsFromPage(Document doc) { public List<String> getURLsFromPage(Document doc) {
List<String> result = new ArrayList<String>(); List<String> result = new ArrayList<String>();
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(); 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 // If doc is the last page in the comic then elem.attr("src") returns null
// because there is no link <a> to the next page // because there is no link <a> to the next page