Update tvcubana.icrt.cu

This commit is contained in:
Aleksandr Statciuk 2022-02-01 05:46:35 +03:00
parent 7a5a1505f3
commit 4bdb402a54
3 changed files with 12 additions and 22 deletions

View file

@ -10,9 +10,6 @@ module.exports = {
return `https://www.tvcubana.icrt.cu/cartv/${channel.site_id}/${daysOfWeek[date.day()]}.php`
},
logo({ channel }) {
return channel.logo
},
parser: function ({ content }) {
let programs = []
const items = parseItems(content)

View file

@ -1,6 +1,6 @@
// npx epg-grabber --config=sites/tvcubana.icrt.cu/tvcubana.icrt.cu.config.js --channels=sites/tvcubana.icrt.cu/tvcubana.icrt.cu_cu.channels.xml --output=.gh-pages/guides/cu/tvcubana.icrt.cu.epg.xml --days=2
const { parser, url, logo, request } = require('./tvcubana.icrt.cu.config.js')
const { parser, url, request } = require('./tvcubana.icrt.cu.config.js')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@ -10,8 +10,7 @@ dayjs.extend(utc)
const date = dayjs.utc('2021-11-22', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: 'cv',
xmltv_id: 'CubavisionNacional.cu',
logo: 'https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/cubavision.jpg'
xmltv_id: 'CubavisionNacional.cu'
}
const content = `[{"eventId":"6169c2300ad38b0a8d9e3760","title":"CARIBE NOTICIAS","description":"EMISI\\u00d3N DE CIERRE.","eventInitialDate":"2021-11-22T00:00:00","eventEndDate":"2021-11-22T00:00:00","idFromEprog":"5c096ea5bad1b202541503cf","extendedDescription":"","transmission":"Estreno","pid":"","space":"CARIBE NOTICIAS","eventStartTime":{"value":{"ticks":24000000000,"days":0,"hours":0,"milliseconds":0,"minutes":40,"seconds":0,"totalDays":0.027777777777777776,"totalHours":0.6666666666666666,"totalMilliseconds":2400000,"totalMinutes":40,"totalSeconds":2400},"hasValue":true},"eventEndTime":{"value":{"ticks":30000000000,"days":0,"hours":0,"milliseconds":0,"minutes":50,"seconds":0,"totalDays":0.034722222222222224,"totalHours":0.8333333333333334,"totalMilliseconds":3000000,"totalMinutes":50,"totalSeconds":3000},"hasValue":true},"eventDuration":"00:10:00","channelName":"Cubavisi\\u00f3n","eventInitialDateTime":"2021-11-22T00:40:00","eventEndDateTime":"2021-11-22T00:50:00","isEventWithNegativeDuration":false,"isEventWithDurationOver24Hrs":false,"isEventWithTextOverLength":false,"created":"2021-11-22T10:32:27.476824","id":5309687}]`
@ -25,12 +24,6 @@ it('can generate valid url for next day', () => {
)
})
it('can get logo url', () => {
expect(logo({ channel })).toBe(
'https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/cubavision.jpg'
)
})
it('can parse response', () => {
const result = parser({ date, channel, content }).map(p => {
p.start = p.start.toJSON()

View file

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="tvcubana.icrt.cu">
<channels>
<channel lang="es" xmltv_id="CubavisionNacional.cu" site_id="cv" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/cubavision.jpg">Cubavisión Nacional</channel>
<channel lang="es" xmltv_id="TeleRebelde.cu" site_id="tr" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/tr.jpg">Tele Rebelde</channel>
<channel lang="es" xmltv_id="CanalEducativo.cu" site_id="edu" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/ce.jpg">Canal Educativo</channel>
<channel lang="es" xmltv_id="CanalEducativo2.cu" site_id="edu2" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/ce2.jpg">Canal Educativo 2</channel>
<channel lang="es" xmltv_id="CanalMultivision.cu" site_id="mv" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/multivision.jpg">Canal Multivisión</channel>
<channel lang="es" xmltv_id="CanalClave.cu" site_id="clave" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/clave.jpg">Canal Clave</channel>
<channel lang="es" xmltv_id="CanalCaribe.cu" site_id="caribe" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/caribe.jpg">Canal Caribe</channel>
<channel lang="es" xmltv_id="CubavisionInternacional.cu" site_id="cvi" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/cvi.jpg">Cubavisión Internacional</channel>
<channel lang="es" xmltv_id="CanalHabana.cu" site_id="chabana" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/ch.jpg">Canal Habana</channel>
<channel lang="es" xmltv_id="CubavisionPlus.cu" site_id="cvplus" logo="https://www.tvcubana.icrt.cu/images/logos-canales/logo-mascara/cv+.jpg">Cubavisión Plus</channel>
<channel lang="es" xmltv_id="CubavisionNacional.cu" site_id="cv">Cubavisión Nacional</channel>
<channel lang="es" xmltv_id="TeleRebelde.cu" site_id="tr">Tele Rebelde</channel>
<channel lang="es" xmltv_id="CanalEducativo.cu" site_id="edu">Canal Educativo</channel>
<channel lang="es" xmltv_id="CanalEducativo2.cu" site_id="edu2">Canal Educativo 2</channel>
<channel lang="es" xmltv_id="CanalMultivision.cu" site_id="mv">Canal Multivisión</channel>
<channel lang="es" xmltv_id="CanalClave.cu" site_id="clave">Canal Clave</channel>
<channel lang="es" xmltv_id="CanalCaribe.cu" site_id="caribe">Canal Caribe</channel>
<channel lang="es" xmltv_id="CubavisionInternacional.cu" site_id="cvi">Cubavisión Internacional</channel>
<channel lang="es" xmltv_id="CanalHabana.cu" site_id="chabana">Canal Habana</channel>
<channel lang="es" xmltv_id="CubavisionPlus.cu" site_id="cvplus">Cubavisión Plus</channel>
</channels>
</site>