mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
[ziggo] new endpoints
This commit is contained in:
parent
af932a972c
commit
28e00b209a
1 changed files with 22 additions and 11 deletions
|
@ -52,7 +52,7 @@ module.exports = {
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
const detail = await loadProgramDetails(item, channel)
|
const detail = await loadProgramDetails(item)
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
description: detail.longDescription,
|
description: detail.longDescription,
|
||||||
|
@ -70,7 +70,7 @@ module.exports = {
|
||||||
async channels() {
|
async channels() {
|
||||||
const data = await axios
|
const data = await axios
|
||||||
.get(
|
.get(
|
||||||
'https://prod.spark.ziggogo.tv/eng/web/linear-service/v2/channels?cityId=65535&language=en&productClass=Orion-DASH'
|
'https://spark-prod-nl.gnp.cloud.ziggogo.tv/eng/web/linear-service/v2/channels?cityId=65535&language=en&productClass=Orion-DASH'
|
||||||
)
|
)
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.log)
|
.catch(console.log)
|
||||||
|
@ -85,15 +85,26 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadProgramDetails(item, channel) {
|
async function loadProgramDetails(event) {
|
||||||
if (!item.id) return {}
|
if (!event || !event.id) {
|
||||||
const url = `https://prod.spark.ziggogo.tv/eng/web/linear-service/v2/replayEvent/${item.id}?returnLinearContent=true&language=en`
|
console.log("Invalid event object:", event)
|
||||||
const data = await axios
|
return {}
|
||||||
.get(url)
|
}
|
||||||
.then(r => r.data)
|
|
||||||
.catch(console.log)
|
try {
|
||||||
|
const response = await fetch(`https://spark-prod-nl.gnp.cloud.ziggogo.tv/eng/web/linear-service/v2/replayEvent/${event.id}?returnLinearContent=true&language=nl`)
|
||||||
return data || {}
|
const data = await response.json()
|
||||||
|
|
||||||
|
if (data && typeof data === 'object' && Object.keys(data).length > 0) {
|
||||||
|
return data
|
||||||
|
} else {
|
||||||
|
console.log("No data in response")
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error fetching data:", error)
|
||||||
|
return {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStart(item) {
|
function parseStart(item) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue