Upgrade to last version of iptv-playlist-parser
This commit is contained in:
parent
f8c956ad40
commit
5947ccf4a6
@ -69,7 +69,7 @@ async function main() {
|
||||
}
|
||||
}
|
||||
|
||||
const epgUrl = playlist.attrs['x-tvg-url']
|
||||
const epgUrl = playlist.header.attrs['x-tvg-url']
|
||||
if(epgUrl && !buffer[epgUrl] && parseEpg) {
|
||||
console.log(`Loading '${epgUrl}'...`)
|
||||
const epg = await util.loadEPG(epgUrl)
|
||||
|
@ -18,17 +18,14 @@ let cache = {}
|
||||
|
||||
class Playlist {
|
||||
constructor(data) {
|
||||
this.attrs = {
|
||||
'x-tvg-url': data.tvg.url
|
||||
}
|
||||
|
||||
this.header = data.header
|
||||
this.items = data.items
|
||||
}
|
||||
|
||||
getHeader() {
|
||||
let parts = ['#EXTM3U']
|
||||
for(let key in this.attrs) {
|
||||
let value = this.attrs[key]
|
||||
for(let key in this.header.attrs) {
|
||||
let value = this.header.attrs[key]
|
||||
if(value) {
|
||||
parts.push(`${key}="${value}"`)
|
||||
}
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -32,9 +32,9 @@
|
||||
}
|
||||
},
|
||||
"iptv-playlist-parser": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/iptv-playlist-parser/-/iptv-playlist-parser-0.1.2.tgz",
|
||||
"integrity": "sha512-CItFULezZv3o+RANgZDXiVWqEBDtzCXn6YkTBzsWyxnYV/oOyzDsN2xMJ2U/a0CHIXzY3NZ+KNP7+VbcAI2DBQ==",
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/iptv-playlist-parser/-/iptv-playlist-parser-0.2.0.tgz",
|
||||
"integrity": "sha512-qPWX9ou6SKOROnPk/zjXFekzJbWq+Q/5h6bkIOMWiRM+/P5SxY2e5N845I1nwWP5DvqlGaEGuGaX1xCjpOpO6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"m3u8-file-parser": "^0.2.1"
|
||||
|
@ -11,7 +11,7 @@
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"axios": ">=0.18.1",
|
||||
"iptv-playlist-parser": "^0.1.2",
|
||||
"iptv-playlist-parser": "^0.2.0",
|
||||
"xmldom": "^0.1.27"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user