Added quickQueue support to nhentairipper

This commit is contained in:
cyian-1756 2018-05-22 15:51:55 -04:00
parent 3d30df196f
commit ffdb5fc27d

View File

@ -26,6 +26,30 @@ public class NhentaiRipper extends AbstractHTMLRipper {
// Thread pool for finding direct image links from "image" pages (html)
private DownloadThreadPool nhentaiThreadPool = new DownloadThreadPool("nhentai");
@Override
public boolean hasQueueSupport() {
return true;
}
@Override
public boolean pageContainsAlbums(URL url) {
Pattern pa = Pattern.compile("^https?://nhentai\\.net/tag/([a-zA-Z0-9_\\-]+)/?");
Matcher ma = pa.matcher(url.toExternalForm());
if (ma.matches()) {
return true;
}
return false;
}
@Override
public List<String> getAlbumsToQueue(Document doc) {
List<String> urlsToAddToQueue = new ArrayList<>();
for (Element elem : doc.select("a.cover")) {
urlsToAddToQueue.add("https://" + getDomain() + elem.attr("href"));
}
return urlsToAddToQueue;
}
@Override
public DownloadThreadPool getThreadPool() {
return nhentaiThreadPool;