Merge pull request #2070 from iptv-org/fix-turksatkablo.com.tr

Fix turksatkablo.com.tr
This commit is contained in:
Ismaël Moret 2023-06-06 12:31:57 +02:00 committed by GitHub
commit 53e4e2174d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 17 deletions

View file

@ -63,7 +63,6 @@
<channel lang="tr" xmltv_id="FastFunBox.nl" site_id="1799">Fast &amp; FunBox HD</channel> <channel lang="tr" xmltv_id="FastFunBox.nl" site_id="1799">Fast &amp; FunBox HD</channel>
<channel lang="tr" xmltv_id="FBTV.tr" site_id="47">FB TV</channel> <channel lang="tr" xmltv_id="FBTV.tr" site_id="47">FB TV</channel>
<channel lang="tr" xmltv_id="FightBox.nl" site_id="438">FightBox HD</channel> <channel lang="tr" xmltv_id="FightBox.nl" site_id="438">FightBox HD</channel>
<!-- <channel lang="tr" xmltv_id="FilmBoxArthouseAfricaTurkeyMiddleEast.us" site_id="1798">FilmBox Arthouse Africa &amp; Turkey &amp; Middle East</channel> -->
<channel lang="tr" xmltv_id="FilmBoxTurkey.tr" site_id="1800">FilmBox Türkiye</channel> <channel lang="tr" xmltv_id="FilmBoxTurkey.tr" site_id="1800">FilmBox Türkiye</channel>
<channel lang="tr" xmltv_id="FlashTV.tr" site_id="3718">Flash TV</channel> <channel lang="tr" xmltv_id="FlashTV.tr" site_id="3718">Flash TV</channel>
<channel lang="tr" xmltv_id="FoxCrimeTurkey.tr" site_id="554">Fox Crime Türkiye</channel> <channel lang="tr" xmltv_id="FoxCrimeTurkey.tr" site_id="554">Fox Crime Türkiye</channel>

View file

@ -1,14 +1,6 @@
const dayjs = require('dayjs') const { DateTime } = require('luxon')
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)
module.exports = { module.exports = {
skip: true, // Error: Connection timeout
site: 'turksatkablo.com.tr', site: 'turksatkablo.com.tr',
days: 2, days: 2,
url: function ({ date }) { url: function ({ date }) {
@ -23,13 +15,13 @@ module.exports = {
items.forEach(item => { items.forEach(item => {
const prev = programs[programs.length - 1] const prev = programs[programs.length - 1]
let start = parseStart(item, date) let start = parseStart(item, date)
if (prev && start.isBefore(prev.start)) { if (prev && start < prev.start) {
start = start.add(1, 'd') start = start.plus({ days: 1 })
date = date.add(1, 'd') date = date.add(1, 'd')
} }
let stop = parseStop(item, date) let stop = parseStop(item, date)
if (prev && stop.isBefore(start)) { if (prev && stop < start) {
stop = stop.add(1, 'd') stop = stop.plus({ days: 1 })
date = date.add(1, 'd') date = date.add(1, 'd')
} }
programs.push({ programs.push({
@ -46,13 +38,13 @@ module.exports = {
function parseStart(item, date) { function parseStart(item, date) {
const time = `${date.format('YYYY-MM-DD')} ${item.c}` const time = `${date.format('YYYY-MM-DD')} ${item.c}`
return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'Europe/Istanbul') return DateTime.fromFormat(time, 'yyyy-MM-dd HH:mm', { zone: 'Europe/Istanbul' }).toUTC()
} }
function parseStop(item, date) { function parseStop(item, date) {
const time = `${date.format('YYYY-MM-DD')} ${item.d}` const time = `${date.format('YYYY-MM-DD')} ${item.d}`
return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'Europe/Istanbul') return DateTime.fromFormat(time, 'yyyy-MM-dd HH:mm', { zone: 'Europe/Istanbul' }).toUTC()
} }
function parseItems(content, channel) { function parseItems(content, channel) {

View file

@ -1,4 +1,4 @@
// npx epg-grabber --config=sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js --channels=sites/turksatkablo.com.tr/turksatkablo.com.tr.channels.xml --output=guide.xml --days=2 // npx epg-grabber --config=sites/turksatkablo.com.tr/turksatkablo.com.tr.config.js --channels=sites/turksatkablo.com.tr/turksatkablo.com.tr.channels.xml --output=guide.xml
const { parser, url } = require('./turksatkablo.com.tr.config.js') const { parser, url } = require('./turksatkablo.com.tr.config.js')
const dayjs = require('dayjs') const dayjs = require('dayjs')