mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 pref: 优化X解析逻辑
This commit is contained in:
parent
1bc359cda6
commit
eec5741dbd
@ -770,14 +770,14 @@ export class tools extends plugin {
|
|||||||
e.reply(segment.image(url));
|
e.reply(segment.image(url));
|
||||||
} else {
|
} else {
|
||||||
// 非海外使用🪜下载
|
// 非海外使用🪜下载
|
||||||
const proxy = this.myProxy;
|
const proxy = this.proxyAddr;
|
||||||
const port = this.proxyPort;
|
const port = this.proxyPort;
|
||||||
const path = this.getCurDownloadPath(e);
|
const localPath = this.getCurDownloadPath(e);
|
||||||
downloadImg(url, path, "", !isOversea, {}, {
|
downloadImg(url, localPath, "", isOversea, {}, {
|
||||||
proxyAddr: proxy,
|
proxyAddr: proxy,
|
||||||
proxyPort: port
|
proxyPort: port
|
||||||
}).then(path => {
|
}).then(path => {
|
||||||
e.reply(segment.image(fs.readFileSync(path)));
|
e.reply(segment.image(fs.readFileSync(localPath + "/" + url.split("/").pop())));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -234,7 +234,7 @@ export async function downloadImg(img, dir, fileName = "", isProxy = false, head
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error("图片下载失败");
|
logger.error(`图片下载失败, 原因:${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user