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
a493b98f98
commit
d26fd51eee
@ -7,6 +7,7 @@ import fetch from "node-fetch";
|
|||||||
import { mkdirIfNotExists } from "./file.js";
|
import { mkdirIfNotExists } from "./file.js";
|
||||||
import { TEN_THOUSAND } from "../constants/constant.js";
|
import { TEN_THOUSAND } from "../constants/constant.js";
|
||||||
import { exec } from "child_process";
|
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",
|
responseType: "stream",
|
||||||
};
|
};
|
||||||
|
// 添加🪜
|
||||||
if (isProxy) {
|
if (isProxy) {
|
||||||
axiosConfig.httpAgent = tunnel.httpOverHttp({
|
axiosConfig.httpsAgent = new HttpsProxyAgent({
|
||||||
proxy: { host: proxyInfo.proxyAddr, port: proxyInfo.proxyPort },
|
host: proxyInfo.proxyAddr,
|
||||||
});
|
port: proxyInfo.proxyPort
|
||||||
axiosConfig.httpsAgent = tunnel.httpOverHttp({
|
|
||||||
proxy: { host: proxyInfo.proxyAddr, port: proxyInfo.proxyPort },
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user