mirror of
https://github.com/iptv-org/iptv
synced 2025-12-18 03:17:14 -05:00
Update validate.js
This commit is contained in:
@@ -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 =>
|
||||||
|
|||||||
Reference in New Issue
Block a user