🦄 reactor: 令牌桶 深度清洁

This commit is contained in:
zhiyu1998 2024-07-24 16:45:11 +08:00
parent 824a01f7c8
commit 6157a19e12

View File

@ -325,9 +325,12 @@ export class tools extends plugin {
// logger.info(resUrl);
const path = `${ this.getCurDownloadPath(e) }/temp.mp4`;
// 加入队列
this.queue.add(async () => {
await this.downloadVideo(resUrl).then(() => {
this.sendVideoToUpload(e, path)
});
})
} else if (urlType === "image") {
// 发送描述
e.reply(`识别:抖音, ${ item.desc }`);
@ -579,6 +582,8 @@ export class tools extends plugin {
// 创建文件,如果不存在
const path = `${ this.getCurDownloadPath(e) }/`;
await mkdirIfNotExists(path);
// 加入队列
this.queue.add(async () => {
// 下载文件
getDownloadUrl(url)
.then(data => {
@ -595,6 +600,7 @@ export class tools extends plugin {
logger.error(err);
e.reply("解析失败,请重试一下");
});
})
return true;
}