mirror of
https://github.com/iptv-org/iptv.git
synced 2026-10-26 11:58:59 -04:00
Update create-database.js
This commit is contained in:
1 parent
35a30272e4
commit
4e4579e1ef
8 files changed
+34
-27
No files matched your search
@@ -28,4 +28,23 @@ parser.parseNumber = function (string) {
|
||||
return parsed
|
||||
}
|
||||
|
||||
parser.parseChannelName = function (string) {
|
||||
return string
|
||||
.trim()
|
||||
.split(' ')
|
||||
.map(s => s.trim())
|
||||
.filter(s => {
|
||||
return !/\[|\]/i.test(s) && !/\((\d+)P\)/i.test(s)
|
||||
})
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
parser.parseCountryCode = function (filepath) {
|
||||
if (!filepath) return null
|
||||
const basename = file.basename(filepath)
|
||||
const [code] = basename.split('_') || [null]
|
||||
|
||||
return code
|
||||
}
|
||||
|
||||
module.exports = parser
|
||||
Reference in new issue
Block a user