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,7 +76,9 @@ export default class Danbooru extends ScrapeEngineBase {
} }
let category: TagCategory | undefined; let category: TagCategory | undefined;
switch (tagElement.className) { console.dir(tagElement.classList);
for (const className of tagElement.classList) {
switch (className) {
case "tag-type-3": case "tag-type-3":
category = "copyright"; category = "copyright";
break; break;
@ -90,6 +92,7 @@ export default class Danbooru extends ScrapeEngineBase {
category = "meta"; category = "meta";
break; break;
} }
}
if (tagName) { if (tagName) {
const tag = new ScrapedTag(tagName, category); const tag = new ScrapedTag(tagName, category);