Added error handling to loadEPG()

This commit is contained in:
freearhey 2019-10-25 23:37:42 +03:00
parent 1d9cc3a185
commit 2372a27bc3

View File

@ -72,10 +72,14 @@ async function main() {
const epgUrl = playlist.header.attrs['x-tvg-url']
if(epgUrl && !buffer[epgUrl] && parseEpg) {
console.log(`Loading '${epgUrl}'...`)
const epg = await util.loadEPG(epgUrl)
console.log(`Adding '${epgUrl}' to buffer...`)
buffer[epgUrl] = epg
try {
console.log(`Loading '${epgUrl}'...`)
const epg = await util.loadEPG(epgUrl)
console.log(`Adding '${epgUrl}' to buffer...`)
buffer[epgUrl] = epg
} catch(e) {
console.log(`Could not load '${epgUrl}'`)
}
}
if(buffer[epgUrl]) {