mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Create makrodigitaltelevision.com.config.js
This commit is contained in:
parent
6fd72128ef
commit
3540d581fc
1 changed files with 26 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
const parser = require('epg-parser')
|
||||
|
||||
module.exports = {
|
||||
site: 'makrodigitaltelevision.com',
|
||||
days: 3,
|
||||
url: 'https://makrodigitaltelevision.com/epg.xml',
|
||||
parser({ content, date, channel }) {
|
||||
let programs = []
|
||||
const items = parseItems(content, channel, date)
|
||||
items.forEach(item => {
|
||||
programs.push({
|
||||
title: item.title?.[0]?.value,
|
||||
start: item.start,
|
||||
stop: item.stop
|
||||
})
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
function parseItems(content, channel, date) {
|
||||
const { programs } = parser.parse(content)
|
||||
|
||||
return programs.filter(p => p.channel === channel.site_id && date.isSame(p.start, 'day'))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue