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