diff --git a/index.js b/index.js index 41f9e60..79a505a 100644 --- a/index.js +++ b/index.js @@ -171,7 +171,8 @@ const fetchApiData = (reqPath, sign) => { 'Content-Length': Buffer.byteLength(postData), 'sign': sign }, - timeout: requestTimeout + timeout: requestTimeout, + rejectUnauthorized: false }, (apiRes) => { let data = ''; apiRes.on('data', chunk => data += chunk); @@ -192,7 +193,7 @@ const fetchApiData = (reqPath, sign) => { // 从真实 URL 获取数据并写入缓存 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' }); let isVideo = data.path && typeof data.path === 'string' && data.path.includes('.mp4');