From 77a703a5f0b21c0946b6efaed9bacb8c9a4d8b14 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 9 Aug 2022 16:29:04 +0200 Subject: [PATCH] remove autotagger --- src/inc/lib.mjs | 1 + src/inc/trigger/parser.mjs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/inc/lib.mjs b/src/inc/lib.mjs index ab701d7..4200d7b 100644 --- a/src/inc/lib.mjs +++ b/src/inc/lib.mjs @@ -162,6 +162,7 @@ export default new class { return tags; }; async detectNSFW(dest) { + return false; const { stdout, stderr } = await exec( `python -c "import sys\nfrom nsfw_detector import predict\nmodel = predict.load_model('./nsfw_model.h5')\nprint(predict.classify(model, './public/b/${dest}'))"` ); diff --git a/src/inc/trigger/parser.mjs b/src/inc/trigger/parser.mjs index 4d15d82..5a164a1 100644 --- a/src/inc/trigger/parser.mjs +++ b/src/inc/trigger/parser.mjs @@ -191,7 +191,7 @@ export default async bot => { speed = !Number.isFinite(speed) ? "yes" : `${speed.toFixed(2)} Mbit/s`; // autotagger - let tags = []; + /*let tags = []; let score = 0; try { if(mime.startsWith('image')) { @@ -240,10 +240,13 @@ export default async bot => { } } catch(err) { console.error(err); - } + }*/ - e.reply([ + /*e.reply([ `[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}` + (tags.length > 0 ? ` | tags: ${tags.join(', ')} (score: ${score.toFixed(2)})` : '') + ]);*/ + e.reply([ + `[f0cked] link: ${cfg.main.url.full}/${itemid} | size: ${lib.formatSize(size)} | speed: ${speed}` ]); });