mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Merge pull request #2070 from iptv-org/fix-turksatkablo.com.tr
Fix turksatkablo.com.tr
This commit is contained in:
commit
53e4e2174d
3 changed files with 8 additions and 17 deletions
|
@ -63,7 +63,6 @@
|
||||||
<channel lang="tr" xmltv_id="FastFunBox.nl" site_id="1799">Fast & FunBox HD</channel>
|
<channel lang="tr" xmltv_id="FastFunBox.nl" site_id="1799">Fast & 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 & Turkey & 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>
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue