Move sites into a folders

This commit is contained in:
Aleksandr Statciuk
2021-10-15 03:31:13 +03:00
parent b92feaf2b6
commit 6955909ee4
97 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
const dayjs = require('dayjs')
module.exports = {
site: 'maxtv.hrvatskitelekom.hr',
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
}
}