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)
This commit is contained in:
freearhey 2021-04-10 23:17:05 +03:00
parent 86e061f084
commit 214108eb0a

View File

@ -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))