🎈 pref: 优化X解析逻辑

This commit is contained in:
zhiyu1998 2024-07-14 22:45:09 +08:00
parent 1bc359cda6
commit eec5741dbd
2 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -234,7 +234,7 @@ export async function downloadImg(img, dir, fileName = "", isProxy = false, head
}); });
}); });
} catch (err) { } catch (err) {
logger.error("图片下载失败"); logger.error(`图片下载失败, 原因:${err}`);
} }
} }