Update znbc.co.zm

This commit is contained in:
Aleksandr Statciuk 2022-02-01 06:00:23 +03:00
parent edf4bc12e4
commit aaf0f76b6b
2 changed files with 1 additions and 13 deletions

View file

@ -14,14 +14,6 @@ module.exports = {
url({ channel }) { url({ channel }) {
return `https://www.znbc.co.zm/${channel.site_id}/` return `https://www.znbc.co.zm/${channel.site_id}/`
}, },
logo({ content }) {
const $ = cheerio.load(content)
const imgSrc = $(
'.elementor-tab-content > table > tbody > tr:nth-child(1) > td span > img'
).data('src')
return imgSrc || null
},
parser({ content, date }) { parser({ content, date }) {
const programs = [] const programs = []
const items = parseItems(content, date) const items = parseItems(content, date)

View file

@ -1,6 +1,6 @@
// npx epg-grabber --config=sites/znbc.co.zm/znbc.co.zm.config.js --channels=sites/znbc.co.zm/znbc.co.zm_zm.channels.xml --output=.gh-pages/guides/zm/znbc.co.zm.epg.xml --days=2 // npx epg-grabber --config=sites/znbc.co.zm/znbc.co.zm.config.js --channels=sites/znbc.co.zm/znbc.co.zm_zm.channels.xml --output=.gh-pages/guides/zm/znbc.co.zm.epg.xml --days=2
const { parser, url, logo } = require('./znbc.co.zm.config.js') const { parser, url } = require('./znbc.co.zm.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,10 +18,6 @@ it('can generate valid url', () => {
expect(url({ channel })).toBe('https://www.znbc.co.zm/tv1/') expect(url({ channel })).toBe('https://www.znbc.co.zm/tv1/')
}) })
it('can generate valid logo url', () => {
expect(logo({ content })).toBe('https://www.znbc.co.zm/wp-content/uploads/2019/04/TV2-Logo.jpg')
})
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()