From d4e2f646abeba5a5777432cb22652472e4741174 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 26 Oct 2021 06:38:43 +0200 Subject: Added tag blacklist since the query limit was reached --- src/api/e926/index.ts | 6 ++++++ src/config.ts | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/api/e926/index.ts b/src/api/e926/index.ts index 8e363c9..301ad3f 100644 --- a/src/api/e926/index.ts +++ b/src/api/e926/index.ts @@ -7,6 +7,7 @@ export const dedupeDb = new PostDatabase("e926dedupe.json", 100); export interface GetPostQuery { tags: readonly string[]; + tagsBlacklist: readonly string[]; maxPage: number; } @@ -71,6 +72,11 @@ export async function getRandomPost(query: GetPostQuery): Promise { const postIndex = Math.floor(Math.random() * response.posts.length); const post = response.posts[postIndex]; + if (post.tags.general.some(tag => query.tagsBlacklist.includes(tag))) { + await delay(1000); + return getRandomPost(query); + } + if (config.e621.blacklist.includes(post.id)) { await delay(1000); return getRandomPost(query); diff --git a/src/config.ts b/src/config.ts index 0a623e0..8eef85b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -31,10 +31,8 @@ const mainQuery: GetPostQuery = { "-mouth_shot", "-animated", "-transformation", - "-macro", - "-micro", - "-world_war_1", - "-world_war_2", + "-m*cro", + "-world_war_*", "-adolf_hitler_(artist)", "-blackkaries", "-photography_(artwork)", @@ -43,6 +41,10 @@ const mainQuery: GetPostQuery = { "score:>=20", "inpool:false", ], + tagsBlacklist: [ + "plushification", + "foot_focus" + ], maxPage: 118, }; -- cgit v1.2.3-54-g00ecf