mirror of https://github.com/iptv-org/iptv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
441 B
JavaScript
19 lines
441 B
JavaScript
const list = require('../data/blocklist')
|
|
const parser = require('./parser')
|
|
|
|
const blocklist = {}
|
|
|
|
blocklist.find = function (title, country) {
|
|
const name = parser.parseChannelName(title)
|
|
|
|
return list.find(item => {
|
|
const regexp = new RegExp(item.regex, 'i')
|
|
const hasSameName = regexp.test(name)
|
|
const fromSameCountry = country === item.country
|
|
|
|
return hasSameName && fromSameCountry
|
|
})
|
|
}
|
|
|
|
module.exports = blocklist
|