From 214108eb0aebeb494e58fe70ba2938a77cd41735 Mon Sep 17 00:00:00 2001 From: freearhey Date: Sat, 10 Apr 2021 23:17:05 +0300 Subject: [PATCH] Update test.js - exclude 403 error from log (Usually occurs only if the link is geo-blocked) - skip link with rtmp protocol (Not supported by axios client) --- scripts/test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/test.js b/scripts/test.js index 7fd5aaf55..950e50d8c 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -21,7 +21,10 @@ const instance = axios.create({ maxContentLength: 20000, httpsAgent: new https.Agent({ rejectUnauthorized: false - }) + }), + validateStatus: function (status) { + return (status >= 200 && status < 300) || status === 403 + } }) let stats = { @@ -45,6 +48,9 @@ async function test() { for (let channel of playlist.channels) { bar.tick() stats.channels++ + + if (channel.url.startsWith('rtmp://')) continue + await instance .get(channel.url) .then(utils.sleep(config.delay))