From 6d1e4689b1a01db98610b4d44c69bb1e2c141695 Mon Sep 17 00:00:00 2001 From: filesite Date: Fri, 4 Jul 2025 23:41:15 +0800 Subject: [PATCH] limit snapshot image type for bot WebCrawler --- bot/WebCrawler.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/WebCrawler.mjs b/bot/WebCrawler.mjs index b4fb142..79caef6 100644 --- a/bot/WebCrawler.mjs +++ b/bot/WebCrawler.mjs @@ -82,7 +82,7 @@ class WebCrawler extends HeroBot { imgType = common.getImageType(imgSrc); //console.log('Completed: %s, naturalWidth: %s, width: %s', await imgEl.complete, await imgEl.naturalWidth, await imgEl.width); - if (imgType && await imgEl.complete && await imgEl.naturalWidth >= minNaturalWidth) { + if (imgType && (imgType == 'jpeg' || imgType == 'png') && await imgEl.complete && await imgEl.naturalWidth >= minNaturalWidth) { data.cover = await imgEl.src; //console.log('Cover got: %s', data.cover); break;