From 1260b6ddbb08e621fb7679f3c0da29010f7e51b3 Mon Sep 17 00:00:00 2001 From: filesite Date: Wed, 27 Sep 2023 23:13:47 +0800 Subject: [PATCH] cover image url improve --- bot/Bilibili.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/Bilibili.mjs b/bot/Bilibili.mjs index 2620f48..324680f 100644 --- a/bot/Bilibili.mjs +++ b/bot/Bilibili.mjs @@ -60,9 +60,10 @@ class Bilibili extends HeroBot { //get cover image's base64 data //sample: //i1.hdslb.com/bfs/archive/ef6204c8788134064dc6b7e8cb20870f1341e604.jpg@100w_100h_1c.png + //替换成://i1.hdslb.com/bfs/archive/ef6204c8788134064dc6b7e8cb20870f1341e604.jpg@480w_270h_1c.png if (typeof(data.cover) != 'undefined' && data.cover) { data.cover = common.getAbsoluteUrl(data.cover); - data.cover = data.cover.replace(/@[\w\.]+$/ig, ''); + data.cover = data.cover.replace(/@[\w]+\./ig, '@480w_270h_1c.'); const response = await hero.goto(data.cover); const imgBuffer = await response.buffer;