UNPKG

iptv-checker

Version:

Node.js CLI tool for checking links in IPTV playlists

31 lines (26 loc) 572 B
import axios from 'axios' import https from 'https' export class PlaylistLoader { constructor({ config }) { const client = axios.create({ method: 'GET', timeout: config.timeout, responseType: 'text', httpsAgent: new https.Agent({ rejectUnauthorized: false }) }) client.interceptors.response.use( response => { return response.data }, () => { return Promise.reject('Error fetching playlist') } ) this.client = client } load(url) { return this.client(url) } }