🐞 fix: 修复zuiyou更换图床导致无法解析图片问题

This commit is contained in:
zhiyu1998 2024-08-24 13:08:32 +08:00
parent 980fd4a2ee
commit d3ad07ba0f

View File

@ -1623,12 +1623,11 @@ export class tools extends plugin {
const imgSrcRegex = /<img [^>]*src="([^"]*)"[^>]*\/>/gi;
let match;
const imgSrcs = [];
while ((match = imgSrcRegex.exec(html)) !== null) {
imgSrcs.push(match[1]); // Adds the content of the src attribute to the array
}
const images = imgSrcs.filter(item => item.startsWith("http://bd-tbfile.izuiyou.com/img/view/id"))
const images = imgSrcs.filter(item => item.includes("\/img\/view\/id"))
// Construct the response object
const shortVideoInfo = {
@ -1639,7 +1638,7 @@ export class tools extends plugin {
images,
};
e.reply([segment.image(shortVideoInfo.cover), `${ this.identifyPrefix } 识别:最右,${ shortVideoInfo.authorName }\n${ shortVideoInfo.title }`])
e.reply(`${ this.identifyPrefix } 识别:最右,${ shortVideoInfo.authorName }\n${ shortVideoInfo.title }`)
if (shortVideoInfo.images.length > 0) {
const replyImages = shortVideoInfo.images.map(item => {