mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 10:30:03 -04:00
Update validate.js
This commit is contained in:
parent
39ef19b716
commit
fae74f4e2c
1 changed files with 11 additions and 0 deletions
|
@ -30,6 +30,7 @@ async function main() {
|
||||||
const basename = file.basename(filepath)
|
const basename = file.basename(filepath)
|
||||||
const [__, country] = basename.match(/([a-z]{2})(|_.*)\.m3u/i) || [null, null]
|
const [__, country] = basename.match(/([a-z]{2})(|_.*)\.m3u/i) || [null, null]
|
||||||
|
|
||||||
|
const buffer = {}
|
||||||
const fileLog = []
|
const fileLog = []
|
||||||
const playlist = await parser.parsePlaylist(filepath)
|
const playlist = await parser.parsePlaylist(filepath)
|
||||||
for (const item of playlist.items) {
|
for (const item of playlist.items) {
|
||||||
|
@ -41,6 +42,16 @@ async function main() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.url && buffer[item.url]) {
|
||||||
|
fileLog.push({
|
||||||
|
type: 'warning',
|
||||||
|
line: item.line,
|
||||||
|
message: `"${item.url}" is already on the playlist`
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
buffer[item.url] = true
|
||||||
|
}
|
||||||
|
|
||||||
const channel_id = id.generate(item.name, country)
|
const channel_id = id.generate(item.name, country)
|
||||||
const found = blocklist.find(
|
const found = blocklist.find(
|
||||||
blocked =>
|
blocked =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue