From 1ccaa21ef89ea60f6e255674b57c17f6d8fa45eb Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Fri, 27 Apr 2018 13:38:16 -0400 Subject: [PATCH] Added canRip for rule34.xxx --- .../rarchives/ripme/ripper/rippers/Rule34Ripper.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/Rule34Ripper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/Rule34Ripper.java index 8651bd69..b7e0f7b0 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/Rule34Ripper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/Rule34Ripper.java @@ -33,6 +33,16 @@ public class Rule34Ripper extends AbstractHTMLRipper { return "rule34.xxx"; } + @Override + public boolean canRip(URL url){ + Pattern p = Pattern.compile("https?://rule34.xxx/index.php\\?page=post&s=list&tags=([\\S]+)"); + Matcher m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return true; + } + return false; + } + @Override public String getGID(URL url) throws MalformedURLException { Pattern p = Pattern.compile("https?://rule34.xxx/index.php\\?page=post&s=list&tags=([\\S]+)"); @@ -41,7 +51,7 @@ public class Rule34Ripper extends AbstractHTMLRipper { return m.group(1); } throw new MalformedURLException("Expected rule34.xxx URL format: " + - "rule34.xxx/index.php\\?page=post&s=list&tags=TAG - got " + url + " instead"); + "rule34.xxx/index.php?page=post&s=list&tags=TAG - got " + url + " instead"); } public URL getAPIUrl() throws MalformedURLException {