Update mi.tv.config.js

This commit is contained in:
Aleksandr Statciuk 2021-09-24 15:11:09 +03:00
parent 9e928c1b87
commit 46bfada1e9

View file

@ -9,15 +9,16 @@ dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(customParseFormat)
let PM = false
module.exports = {
lang: 'pt',
days: 3,
site: 'mi.tv',
channels: 'mi.tv.channels.xml',
output: '.gh-pages/guides/mi.tv.guide.xml',
url({ date, channel }) {
const [country, id] = channel.site_id.split('#')
return `https://mi.tv/${country}/async/channel/${id}/${date.format('YYYY-MM-DD')}/180`
return `https://mi.tv/${country}/async/channel/${id}/${date.format('YYYY-MM-DD')}/-180`
},
logo({ content }) {
const dom = new JSDOM(content)
@ -25,9 +26,9 @@ module.exports = {
return img ? img.src : null
},
parser({ content, date }) {
let PM = false
const programs = []
const items = parseItems(content)
items.forEach(item => {
const title = parseTitle(item)
let start = parseStart(item, date)
@ -51,7 +52,7 @@ module.exports = {
}
function parseStop(item, date) {
return date.endOf('d').add(6, 'h')
return date.tz('America/Sao_Paulo').add(1, 'h')
}
function parseStart(item, date) {