mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
commit
7682981d7e
3 changed files with 9 additions and 14 deletions
|
@ -72,6 +72,5 @@
|
|||
<channel lang="it" xmltv_id="TV8.it" site_id="188">TV8</channel>
|
||||
<channel lang="it" xmltv_id="VH1Italia.it" site_id="219">VH1</channel>
|
||||
<channel lang="it" xmltv_id="WarnerTVItaly.it" site_id="229">Warner TV</channel>
|
||||
<!-- <channel lang="it" xmltv_id="-" site_id="93">Arte HD</channel> -->
|
||||
</channels>
|
||||
</site>
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
const dayjs = require('dayjs')
|
||||
const cheerio = require('cheerio')
|
||||
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: 'tivu.tv',
|
||||
|
@ -17,7 +11,7 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
url({ date }) {
|
||||
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
||||
const diff = date.diff(DateTime.now().toUTC().startOf('day'), 'd')
|
||||
|
||||
return `https://www.tivu.tv/epg_ajax_sat.aspx?d=${diff}`
|
||||
},
|
||||
|
@ -30,13 +24,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,
|
||||
|
@ -58,7 +52,9 @@ function parseStart($item, date) {
|
|||
const [_, __, time] = $item('a').html().split('<br>')
|
||||
if (!time) return null
|
||||
|
||||
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm', 'Europe/Rome')
|
||||
return DateTime.fromFormat(`${date.format('YYYY-MM-DD')} ${time}`, 'yyyy-MM-dd HH:mm', {
|
||||
zone: 'Europe/Rome'
|
||||
}).toUTC()
|
||||
}
|
||||
|
||||
function parseItems(content, channel, date) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// npx epg-grabber --config=sites/tivu.tv/tivu.tv.config.js --channels=sites/tivu.tv/tivu.tv.channels.xml --output=guide.xml --days=2
|
||||
// npx epg-grabber --config=sites/tivu.tv/tivu.tv.config.js --channels=sites/tivu.tv/tivu.tv.channels.xml --output=guide.xml
|
||||
|
||||
const { parser, url, request } = require('./tivu.tv.config.js')
|
||||
const fs = require('fs')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue