mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 18:40:05 -04:00
Update helper.js
This commit is contained in:
parent
11f7e4cf45
commit
3e9176dede
1 changed files with 4 additions and 13 deletions
|
@ -71,7 +71,8 @@ helper.getEPG = function(url) {
|
||||||
axios({
|
axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: url,
|
url: url,
|
||||||
responseType:'stream'
|
responseType: 'stream',
|
||||||
|
timeout: 60000
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let stream
|
let stream
|
||||||
if(/\.gz$/i.test(url)) {
|
if(/\.gz$/i.test(url)) {
|
||||||
|
@ -119,18 +120,6 @@ helper.getUrlPath = function(u) {
|
||||||
return path.toLowerCase()
|
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 = '') {
|
helper.filterPlaylists = function(arr, include = '', exclude = '') {
|
||||||
if(include) {
|
if(include) {
|
||||||
const included = include.split(',').map(filename => `channels/${filename}.m3u`)
|
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.filter(i => excluded.indexOf(i.url) === -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.skipPlaylist = function(filename) {
|
helper.skipPlaylist = function(filename) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue