Update delta.nl

This commit is contained in:
Aleksandr Statciuk
2022-02-01 04:50:09 +03:00
parent ce1804943c
commit d3f50fc216
3 changed files with 230 additions and 241 deletions

View File

@@ -1,7 +1,7 @@
// node ./scripts/channels.js --config=./sites/delta.nl/delta.nl.config.js --output=./sites/delta.nl/delta.nl_nl.channels.xml
// npx epg-grabber --config=sites/delta.nl/delta.nl.config.js --channels=sites/delta.nl/delta.nl_nl.channels.xml --output=.gh-pages/guides/nl/delta.nl.epg.xml --days=2
const { parser, url, request, logo } = require('./delta.nl.config.js')
const { parser, url, request } = require('./delta.nl.config.js')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -11,8 +11,7 @@ dayjs.extend(utc)
const date = dayjs.utc('2021-11-12', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: '1',
xmltv_id: 'NPO1.nl',
logo: 'https://tv.delta.nl/assets/graphics/thumbnails/channel/delta/npo1.svg'
xmltv_id: 'NPO1.nl'
}
it('can generate valid url', () => {
@@ -21,12 +20,6 @@ it('can generate valid url', () => {
)
})
it('can get logo url', () => {
expect(logo({ channel })).toBe(
'https://tv.delta.nl/assets/graphics/thumbnails/channel/delta/npo1.svg'
)
})
it('can parse response', () => {
const content = `{"1":[{"ID":"P~945cb98e-3d19-11ec-8456-953363d7a344","seriesID":"S~d37c4626-b691-11ea-ba69-255835135f02","channelID":"1","start":1636674960,"end":1636676520,"catchupAvailableUntil":1637279760,"title":"NOS Journaal","images":{"thumbnail":{"url":"https://cdn.gvidi.tv/img/booxmedia/e19c/static/NOS%20Journaal5.jpg"}},"additionalInformation":{"metadataID":"M~944f3c6e-3d19-11ec-9faf-2735f2e98d2a","externalMetadataID":"E~TV01-2026117420668"},"parentalGuidance":{"kijkwijzer":["AL"]},"restrictions":{"startoverDisabled":false,"catchupDisabled":false,"recordingDisabled":false},"isFiller":false}]}`
const result = parser({ date, channel, content })