From 77ff94e2b42a8b1679470219c6f92dfbe8e8ac5f Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Jun 2023 22:44:20 +0300 Subject: [PATCH 1/3] Update tv.dir.bg.test.js --- sites/tv.dir.bg/tv.dir.bg.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/tv.dir.bg/tv.dir.bg.test.js b/sites/tv.dir.bg/tv.dir.bg.test.js index 0034e280..65dff1fb 100644 --- a/sites/tv.dir.bg/tv.dir.bg.test.js +++ b/sites/tv.dir.bg/tv.dir.bg.test.js @@ -1,5 +1,5 @@ // node ./scripts/commands/parse-channels.js --config=./sites/tv.dir.bg/tv.dir.bg.config.js --output=./sites/tv.dir.bg/tv.dir.bg.channels.xml -// npx epg-grabber --config=sites/tv.dir.bg/tv.dir.bg.config.js --channels=sites/tv.dir.bg/tv.dir.bg.channels.xml --output=guide.xml --days=2 +// npx epg-grabber --config=sites/tv.dir.bg/tv.dir.bg.config.js --channels=sites/tv.dir.bg/tv.dir.bg.channels.xml --output=guide.xml const { parser, url } = require('./tv.dir.bg.config.js') const dayjs = require('dayjs') From a8de5d9f62b309d6cc2af306e0b5a769f2b7ae76 Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Jun 2023 22:44:26 +0300 Subject: [PATCH 2/3] Update tv.dir.bg.config.js --- sites/tv.dir.bg/tv.dir.bg.config.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sites/tv.dir.bg/tv.dir.bg.config.js b/sites/tv.dir.bg/tv.dir.bg.config.js index 0005e620..2206ad68 100644 --- a/sites/tv.dir.bg/tv.dir.bg.config.js +++ b/sites/tv.dir.bg/tv.dir.bg.config.js @@ -1,13 +1,6 @@ const axios = require('axios') const cheerio = require('cheerio') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const timezone = require('dayjs/plugin/timezone') -const customParseFormat = require('dayjs/plugin/customParseFormat') - -dayjs.extend(utc) -dayjs.extend(timezone) -dayjs.extend(customParseFormat) +const { DateTime } = require('luxon') module.exports = { site: 'tv.dir.bg', @@ -24,13 +17,13 @@ module.exports = { let start = parseStart($item, date) if (!start) return if (prev) { - if (start.isBefore(prev.start)) { - start = start.add(1, 'd') + if (start < prev.start) { + start = start.plus({ days: 1 }) date = date.add(1, 'd') } prev.stop = start } - const stop = start.add(30, 'm') + const stop = start.plus({ minutes: 30 }) programs.push({ title: parseTitle($item), start, @@ -78,7 +71,7 @@ function parseStart($item, date) { if (!time) return null const dateString = `${date.format('MM/DD/YYYY')} ${time}` - return dayjs.tz(dateString, 'MM/DD/YYYY HH.mm', 'Europe/Sofia') + return DateTime.fromFormat(dateString, 'MM/dd/yyyy HH.mm', { zone: 'Europe/Sofia' }).toUTC() } function parseTitle($item) { From ba5c3e83715b6561e0bb9d8203fedc9ffd94d6f5 Mon Sep 17 00:00:00 2001 From: freearhey Date: Thu, 8 Jun 2023 22:44:28 +0300 Subject: [PATCH 3/3] Update tv.dir.bg.channels.xml --- sites/tv.dir.bg/tv.dir.bg.channels.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/sites/tv.dir.bg/tv.dir.bg.channels.xml b/sites/tv.dir.bg/tv.dir.bg.channels.xml index 56e70563..e3510f8a 100644 --- a/sites/tv.dir.bg/tv.dir.bg.channels.xml +++ b/sites/tv.dir.bg/tv.dir.bg.channels.xml @@ -101,6 +101,5 @@ Mezzo Live HD MTV Hits Trace Sport Stars -