mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update zap.co.ao
This commit is contained in:
parent
e0ef70b70d
commit
edf4bc12e4
2 changed files with 1 additions and 13 deletions
|
@ -12,12 +12,6 @@ module.exports = {
|
||||||
url: function ({ date, channel }) {
|
url: function ({ date, channel }) {
|
||||||
return `https://www.zap.co.ao/_api/channels/${date.format('YYYY-M-D')}/epg.json`
|
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 }) {
|
parser: function ({ content, channel, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const items = parseItems(content, channel)
|
const items = parseItems(content, channel)
|
||||||
|
|
|
@ -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
|
// 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 dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
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')
|
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', () => {
|
it('can parse response', () => {
|
||||||
const result = parser({ content, channel, date }).map(p => {
|
const result = parser({ content, channel, date }).map(p => {
|
||||||
p.start = p.start.toJSON()
|
p.start = p.start.toJSON()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue