mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 17:40:07 -04:00
Update telenettv.be.config.js
This commit is contained in:
parent
e9c8f9c286
commit
3f50fb137a
1 changed files with 33 additions and 33 deletions
|
@ -5,6 +5,7 @@ const API_ENDPOINT = `https://obo-prod.oesp.telenettv.be/oesp/v4/BE/eng/web`
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'telenettv.be',
|
site: 'telenettv.be',
|
||||||
|
ignore: true, // INFO: Request failed with status code 404 (Not Found)
|
||||||
url: function ({ date }) {
|
url: function ({ date }) {
|
||||||
return `${API_ENDPOINT}/programschedules/${date.format('YYYYMMDD')}/1`
|
return `${API_ENDPOINT}/programschedules/${date.format('YYYYMMDD')}/1`
|
||||||
},
|
},
|
||||||
|
@ -29,16 +30,16 @@ module.exports = {
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
// items.forEach(item => {
|
// items.forEach(item => {
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
const detail = await loadProgramDetails(item)
|
const detail = await loadProgramDetails(item)
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.t,
|
title: item.t,
|
||||||
description: parseDescription(detail),
|
description: parseDescription(detail),
|
||||||
category: parseCategory(detail),
|
category: parseCategory(detail),
|
||||||
season: parseSeason(detail),
|
season: parseSeason(detail),
|
||||||
episode: parseEpisode(detail),
|
episode: parseEpisode(detail),
|
||||||
start: parseStart(item),
|
start: parseStart(item),
|
||||||
stop: parseStop(item)
|
stop: parseStop(item)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//)
|
//)
|
||||||
|
|
||||||
|
@ -61,14 +62,14 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadProgramDetails(item) {
|
async function loadProgramDetails(item) {
|
||||||
if (!item.i) return {}
|
if (!item.i) return {}
|
||||||
const url = `${API_ENDPOINT}/listings/${item.i}`
|
const url = `${API_ENDPOINT}/listings/${item.i}`
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(url)
|
.get(url)
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.log)
|
.catch(console.log)
|
||||||
return data || {}
|
return data || {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStart(item) {
|
function parseStart(item) {
|
||||||
return dayjs(item.s)
|
return dayjs(item.s)
|
||||||
|
@ -86,23 +87,22 @@ function parseItems(content, channel) {
|
||||||
return entity ? entity.l : []
|
return entity ? entity.l : []
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseDescription(detail){
|
function parseDescription(detail) {
|
||||||
return detail.program.longDescription || null
|
return detail.program.longDescription || null
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCategory(detail) {
|
function parseCategory(detail) {
|
||||||
let categories = []
|
let categories = []
|
||||||
detail.program.categories.forEach(category => {
|
detail.program.categories.forEach(category => {
|
||||||
categories.push(category.title)
|
categories.push(category.title)
|
||||||
});
|
})
|
||||||
return categories
|
return categories
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseSeason(detail) {
|
function parseSeason(detail) {
|
||||||
return detail.program.seriesNumber || null
|
return detail.program.seriesNumber || null
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseEpisode(detail) {
|
|
||||||
return detail.program.seriesEpisodeNumber || null
|
|
||||||
}
|
|
||||||
|
|
||||||
|
function parseEpisode(detail) {
|
||||||
|
return detail.program.seriesEpisodeNumber || null
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue