Delete albepg.com.config.js

This commit is contained in:
Aleksandr Statciuk 2021-08-23 15:57:47 +03:00
parent f8727a3a3f
commit a9dc6f593a

View file

@ -1,51 +0,0 @@
const epgParser = require('epg-parser')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(utc)
dayjs.extend(customParseFormat)
module.exports = {
lang: 'sq',
site: 'albepg.com',
channels: 'albepg.com.channels.xml',
output: '.gh-pages/guides/albepg.com.guide.xml',
request: {
timeout: 15000,
headers: {
Referer: 'http://albepg.com/epg.html'
}
},
url: function () {
return `http://albepg.com/epg/guide.xml`
},
logo: function ({ channel }) {
return `http://albepg.com/tvlogi/${channel.site_id}.png`
},
parser: function ({ content, channel, date }) {
const results = epgParser.parse(content)
let programs = []
results.programs
.filter(item => item.channel === channel.site_id)
.forEach(item => {
if (item.title.length && item.start && item.stop) {
const description = item.desc.length ? item.desc[0].value : null
const category = item.category.length ? item.category[0].value : null
const start = dayjs.utc(item.start, 'YYYYMMDDHHmmss Z')
const stop = dayjs.utc(item.stop, 'YYYYMMDDHHmmss Z')
if (start.diff(date.format('YYYY-MM-DD'), 'd') === 0) {
programs.push({
title: item.title[0].value,
description,
category,
start: start.toString(),
stop: stop.toString()
})
}
}
})
return programs
}
}