Update elcinema.com

This commit is contained in:
Aleksandr Statciuk 2022-02-01 05:01:50 +03:00
parent dfff803be7
commit 89d581e1c0
2 changed files with 5 additions and 15 deletions

View file

@ -16,12 +16,6 @@ module.exports = {
return `https://elcinema.com/${lang}tvguide/${channel.site_id}/` return `https://elcinema.com/${lang}tvguide/${channel.site_id}/`
}, },
logo({ content }) {
const $ = cheerio.load(content)
const imgSrc = $('.intro-box > .row > div.columns.large-2 > img').attr('src')
return imgSrc || null
},
parser({ content, channel, date }) { parser({ content, channel, date }) {
const programs = [] const programs = []
const items = parseItems(content, channel, date) const items = parseItems(content, channel, date)
@ -106,7 +100,7 @@ function parseDescription(item) {
function parseItems(content, channel, date) { function parseItems(content, channel, date) {
const $ = cheerio.load(content) const $ = cheerio.load(content)
const dateString = date.locale(channel.lang).format('dddd D MMMM') const dateString = date.locale(channel.lang).format('dddd D MMMM')
const list = $('.dates') const list = $('.dates')
.filter((i, el) => { .filter((i, el) => {

View file

@ -1,7 +1,7 @@
// npx epg-grabber --config=sites/elcinema.com/elcinema.com.config.js --channels=sites/elcinema.com/elcinema.com_eg-en.channels.xml --output=.gh-pages/guides/eg-en/elcinema.com.epg.xml --days=2 // npx epg-grabber --config=sites/elcinema.com/elcinema.com.config.js --channels=sites/elcinema.com/elcinema.com_eg-en.channels.xml --output=.gh-pages/guides/eg-en/elcinema.com.epg.xml --days=2
// npx epg-grabber --config=sites/elcinema.com/elcinema.com.config.js --channels=sites/elcinema.com/elcinema.com_eg-ar.channels.xml --output=.gh-pages/guides/eg-ar/elcinema.com.epg.xml --days=2 // npx epg-grabber --config=sites/elcinema.com/elcinema.com.config.js --channels=sites/elcinema.com/elcinema.com_eg-ar.channels.xml --output=.gh-pages/guides/eg-ar/elcinema.com.epg.xml --days=2
const { parser, url, request, logo } = require('./elcinema.com.config.js') const { parser, url, request } = require('./elcinema.com.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')
@ -26,10 +26,6 @@ it('can generate valid url', () => {
expect(url({ channel: channelEN })).toBe('https://elcinema.com/en/tvguide/1127/') expect(url({ channel: channelEN })).toBe('https://elcinema.com/en/tvguide/1127/')
}) })
it('can get logo url', () => {
expect(logo({ content: contentEN })).toBe('https://media.elcinema.com/tvguide/1127_1.png')
})
it('can parse response (en)', () => { it('can parse response (en)', () => {
expect(parser({ date, channel: channelEN, content: contentEN })).toMatchObject([ expect(parser({ date, channel: channelEN, content: contentEN })).toMatchObject([
{ {