Merge branch 'master' into add-more-channels

This commit is contained in:
freearhey 2021-03-01 01:44:11 +03:00
commit 6e5cc493fb
2 changed files with 81 additions and 0 deletions

69
scripts/blacklist.json Normal file
View File

@ -0,0 +1,69 @@
[
"Animal Planet",
"Asian Food Network",
"Cooking Channel",
"Discovery Asia",
"Discovery Channel",
"Discovery Civiliztion",
"Discovery en Espanol",
"Discovery Family",
"Discovery Historia",
"Discovery History",
"Discovery Home and Health",
"Discovery Life",
"Discovery Science",
"Discovery Shed",
"Discovery Theater",
"Discovery Travel and Living",
"Discovery Turbo Xtra",
"Discovery World",
"Discovery",
"DIY Network",
"DKiss",
"DMax",
"Eurosport 1",
"Eurosport 2",
"Eurosport",
"eve",
"Familia Discovery",
"Fatafeat",
"FEM",
"Fine Living",
"Food Network",
"food tv",
"foodtv",
"Frisbee",
"Giallo",
"Golf TV",
"GolfTV",
"HGTV",
"HGTV",
"ID Investigation Discovery",
"ID Investigation",
"K2",
"Living Channel",
"Mango",
"Motortrend",
"Nove",
"Oprah",
"OWN",
"Quest Red",
"Quest",
"Real Time",
"TLC",
"Trvl Channel",
"TTV",
"TV Norge",
"Tvn 24 Bis",
"TVN 24",
"Tvn 7",
"TVN Extra",
"TVN Fabula",
"TVN Meteo",
"TVN Style",
"TVN Turbo",
"TVN Warszawa",
"TVN",
"Vox",
"World Discovery"
]

View File

@ -1,4 +1,5 @@
const { program } = require('commander')
const blacklist = require('./blacklist')
const parser = require('./parser')
const utils = require('./utils')
const axios = require('axios')
@ -35,6 +36,7 @@ async function main() {
await loadPlaylist(playlist.url)
.then(addToBuffer)
.then(sortChannels)
.then(filterChannels)
.then(removeDuplicates)
.then(detectResolution)
.then(updateFromEPG)
@ -83,6 +85,16 @@ async function sortChannels(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) {
console.info(` Looking for duplicates...`)
let buffer = {}