From 12df6a0250edf6a9297d9db7bbecbb1ae052ddb3 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sun, 3 May 2026 15:53:55 +0300 Subject: [PATCH] Create epg.tmacaraibes.com.config.js --- .../epg.tmacaraibes.com.config.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sites/epg.tmacaraibes.com/epg.tmacaraibes.com.config.js diff --git a/sites/epg.tmacaraibes.com/epg.tmacaraibes.com.config.js b/sites/epg.tmacaraibes.com/epg.tmacaraibes.com.config.js new file mode 100644 index 000000000..bd080c672 --- /dev/null +++ b/sites/epg.tmacaraibes.com/epg.tmacaraibes.com.config.js @@ -0,0 +1,41 @@ +const parser = require('epg-parser') + +module.exports = { + site: 'epg.tmacaraibes.com', + days: 2, + url: 'https://epg.tmacaraibes.com/Epg/xmltv.xml', + parser: function ({ content, channel, date }) { + let programs = [] + const items = parseItems(content, channel, date) + items.forEach(item => { + programs.push({ + title: item.title, + description: item.desc, + icon: item.icon, + category: item.category, + ratings: item.rating, + length: item.length, + start: item.start, + stop: item.stop + }) + }) + + return programs + }, + channels() { + return [ + { + name: 'TMA', + site_id: 'TMA.gp@SD', + lang: 'fr', + xmltv_id: 'TMA.gp@SD' + } + ] + } +} + +function parseItems(content, channel, date) { + const { programs } = parser.parse(content) + + return programs.filter(p => p.channel === channel.site_id && date.isSame(p.start, 'day')) +}