Update filter.js
This commit is contained in:
parent
da29bd114e
commit
7229493995
|
@ -1,16 +1,17 @@
|
||||||
const blacklist = require('./data/blacklist.json')
|
const blacklist = require('./data/blacklist.json')
|
||||||
const parser = require('./helpers/parser')
|
const parser = require('./helpers/parser')
|
||||||
|
const file = require('./helpers/file')
|
||||||
const log = require('./helpers/log')
|
const log = require('./helpers/log')
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
log.start()
|
log.start()
|
||||||
|
|
||||||
log.print(`Parsing 'index.m3u'...`)
|
const files = await file.list()
|
||||||
const playlists = parser.parseIndex()
|
if (!files.length) log.print(`No files is selected\n`)
|
||||||
for (const playlist of playlists) {
|
for (const file of files) {
|
||||||
log.print(`\nProcessing '${playlist.url}'...`)
|
log.print(`\nProcessing '${file}'...`)
|
||||||
await parser
|
await parser
|
||||||
.parsePlaylist(playlist.url)
|
.parsePlaylist(file)
|
||||||
.then(removeBlacklisted)
|
.then(removeBlacklisted)
|
||||||
.then(p => p.save())
|
.then(p => p.save())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue