mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #616 from RevGear/patch-1
Update movistarplus.es.config.js
This commit is contained in:
commit
d2ca475679
1 changed files with 4 additions and 6 deletions
|
@ -1,10 +1,11 @@
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
|
const utc = require('dayjs/plugin/utc')
|
||||||
var customParseFormat = require('dayjs/plugin/customParseFormat')
|
var customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
dayjs.extend(utc)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'movistarplus.es',
|
site: 'movistarplus.es',
|
||||||
ignore: true, // removes the site from the list until the test is passed
|
|
||||||
url: function ({ date }) {
|
url: function ({ date }) {
|
||||||
return `https://www.movistarplus.es/programacion-tv/${date.format('YYYY-MM-DD')}?v=json`
|
return `https://www.movistarplus.es/programacion-tv/${date.format('YYYY-MM-DD')}?v=json`
|
||||||
},
|
},
|
||||||
|
@ -14,11 +15,8 @@ module.exports = {
|
||||||
if (!items.length) return programs
|
if (!items.length) return programs
|
||||||
let guideDate = date
|
let guideDate = date
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
let startTime = dayjs(
|
let startTime = dayjs.utc(`${guideDate.format('YYYY-MM-DD')} ${item.HORA_INICIO}`,"YYYY-MM-DD HH:mm")
|
||||||
`${guideDate.format('YYYY-MM-DD')} ${item.HORA_INICIO}`,
|
let stopTime = dayjs.utc(`${guideDate.format('YYYY-MM-DD')} ${item.HORA_FIN}`, 'YYYY-MM-DD HH:mm')
|
||||||
'YYYY-MM-DD HH:mm'
|
|
||||||
)
|
|
||||||
let stopTime = dayjs(`${guideDate.format('YYYY-MM-DD')} ${item.HORA_FIN}`, 'YYYY-MM-DD HH:mm')
|
|
||||||
if (stopTime.isBefore(startTime)) {
|
if (stopTime.isBefore(startTime)) {
|
||||||
guideDate = guideDate.add(1, 'd')
|
guideDate = guideDate.add(1, 'd')
|
||||||
stopTime = stopTime.add(1, 'd')
|
stopTime = stopTime.add(1, 'd')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue