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.
14 lines
352 B
JavaScript
14 lines
352 B
JavaScript
const { file } = require('../../core')
|
|
const countries = require('../../data/countries')
|
|
|
|
module.exports = function ({ filepath }) {
|
|
if (filepath) {
|
|
const basename = file.basename(filepath)
|
|
const [_, code] = basename.match(/([a-z]{2})(|_.*)\.m3u/i) || [null, null]
|
|
|
|
return code ? countries[code.toUpperCase()] : null
|
|
}
|
|
|
|
return null
|
|
}
|