mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🦄 reactor: 令牌桶
深度清洁
This commit is contained in:
parent
824a01f7c8
commit
6157a19e12
@ -325,9 +325,12 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// logger.info(resUrl);
|
// logger.info(resUrl);
|
||||||
const path = `${ this.getCurDownloadPath(e) }/temp.mp4`;
|
const path = `${ this.getCurDownloadPath(e) }/temp.mp4`;
|
||||||
|
// 加入队列
|
||||||
|
this.queue.add(async () => {
|
||||||
await this.downloadVideo(resUrl).then(() => {
|
await this.downloadVideo(resUrl).then(() => {
|
||||||
this.sendVideoToUpload(e, path)
|
this.sendVideoToUpload(e, path)
|
||||||
});
|
});
|
||||||
|
})
|
||||||
} else if (urlType === "image") {
|
} else if (urlType === "image") {
|
||||||
// 发送描述
|
// 发送描述
|
||||||
e.reply(`识别:抖音, ${ item.desc }`);
|
e.reply(`识别:抖音, ${ item.desc }`);
|
||||||
@ -579,6 +582,8 @@ export class tools extends plugin {
|
|||||||
// 创建文件,如果不存在
|
// 创建文件,如果不存在
|
||||||
const path = `${ this.getCurDownloadPath(e) }/`;
|
const path = `${ this.getCurDownloadPath(e) }/`;
|
||||||
await mkdirIfNotExists(path);
|
await mkdirIfNotExists(path);
|
||||||
|
// 加入队列
|
||||||
|
this.queue.add(async () => {
|
||||||
// 下载文件
|
// 下载文件
|
||||||
getDownloadUrl(url)
|
getDownloadUrl(url)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
@ -595,6 +600,7 @@ export class tools extends plugin {
|
|||||||
logger.error(err);
|
logger.error(err);
|
||||||
e.reply("解析失败,请重试一下");
|
e.reply("解析失败,请重试一下");
|
||||||
});
|
});
|
||||||
|
})
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user