mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 02:20:03 -04:00
Update validate.js
This commit is contained in:
parent
7fe8a3da7b
commit
c18bf41b38
1 changed files with 38 additions and 30 deletions
|
@ -32,6 +32,7 @@ async function main() {
|
||||||
|
|
||||||
const buffer = {}
|
const buffer = {}
|
||||||
const fileLog = []
|
const fileLog = []
|
||||||
|
try {
|
||||||
const playlist = await parser.parsePlaylist(filepath)
|
const playlist = await parser.parsePlaylist(filepath)
|
||||||
for (const item of playlist.items) {
|
for (const item of playlist.items) {
|
||||||
if (item.tvg.id && !api.channels.find({ id: item.tvg.id })) {
|
if (item.tvg.id && !api.channels.find({ id: item.tvg.id })) {
|
||||||
|
@ -66,6 +67,13 @@ async function main() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
fileLog.push({
|
||||||
|
type: 'error',
|
||||||
|
line: 0,
|
||||||
|
message: err.message.toLowerCase()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (fileLog.length) {
|
if (fileLog.length) {
|
||||||
logger.info(`\n${chalk.underline(filepath)}`)
|
logger.info(`\n${chalk.underline(filepath)}`)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue