Update detect-resolution.js
This commit is contained in:
parent
ee591096c1
commit
546c8ff7b1
|
@ -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(() => {
|
||||||
|
|
Loading…
Reference in New Issue