mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update delta.nl.config.js
This commit is contained in:
@@ -8,17 +8,19 @@ module.exports = {
|
|||||||
.add(1, 'd')
|
.add(1, 'd')
|
||||||
.unix()}&includeDetails=true&channels=${channel.site_id}`
|
.unix()}&includeDetails=true&channels=${channel.site_id}`
|
||||||
},
|
},
|
||||||
parser: function ({ content, channel }) {
|
async parser({ content, channel }) {
|
||||||
let programs = []
|
let programs = []
|
||||||
const items = parseItems(content, channel)
|
const items = parseItems(content, channel)
|
||||||
items.forEach(item => {
|
for (let item of items) {
|
||||||
|
const details = await loadProgramDetails(item)
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
icon: item.images.thumbnail.url,
|
icon: item.images.thumbnail.url,
|
||||||
|
description: details.description,
|
||||||
start: parseStart(item).toJSON(),
|
start: parseStart(item).toJSON(),
|
||||||
stop: parseStop(item).toJSON()
|
stop: parseStop(item).toJSON()
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
return programs
|
return programs
|
||||||
},
|
},
|
||||||
@@ -40,6 +42,17 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loadProgramDetails(item) {
|
||||||
|
if (!item.ID) return {}
|
||||||
|
const url = `https://clientapi.tv.delta.nl/guide/4/details/${item.ID}?X-Response-Version=4.5`
|
||||||
|
const data = await axios
|
||||||
|
.get(url)
|
||||||
|
.then(r => r.data)
|
||||||
|
.catch(console.log)
|
||||||
|
|
||||||
|
return data || {}
|
||||||
|
}
|
||||||
|
|
||||||
function parseStart(item) {
|
function parseStart(item) {
|
||||||
return dayjs.unix(item.start)
|
return dayjs.unix(item.start)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user