mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 02:20:03 -04:00
Update clean.js
This commit is contained in:
parent
fb25b24686
commit
f607b813cb
1 changed files with 7 additions and 6 deletions
|
@ -25,7 +25,6 @@ async function main() {
|
||||||
|
|
||||||
if (config.debug) log.print(`Debug mode enabled\n`)
|
if (config.debug) log.print(`Debug mode enabled\n`)
|
||||||
|
|
||||||
log.print(`Parsing 'index.m3u'...`)
|
|
||||||
let playlists = parser.parseIndex()
|
let playlists = parser.parseIndex()
|
||||||
playlists = utils.filterPlaylists(playlists, config.country, config.exclude)
|
playlists = utils.filterPlaylists(playlists, config.country, config.exclude)
|
||||||
for (const playlist of playlists) {
|
for (const playlist of playlists) {
|
||||||
|
@ -39,9 +38,11 @@ async function main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkPlaylist(playlist) {
|
async function checkPlaylist(playlist) {
|
||||||
bar = new ProgressBar(`Checking '${playlist.url}': [:bar] :current/:total (:percent) `, {
|
if (!config.debug) {
|
||||||
total: playlist.channels.length
|
bar = new ProgressBar(`Checking '${playlist.url}': [:bar] :current/:total (:percent) `, {
|
||||||
})
|
total: playlist.channels.length
|
||||||
|
})
|
||||||
|
}
|
||||||
const channels = []
|
const channels = []
|
||||||
const total = playlist.channels.length
|
const total = playlist.channels.length
|
||||||
for (const [index, channel] of playlist.channels.entries()) {
|
for (const [index, channel] of playlist.channels.entries()) {
|
||||||
|
@ -59,10 +60,10 @@ async function checkPlaylist(playlist) {
|
||||||
) {
|
) {
|
||||||
channels.push(channel)
|
channels.push(channel)
|
||||||
} else {
|
} else {
|
||||||
if (config.debug) bar.interrupt(`ERR: ${channel.url}: ${result.status.reason}`)
|
if (config.debug) log.print(`ERR: ${channel.url}: ${result.status.reason}\n`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bar.tick()
|
if (!config.debug) bar.tick()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playlist.channels.length !== channels.length) {
|
if (playlist.channels.length !== channels.length) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue