Update danbooru tag category scraper

pull/17/head
neobooru 2024-01-09 23:15:22 +01:00
parent 6cd6bb1745
commit 5253297809
2 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "neo-scraper", "name": "neo-scraper",
"version": "0.7.4", "version": "0.7.5",
"description": "Scrape a booru-like post object from the DOM.", "description": "Scrape a booru-like post object from the DOM.",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -76,19 +76,22 @@ export default class Danbooru extends ScrapeEngineBase {
} }
let category: TagCategory | undefined; let category: TagCategory | undefined;
switch (tagElement.className) { console.dir(tagElement.classList);
case "tag-type-3": for (const className of tagElement.classList) {
category = "copyright"; switch (className) {
break; case "tag-type-3":
case "tag-type-4": category = "copyright";
category = "character"; break;
break; case "tag-type-4":
case "tag-type-1": category = "character";
category = "artist"; break;
break; case "tag-type-1":
case "tag-type-5": category = "artist";
category = "meta"; break;
break; case "tag-type-5":
category = "meta";
break;
}
} }
if (tagName) { if (tagName) {