Added support for hentai-comic.com

This commit is contained in:
cyian-1756 2018-08-05 20:04:39 -04:00
parent 489694a9d3
commit 49b8471f41

View File

@ -23,17 +23,27 @@ public class HentaiimageRipper extends AbstractHTMLRipper {
@Override @Override
public String getHost() { public String getHost() {
return "hentai-image"; return url.toExternalForm().split("/")[2];
} }
@Override @Override
public String getDomain() { public String getDomain() {
return "hentai-image.com"; return url.toExternalForm().split("/")[2];
}
@Override
public boolean canRip(URL url) {
try {
getGID(url);
return true;
} catch (MalformedURLException e) {
return false;
}
} }
@Override @Override
public String getGID(URL url) throws MalformedURLException { public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("https://(?:\\w\\w\\.)?hentai-image.com/image/([a-zA-Z0-9_-]+)/?"); Pattern p = Pattern.compile("https://(?:\\w\\w\\.)?hentai-(image|comic).com/image/([a-zA-Z0-9_-]+)/?");
Matcher m = p.matcher(url.toExternalForm()); Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) { if (m.matches()) {
return m.group(1); return m.group(1);