Added canRip for rule34.xxx

This commit is contained in:
cyian-1756 2018-04-27 13:38:16 -04:00
parent 8f84d3f8ff
commit 1ccaa21ef8

View File

@ -33,6 +33,16 @@ public class Rule34Ripper extends AbstractHTMLRipper {
return "rule34.xxx"; 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 @Override
public String getGID(URL url) throws MalformedURLException { public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("https?://rule34.xxx/index.php\\?page=post&s=list&tags=([\\S]+)"); 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); return m.group(1);
} }
throw new MalformedURLException("Expected rule34.xxx URL format: " + 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 { public URL getAPIUrl() throws MalformedURLException {