From 1165bcc8305f900f7ab3d274b152ec98827c59a6 Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Aug 2019 14:11:11 +0300 Subject: [PATCH] Update index.js Skip SSL errors --- test/index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/index.js b/test/index.js index b6167ea96..d6b535116 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,6 @@ const util = require('../helpers/util') const axios = require('axios') +const https = require('https') const errorLog = 'error.log' const config = { @@ -13,7 +14,12 @@ let stats = { failures: 0 } -const http = axios.create({ timeout: config.timeout }) +const http = axios.create({ + timeout: config.timeout, + httpsAgent: new https.Agent({ + rejectUnauthorized: false + }) +}) http.defaults.headers.common["User-Agent"] = "VLC/2.2.4 LibVLC/2.2.4" async function test() { @@ -36,6 +42,8 @@ async function test() { for(let item of playlist.items) { + if(item.url.indexOf('rtmp://') > -1) continue + await new Promise(resolve => { setTimeout(resolve, config.delay) }) @@ -50,9 +58,13 @@ async function test() { } catch (err) { - stats.failures++ + if(!err.response) { + + stats.failures++ + + writeToLog(country.url, err.message, item.url) - writeToLog(country.url, err.message, item.url) + } }