Update detect-resolution.js

This commit is contained in:
Aleksandr Statciuk 2021-08-06 07:49:39 +03:00
parent ee591096c1
commit 546c8ff7b1
1 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,7 @@ program
.parse(process.argv) .parse(process.argv)
const config = program.opts() const config = program.opts()
const ignoreStatus = ['Offline']
const instance = axios.create({ const instance = axios.create({
timeout: config.timeout, timeout: config.timeout,
maxContentLength: 200000, maxContentLength: 200000,
@ -50,7 +51,10 @@ async function detectResolution(playlist) {
let updated = false let updated = false
for (const channel of playlist.channels) { for (const channel of playlist.channels) {
bar.tick() bar.tick()
if (!channel.resolution.height) { const skipChannel =
channel.status &&
ignoreStatus.map(i => i.toLowerCase()).includes(channel.status.toLowerCase())
if (!channel.resolution.height && !skipChannel) {
const CancelToken = axios.CancelToken const CancelToken = axios.CancelToken
const source = CancelToken.source() const source = CancelToken.source()
const timeout = setTimeout(() => { const timeout = setTimeout(() => {