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
-
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) {
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')