From 5947ccf4a621c6758592e573c3826c613bec93aa Mon Sep 17 00:00:00 2001 From: freearhey Date: Mon, 7 Oct 2019 04:15:27 +0300 Subject: [PATCH] Upgrade to last version of iptv-playlist-parser --- helpers/format.js | 2 +- helpers/util.js | 9 +++------ package-lock.json | 6 +++--- package.json | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/helpers/format.js b/helpers/format.js index 1f1b53546..e410fc3a8 100644 --- a/helpers/format.js +++ b/helpers/format.js @@ -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) diff --git a/helpers/util.js b/helpers/util.js index bd2408135..e79a6697a 100644 --- a/helpers/util.js +++ b/helpers/util.js @@ -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}"`) } diff --git a/package-lock.json b/package-lock.json index 39dc93ac7..515ffd16c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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" diff --git a/package.json b/package.json index d59c02658..21875a97d 100644 --- a/package.json +++ b/package.json @@ -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" } }