From 6e4530cc3155d485983d410e3c63688dda5be4ec Mon Sep 17 00:00:00 2001 From: RrOrange <542716863@qq.com> Date: Mon, 3 Jul 2023 00:53:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=B2=A1=E5=BF=85=E8=A6=81=E7=9A=84=E5=8A=9F=E8=83=BD=20&=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=90=9C=E4=B9=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 作者被勒索更新了,没办法,非要更新这个搜书,顺便删点垃圾功能,增强一下哔哩哔哩总结 --- utils/books.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils/books.js b/utils/books.js index 8bc1e6c..4b4ac01 100644 --- a/utils/books.js +++ b/utils/books.js @@ -182,16 +182,14 @@ async function getZHelper(e, keyword) { const annaDataPromises = resp[1].value.data.data.slice(0, LIMIT).map(async (item) => { const { author, cover, extension, id, link, publisher, sizestring, source, title } = item; // 固定一个模板 - let resBooks = `<${title}>\n` + - `作者:${author}\n` + - `书籍类型:${extension}\n` + + let resBooks = `<${title}> 作者:${author} 书籍类型:${extension}\n` + `来源:${source}\n` + `出版社:${publisher}\n` + `文件大小:${sizestring}`; // 发送一个需要下载链接的请求 const downloadLink = await getDownloadLink(id); - resBooks += downloadLink; + resBooks += `\n${downloadLink}`; return { message: { type: "text", @@ -225,7 +223,7 @@ async function getDownloadLink(id) { const { download_link } = resp.data; const links = download_link.slice(0, 2).map((item, index) => { - return `直链 #${index}: ${item?.url}\n` + return `直链 #${index + 1}: ${encodeURIComponent(item?.url)}\n\n` }) return `\n${links}`;