Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions sites/ziggogo.tv/ziggogo.tv.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ module.exports = {
subTitle: event.episodeName,
description: event.longDescription ? event.longDescription : event.shortDescription,
category: event.genres,
season: event.seasonNumber,
episode: event.episodeNumber,
season: parsePlausibleNumber(event.seasonNumber, 1000),
episode: parsePlausibleNumber(event.episodeNumber, 100000),
country: event.countryOfOrigin,
actor: event.actors,
director: event.directors,
Expand Down Expand Up @@ -115,6 +115,13 @@ module.exports = {
}
}

function parsePlausibleNumber(value, max) {
// events without real season/episode data carry internal ids in these fields
// (e.g. seasonNumber 93850000, episodeNumber 513104549); the ziggogo.tv
// frontend hides such values, so drop anything outside a plausible range
return value > 0 && value < max ? value : null
}

function segmentUrl(date, segment = 0) {
return `https://staticqbr-prod-nl.gnp.cloud.ziggogo.tv/eng/web/epg-service-lite/nl/en/events/segments/${date.format(
'YYYYMMDD'
Expand Down
6 changes: 4 additions & 2 deletions sites/ziggogo.tv/ziggogo.tv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ it('can parse response', async () => {
description:
'Homeshoppingprogramma waarin de kijker via de telefoon allerlei producten kan aanschaffen.',
category: ["Consumentenprogramma's", 'Shoppen'],
season: 78610000,
episode: 492767862
// The source sends internal ids here rather than real numbering
// (season 78610000, episode 492767862), so they are dropped.
season: null,
episode: null
})
expect(result[19]).toMatchObject({
start: '2026-05-30T22:44:00.000Z',
Expand Down
Loading