mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Create maxtv.hrvatskitelekom.hr.config.js
This commit is contained in:
parent
8ef0baeccf
commit
da05ed3b7c
1 changed files with 46 additions and 0 deletions
46
sites/maxtv.hrvatskitelekom.hr.config.js
Normal file
46
sites/maxtv.hrvatskitelekom.hr.config.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
const dayjs = require('dayjs')
|
||||
|
||||
module.exports = {
|
||||
lang: 'hr',
|
||||
site: 'maxtv.hrvatskitelekom.hr',
|
||||
channels: 'maxtv.hrvatskitelekom.hr.channels.xml',
|
||||
output: '.gh-pages/guides/maxtv.hrvatskitelekom.hr.guide.xml',
|
||||
request: {
|
||||
method: 'POST',
|
||||
data: function ({ channel, date }) {
|
||||
return {
|
||||
channelList: [channel.site_id],
|
||||
startDate: date.startOf('d').unix(),
|
||||
endDate: date.endOf('d').unix()
|
||||
}
|
||||
}
|
||||
},
|
||||
url: function ({ date, channel }) {
|
||||
return `https://player.maxtvtogo.tportal.hr:8082/OTT4Proxy/proxy/epg/shows`
|
||||
},
|
||||
logo: function ({ content }) {
|
||||
const json = JSON.parse(content)
|
||||
return json.data ? json.data[0].logo : null
|
||||
},
|
||||
parser: function ({ content }) {
|
||||
const programs = []
|
||||
const json = JSON.parse(content)
|
||||
if (!json.data) return programs
|
||||
|
||||
const items = json.data[0].shows
|
||||
items.forEach(item => {
|
||||
if (item.title && item.startTime && item.endTime) {
|
||||
const start = dayjs.unix(item.startTime)
|
||||
const stop = dayjs.unix(item.endTime)
|
||||
programs.push({
|
||||
title: item.title,
|
||||
category: item.category,
|
||||
start: start.toString(),
|
||||
stop: stop.toString()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue