mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-12 18:10:07 -04:00
Update maxtv.hrvatskitelekom.hr.config.js
This commit is contained in:
parent
4cbbbdfc69
commit
59c9e2a425
1 changed files with 30 additions and 24 deletions
|
@ -7,37 +7,43 @@ module.exports = {
|
||||||
data: function ({ channel, date }) {
|
data: function ({ channel, date }) {
|
||||||
return {
|
return {
|
||||||
channelList: [channel.site_id],
|
channelList: [channel.site_id],
|
||||||
startDate: date.startOf('d').unix(),
|
startDate: date.unix(),
|
||||||
endDate: date.endOf('d').unix()
|
endDate: date.add(1, 'd').unix()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: function ({ date, channel }) {
|
url: 'https://player.maxtvtogo.tportal.hr:8082/OTT4Proxy/proxy/epg/shows',
|
||||||
return `https://player.maxtvtogo.tportal.hr:8082/OTT4Proxy/proxy/epg/shows`
|
logo: function ({ content, channel }) {
|
||||||
},
|
const data = parseContent(content, channel)
|
||||||
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
|
return data ? data.logo : null
|
||||||
|
},
|
||||||
|
parser: function ({ content, channel }) {
|
||||||
|
const programs = []
|
||||||
|
const items = parseItems(content, channel)
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
if (item.title && item.startTime && item.endTime) {
|
if (item.showId === -1) return
|
||||||
const start = dayjs.unix(item.startTime)
|
|
||||||
const stop = dayjs.unix(item.endTime)
|
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
category: item.category,
|
category: item.category,
|
||||||
start: start.toString(),
|
start: dayjs.unix(item.startTime),
|
||||||
stop: stop.toString()
|
stop: dayjs.unix(item.endTime)
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return programs
|
return programs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseContent(content, channel) {
|
||||||
|
const json = JSON.parse(content)
|
||||||
|
if (!Array.isArray(json.data)) return null
|
||||||
|
|
||||||
|
return json.data.find(i => i.channelId == channel.site_id)
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseItems(content, channel) {
|
||||||
|
const data = parseContent(content, channel)
|
||||||
|
|
||||||
|
return data && Array.isArray(data.shows) ? data.shows : []
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue