From c47e9fdd0bda3f2cb5b61624e78f47236335e7ad Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 16 Aug 2019 14:53:44 +0300 Subject: [PATCH] Update util.js Added list of supported EPG file types --- helpers/util.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helpers/util.js b/helpers/util.js index 6c5dbac859..6b184f895b 100644 --- a/helpers/util.js +++ b/helpers/util.js @@ -132,6 +132,8 @@ async function loadEPG(url) { } function getGzipped(url) { + const supportedTypes = ['application/x-gzip', 'application/octet-stream'] + return new Promise((resolve, reject) => { var buffer = [] axios({ @@ -140,12 +142,12 @@ function getGzipped(url) { responseType:'stream' }).then(res => { let stream - if(res.headers['content-type'] === 'application/xml') { - stream = res.data - } else { + if(supportedTypes.indexOf(res.headers['content-type']) > -1) { let gunzip = zlib.createGunzip() res.data.pipe(gunzip) stream = gunzip + } else { + stream = res.data } stream.on('data', function(data) {