From 3e9176dede38214442dba10f6b7244ec3d20c0a3 Mon Sep 17 00:00:00 2001 From: freearhey Date: Sun, 3 Nov 2019 19:00:57 +0300 Subject: [PATCH] Update helper.js --- scripts/helper.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/scripts/helper.js b/scripts/helper.js index dc09312ebd..dca9b32ea3 100644 --- a/scripts/helper.js +++ b/scripts/helper.js @@ -71,7 +71,8 @@ helper.getEPG = function(url) { axios({ method: 'get', url: url, - responseType:'stream' + responseType: 'stream', + timeout: 60000 }).then(res => { let stream if(/\.gz$/i.test(url)) { @@ -119,18 +120,6 @@ helper.getUrlPath = function(u) { return path.toLowerCase() } -helper.validateUrl = function(channelUrl) { - const url = new URL(channelUrl) - const host = url.hostname - const blacklist = [ - '80.80.160.168', // repeats on a loop - '63.237.48.3', // not a live stream - '189.216.247.113', // not working streams - ] - - return blacklist.indexOf(host) === -1 -} - helper.filterPlaylists = function(arr, include = '', exclude = '') { if(include) { const included = include.split(',').map(filename => `channels/${filename}.m3u`) @@ -143,6 +132,8 @@ helper.filterPlaylists = function(arr, include = '', exclude = '') { return arr.filter(i => excluded.indexOf(i.url) === -1) } + + return arr } helper.skipPlaylist = function(filename) {