Add rule34hentai.net

pull/5/head
neobooru 2020-01-04 16:59:20 +01:00
parent 3770d722f3
commit 26b257824e
1 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,10 @@ export default class Shimmie2 implements ScrapeEngine {
name = "shimmie2"; name = "shimmie2";
canImport(url: Location): boolean { canImport(url: Location): boolean {
return url.host == "rule34.paheal.net"; return (
url.host == "rule34.paheal.net" ||
url.host == "rule34hentai.net"
);
} }
scrapeDocument(document: Document): ScrapeResult { scrapeDocument(document: Document): ScrapeResult {
@ -19,6 +22,11 @@ export default class Shimmie2 implements ScrapeEngine {
if (originalImageElements.length > 0) { if (originalImageElements.length > 0) {
post.imageUrl = originalImageElements[0].href; post.imageUrl = originalImageElements[0].href;
} else {
const dowloadBtnEl = document.querySelector("a[download]") as HTMLAnchorElement;
if (dowloadBtnEl) {
post.imageUrl = dowloadBtnEl.href;
}
} }
// Set safety // Set safety