parent
b691aeecd7
commit
73ada87393
|
@ -1,4 +1,5 @@
|
||||||
const { program } = require('commander')
|
const { program } = require('commander')
|
||||||
|
const blacklist = require('./blacklist')
|
||||||
const parser = require('./parser')
|
const parser = require('./parser')
|
||||||
const utils = require('./utils')
|
const utils = require('./utils')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
@ -35,6 +36,7 @@ async function main() {
|
||||||
await loadPlaylist(playlist.url)
|
await loadPlaylist(playlist.url)
|
||||||
.then(addToBuffer)
|
.then(addToBuffer)
|
||||||
.then(sortChannels)
|
.then(sortChannels)
|
||||||
|
.then(filterChannels)
|
||||||
.then(removeDuplicates)
|
.then(removeDuplicates)
|
||||||
.then(detectResolution)
|
.then(detectResolution)
|
||||||
.then(updateFromEPG)
|
.then(updateFromEPG)
|
||||||
|
@ -83,6 +85,16 @@ async function sortChannels(playlist) {
|
||||||
return playlist
|
return playlist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function filterChannels(playlist) {
|
||||||
|
console.info(` Filtering channels...`)
|
||||||
|
const list = blacklist.map(i => i.toLowerCase())
|
||||||
|
playlist.channels = playlist.channels.filter(i => {
|
||||||
|
return !list.includes(i.name.toLowerCase())
|
||||||
|
})
|
||||||
|
|
||||||
|
return playlist
|
||||||
|
}
|
||||||
|
|
||||||
async function removeDuplicates(playlist) {
|
async function removeDuplicates(playlist) {
|
||||||
console.info(` Looking for duplicates...`)
|
console.info(` Looking for duplicates...`)
|
||||||
let buffer = {}
|
let buffer = {}
|
||||||
|
|
Loading…
Reference in New Issue