mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 18:10:04 -04:00
Installed escape-string-regexp
This commit is contained in:
parent
3c5ea29926
commit
321f85ad53
3 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
const util = require('./util')
|
||||
const escapeStringRegexp = require('escape-string-regexp')
|
||||
|
||||
const debug = false
|
||||
const verbose = false
|
||||
|
@ -83,6 +84,7 @@ async function main() {
|
|||
for(let channelId in buffer[epgUrl].channels) {
|
||||
let c = buffer[epgUrl].channels[channelId]
|
||||
for(let epgName of c.names) {
|
||||
epgName = escapeStringRegexp(epgName)
|
||||
channelTitle = channel.title.replace(/(fhd|hd|sd|高清)$/i, '').trim()
|
||||
let regexp = new RegExp(`^${epgName}$`, 'i')
|
||||
if(regexp.test(channelTitle)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue