1111
This commit is contained in:
parent
c88e2f172d
commit
6acb40da3c
5
index.js
5
index.js
@ -171,7 +171,8 @@ const fetchApiData = (reqPath, sign) => {
|
|||||||
'Content-Length': Buffer.byteLength(postData),
|
'Content-Length': Buffer.byteLength(postData),
|
||||||
'sign': sign
|
'sign': sign
|
||||||
},
|
},
|
||||||
timeout: requestTimeout
|
timeout: requestTimeout,
|
||||||
|
rejectUnauthorized: false
|
||||||
}, (apiRes) => {
|
}, (apiRes) => {
|
||||||
let data = '';
|
let data = '';
|
||||||
apiRes.on('data', chunk => data += chunk);
|
apiRes.on('data', chunk => data += chunk);
|
||||||
@ -192,7 +193,7 @@ const fetchApiData = (reqPath, sign) => {
|
|||||||
|
|
||||||
// 从真实 URL 获取数据并写入缓存
|
// 从真实 URL 获取数据并写入缓存
|
||||||
const fetchAndServe = (data, tempCacheContentFile, cacheContentFile, res) => {
|
const fetchAndServe = (data, tempCacheContentFile, cacheContentFile, res) => {
|
||||||
https.get(data.realUrl, { timeout: requestTimeout * 10 }, (realRes) => {
|
https.get(data.realUrl, { timeout: requestTimeout * 10,rejectUnauthorized: false }, (realRes) => {
|
||||||
const cacheStream = fs.createWriteStream(tempCacheContentFile, { flags: 'w' });
|
const cacheStream = fs.createWriteStream(tempCacheContentFile, { flags: 'w' });
|
||||||
|
|
||||||
let isVideo = data.path && typeof data.path === 'string' && data.path.includes('.mp4');
|
let isVideo = data.path && typeof data.path === 'string' && data.path.includes('.mp4');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user