From 410fd291e7dbeec146f8eb866742689af21c73db Mon Sep 17 00:00:00 2001 From: zhiyu <542716863@qq.com> Date: Sat, 24 Feb 2024 23:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20V1.4.1=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=B1=B3=E6=B8=B8=E7=A4=BE=E6=96=87=E7=AB=A0=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=83=A8=E5=88=86=E8=A7=86=E9=A2=91=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=EF=BC=88eg.=20https://m.miyoushe.com/ys=3Fch?= =?UTF-8?q?annel=3Dhuawei/#/article/49677149=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 573a1d2..d705127 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1129,12 +1129,18 @@ export class tools extends plugin { // 视频 if (structured_content) { const sc = JSON.parse(structured_content); - const resolutions = sc?.[1].insert.vod.resolutions; - // 暂时选取分辨率较低的video进行解析 - const videoUrl = resolutions[0].url; - this.downloadVideo(videoUrl).then(path => { - e.reply(segment.video(path + "/temp.mp4")); - }); + // 逐个遍历是否包含url + for (let i = 0; i < sc.length; i++) { + const resolutions = sc?.[i]?.insert.vod.resolutions; + if (resolutions) { + // 暂时选取分辨率较低的video进行解析 + const videoUrl = resolutions[0].url; + this.downloadVideo(videoUrl).then(path => { + e.reply(segment.video(path + "/temp.mp4")); + }); + break; + } + } } // 这个判断防止发送重复图片 if (images && images.length > 1) {