Added error handling to loadEPG()

what-a-patch-1
freearhey 6 years ago
parent 077bd6cc37
commit d3adf93292

@ -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]) {

Loading…
Cancel
Save