Update zap.co.ao

This commit is contained in:
Aleksandr Statciuk 2022-02-01 05:59:41 +03:00
parent e0ef70b70d
commit edf4bc12e4
2 changed files with 1 additions and 13 deletions

View file

@ -12,12 +12,6 @@ module.exports = {
url: function ({ date, channel }) {
return `https://www.zap.co.ao/_api/channels/${date.format('YYYY-M-D')}/epg.json`
},
logo({ content, channel }) {
const channels = JSON.parse(content)
const data = channels.find(ch => ch.id == channel.site_id)
return data ? data.image_uri : null
},
parser: function ({ content, channel, date }) {
const programs = []
const items = parseItems(content, channel)

View file

@ -1,6 +1,6 @@
// npx epg-grabber --config=sites/zap.co.ao/zap.co.ao.config.js --channels=sites/zap.co.ao/zap.co.ao_ao.channels.xml --output=.gh-pages/guides/ao/zap.co.ao.epg.xml --days=2
const { parser, url, logo } = require('./zap.co.ao.config.js')
const { parser, url } = require('./zap.co.ao.config.js')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@ -18,12 +18,6 @@ it('can generate valid url', () => {
expect(url({ date })).toBe('https://www.zap.co.ao/_api/channels/2021-11-25/epg.json')
})
it('can generate valid logo url', () => {
expect(logo({ content, channel })).toBe(
'https://www.zap.co.ao/media/cache/movie_thumb/uploads/ao/channels/54bd3c6b068ef.png'
)
})
it('can parse response', () => {
const result = parser({ content, channel, date }).map(p => {
p.start = p.start.toJSON()