mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🎈 pref: 优化X解析逻辑
This commit is contained in:
parent
a493b98f98
commit
d26fd51eee
@ -7,6 +7,7 @@ import fetch from "node-fetch";
|
||||
import { mkdirIfNotExists } from "./file.js";
|
||||
import { TEN_THOUSAND } from "../constants/constant.js";
|
||||
import { exec } from "child_process";
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||
|
||||
/**
|
||||
* 请求模板
|
||||
@ -208,13 +209,11 @@ export async function downloadImg(img, dir, fileName = "", isProxy = false, head
|
||||
},
|
||||
responseType: "stream",
|
||||
};
|
||||
|
||||
// 添加🪜
|
||||
if (isProxy) {
|
||||
axiosConfig.httpAgent = tunnel.httpOverHttp({
|
||||
proxy: { host: proxyInfo.proxyAddr, port: proxyInfo.proxyPort },
|
||||
});
|
||||
axiosConfig.httpsAgent = tunnel.httpOverHttp({
|
||||
proxy: { host: proxyInfo.proxyAddr, port: proxyInfo.proxyPort },
|
||||
axiosConfig.httpsAgent = new HttpsProxyAgent({
|
||||
host: proxyInfo.proxyAddr,
|
||||
port: proxyInfo.proxyPort
|
||||
});
|
||||
}
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user