From c672f0dedfb3be63edbe7fd2a847354c3c7aad6a Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Mon, 30 Sep 2024 15:11:24 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=B7=BB=E5=8A=A0=E9=98=BF?= =?UTF-8?q?b=E7=9B=B4=E6=92=AD=E8=A7=A3=E6=9E=90=E5=88=87=E7=89=87=20[beta?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index b2f508f..7d9699d 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -362,7 +362,7 @@ export class tools extends plugin { const dySendContent = `${ this.identifyPrefix }识别:抖音直播,${ title }` e.reply([segment.image(cover?.url_list?.[0]), dySendContent, `\n🏄‍♂️在线人数:${ user_count_str }人正在观看`]); // 下载10s的直播流 - this.sendStreamSegment(e, stream_url?.flv_pull_url?.HD1); + await this.sendStreamSegment(e, stream_url?.flv_pull_url?.HD1); return; } const item = await data.aweme_detail; @@ -456,8 +456,9 @@ export class tools extends plugin { * @param stream_url * @param second */ - sendStreamSegment(e, stream_url, second = 10) { - const outputFilePath = `${ this.getCurDownloadPath(e) }/stream_10s.flv` + async sendStreamSegment(e, stream_url, second = 10) { + const outputFilePath = `${ this.getCurDownloadPath(e) }/stream_10s.flv`; + await checkAndRemoveFile(outputFilePath); const file = fs.createWriteStream(outputFilePath); axios.get(stream_url, { responseType: 'stream'