This commit is contained in:
freearhey 2019-11-03 10:56:54 +03:00
parent db008d61fb
commit fc469c0568
2 changed files with 187 additions and 163 deletions

View file

@ -147,6 +147,20 @@ helper.validateUrl = function(channelUrl) {
return blacklist.indexOf(host) === -1
}
helper.filterPlaylists = function(arr, include = '', exclude = '') {
if(include) {
const included = include.split(',').map(filename => `channels/${filename}.m3u`)
return arr.filter(i => included.indexOf(i.url) > -1)
}
if(exclude) {
const excluded = exclude.split(',').map(filename => `channels/${filename}.m3u`)
return arr.filter(i => excluded.indexOf(i.url) === -1)
}
}
helper.skipPlaylist = function(filename) {
let testCountry = process.env.npm_config_country
let excludeList = process.env.npm_config_exclude