mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Delete albepg.com.config.js
This commit is contained in:
parent
f8727a3a3f
commit
a9dc6f593a
1 changed files with 0 additions and 51 deletions
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue