mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Delete canalplus-reunion.com
This commit is contained in:
parent
5cb87f28b5
commit
9474e6fb47
3 changed files with 0 additions and 353 deletions
|
@ -1,121 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<channels>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="13emeRue.fr" site_id="60001">13ème Rue</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="6ter.fr" site_id="60624">6ter</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Action.fr" site_id="60004">Action</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="AntenneReunion.fr" site_id="60005">Antenne Réunion TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="APlus.fr" site_id="60416">A+</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ARTE.fr" site_id="60007">ARTE Français</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Automotolachaine.fr" site_id="60565">Automoto la chaîne</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="BBCNewsAfrica.uk" site_id="60008">BBC World News Africa</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="beINSports1.fr" site_id="60115">BeIn Sports 1 France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="beINSports2.fr" site_id="60243">BeIn Sports 2 France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="beINSports3.fr" site_id="60347">BeIn Sports 3 France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="C8.fr" site_id="60120">C8</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusCinemaReunion.fr" site_id="60014">Canal + Cinéma Réunion</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusDecale.fr" site_id="60709">Canal + Décalé</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusKids.fr" site_id="60401">Canal + Kids</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusReunion.fr" site_id="60020">Canal + Réunion</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusSeriesReunion.fr" site_id="60312">Canal + Séries Réunion</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CanalPlusSportReunion.fr" site_id="60022">Canal + Sport Réunion</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CGTNFrench.cn" site_id="60309">CGTN Français</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusClassic.fr" site_id="60328">Cine + Classic</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusClub.fr" site_id="60024">Cine + Club</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusEmotion.fr" site_id="60025">Cine + Émotion</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusFamiz.fr" site_id="60026">Cine + Famiz</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusFrisson.fr" site_id="60027">Cine + Frisson</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CinePlusPremier.fr" site_id="60028">Cine + Premier</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CNews.fr" site_id="60048">C News</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ColmaxTV.fr" site_id="60564">Colmax TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Colors.in" site_id="60218">Colors</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ComediePlus.fr" site_id="60033">Comédie +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="CStar.fr" site_id="60217">C Star</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="DiscoveryChannel.fr" site_id="60248">Discovery Channel France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="DiscoveryScience.fr" site_id="60249">Discovery Science France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="DisneyChannel.fr" site_id="60035">Disney Channel France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="DisneyJunior.fr" site_id="60075">Disney Junior France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="DorcelTVAfrica.nl" site_id="60154">Dorcel TV Africa</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="E.fr" site_id="60036">E! France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="EnglishClubTV.uk" site_id="60374">English Club TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Equidia.fr" site_id="60037">Equidia</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Eurosport1.fr" site_id="60041">Eurosport 1 France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Eurosport2.fr" site_id="60042">Eurosport 2 France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="France2.fr" site_id="60188">France 2</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="France24French.fr" site_id="60114">France 24 Français</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="France3.fr" site_id="60045">France 3</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="France4.fr" site_id="60196">France 4</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="France5.fr" site_id="60046">France 5</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Franceinfo.fr" site_id="60704">Franceinfo:</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="GameOne.fr" site_id="60136">Game One</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="GolfPlus.fr" site_id="60414">Golf +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Gulli.fr" site_id="60146">Gulli</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="HistoireTV.fr" site_id="60158">Histoire TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="InfosportPlus.fr" site_id="60050">InfoSport +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="IqraaAfricaEurope.sa" site_id="60279">Iqraa Africa & Europe</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="KanalAustralTV.re" site_id="60153">Kanal Austral TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="KoloTV.mg" site_id="60331">Kolo TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="KTO.fr" site_id="60278">KTO</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="KweziTV.yt" site_id="60968">Kwezi TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="LCI.fr" site_id="60054">LCI</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="LCP.fr" site_id="60055">LCP Assemblée Nationale</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="LEquipe.fr" site_id="60056">L'Équipe</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Ludikids.fr" site_id="60931">Ludikids</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="M6.fr" site_id="60057">M6</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Mayotte1ere.yt" site_id="60206">Mayotte 1ère</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="MBS.mg" site_id="60683">MBS</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Mezzo.fr" site_id="60063">Mezzo</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="MTV.fr" site_id="60065">MTV France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="MTVHits.fr" site_id="60147">MTV Hits France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="MTV.in" site_id="60342">MTV India</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NationalGeographic.fr" site_id="60145">National Geographic France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NationalGeographicWild.fr" site_id="60223">National Geographic Wild France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Nickelodeon.fr" site_id="60224">Nickelodeon France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NickelodeonJunior.fr" site_id="60941">Nickelodeon Junior France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NollywoodTV.fr" site_id="60418">Nollywood TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Novegasy.mg" site_id="60799">Novegasy</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NovelasTV.fr" site_id="60547">Novelas TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="NRJ12.fr" site_id="60216">NRJ 12</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="OCSChoc.fr" site_id="60318">OCS choc</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="OCSCity.fr" site_id="60317">OCS City</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="OCSGeants.fr" site_id="60319">OCS geants</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="OCSMax.fr" site_id="60316">OCS max</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ORTCTV.km" site_id="60195">ORTC TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ParamountChannel.fr" site_id="60303">Paramount Channel France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ParisPremiere.fr" site_id="60070">Paris Première</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="PenthouseBlack.us" site_id="60280">Penthouse Black</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="PiwiPlus.fr" site_id="60128">Piwi +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="PlanetePlus.fr" site_id="60072">Planète +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="PlanetePlusAventure.fr" site_id="60073">Planète + A&E</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="PlanetePlusCrime.fr" site_id="60142">Planète + CI</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Reunion1ere.fr" site_id="60088">Réunion 1ère</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="RFMTV.fr" site_id="60061">RFM TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="RTA.mg" site_id="60726">RTA</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="RTL9.lu" site_id="60077">RTL 9</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Seasons.fr" site_id="60079">Seasons</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="SerieClub.fr" site_id="60080">Série Club</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Syfy.fr" site_id="60078">Syfy France</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TeleKreol.re" site_id="60203">Télé Kréol</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TeletoonPlus.fr" site_id="60148">TéléToon +</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Teva.fr" site_id="60094">Téva</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TF1.fr" site_id="60095">TF 1</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TF1SeriesFilms.fr" site_id="60613">TF 1 Séries Films</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TFX.fr" site_id="60067">TFX</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TMC.fr" site_id="60098">TMC</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TraceCaribbean.fr" site_id="60155">Trace Caribbean</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TraceUrban.fr" site_id="60102">Trace Urban Afrique</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TraceVanillaIslands.fr" site_id="60800">Trace Vanilla Islands</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Trek.fr" site_id="60566">Trek</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TV5MondeAfrica.fr" site_id="60105">TV5Monde Afrique</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TVBreizh.fr" site_id="60104">TV Breizh</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TVMalagasy.mg" site_id="60194">TV Malagasy</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TVPlusMadagascar.mg" site_id="60330">TV Plus Madagascar</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="TVRecordMadagascar.mg" site_id="60413">TV Record Madagascar</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="UshuaiaTV.fr" site_id="60138">Ushuaïa TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="VixenTV.ca" site_id="60934">Vixen</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="W9.fr" site_id="60140">W9</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="WataaaTV.fr" site_id="60614">Wataaa TV</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="XXL.fr" site_id="60110">XXL</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ZeeCinemaAfrica.in" site_id="60117">Zee Cinema Africa</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="ZeeTVAfrica.za" site_id="60119">Zee TV Africa</channel>
|
|
||||||
<channel site="canalplus-reunion.com" lang="fr" xmltv_id="Zing.uk" site_id="60118">Zing UK</channel>
|
|
||||||
</channels>
|
|
|
@ -1,72 +0,0 @@
|
||||||
const axios = require('axios')
|
|
||||||
const dayjs = require('dayjs')
|
|
||||||
const utc = require('dayjs/plugin/utc')
|
|
||||||
|
|
||||||
dayjs.extend(utc)
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
site: 'canalplus-reunion.com',
|
|
||||||
days: 2,
|
|
||||||
url: function ({ channel, date }) {
|
|
||||||
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
|
||||||
|
|
||||||
return `https://service.canal-overseas.com/ott-frontend/vector/63001/channel/${channel.site_id}/events?filter.day=${diff}`
|
|
||||||
},
|
|
||||||
async parser({ content }) {
|
|
||||||
let programs = []
|
|
||||||
const items = parseItems(content)
|
|
||||||
for (let item of items) {
|
|
||||||
if (item.title === 'Fin des programmes') return
|
|
||||||
const detail = await loadProgramDetails(item)
|
|
||||||
programs.push({
|
|
||||||
title: item.title,
|
|
||||||
description: parseDescription(detail),
|
|
||||||
category: parseCategory(detail),
|
|
||||||
icon: parseIcon(item),
|
|
||||||
start: parseStart(item),
|
|
||||||
stop: parseStop(item)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return programs
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadProgramDetails(item) {
|
|
||||||
if (!item.onClick.URLPage) return {}
|
|
||||||
const url = item.onClick.URLPage
|
|
||||||
const data = await axios
|
|
||||||
.get(url)
|
|
||||||
.then(r => r.data)
|
|
||||||
.catch(console.log)
|
|
||||||
return data || {}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseDescription(detail) {
|
|
||||||
return detail.detail.informations.summary || null
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseCategory(detail) {
|
|
||||||
return detail.detail.informations.subGenre || null
|
|
||||||
}
|
|
||||||
function parseIcon(item) {
|
|
||||||
return item.URLImage || item.URLImageDefault
|
|
||||||
}
|
|
||||||
function parseStart(item) {
|
|
||||||
return dayjs.unix(item.startTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseStop(item) {
|
|
||||||
return dayjs.unix(item.endTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseItems(content) {
|
|
||||||
const data = JSON.parse(content)
|
|
||||||
if (!data || !data.timeSlices) return []
|
|
||||||
const items = data.timeSlices.reduce((acc, curr) => {
|
|
||||||
acc = acc.concat(curr.contents)
|
|
||||||
return acc
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return items
|
|
||||||
}
|
|
|
@ -1,160 +0,0 @@
|
||||||
// npm run grab -- --site=canalplus-reunion.com
|
|
||||||
|
|
||||||
const { parser, url } = require('./canalplus-reunion.com.config.js')
|
|
||||||
const axios = require('axios')
|
|
||||||
const dayjs = require('dayjs')
|
|
||||||
const utc = require('dayjs/plugin/utc')
|
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
|
||||||
dayjs.extend(customParseFormat)
|
|
||||||
dayjs.extend(utc)
|
|
||||||
|
|
||||||
jest.mock('axios')
|
|
||||||
|
|
||||||
const channel = {
|
|
||||||
site_id: '60243',
|
|
||||||
xmltv_id: 'beINSports2France.fr'
|
|
||||||
}
|
|
||||||
|
|
||||||
it('can generate valid url for today', () => {
|
|
||||||
const date = dayjs.utc().startOf('d')
|
|
||||||
expect(url({ channel, date })).toBe(
|
|
||||||
'https://service.canal-overseas.com/ott-frontend/vector/63001/channel/60243/events?filter.day=0'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can generate valid url for tomorrow', () => {
|
|
||||||
const date = dayjs.utc().startOf('d').add(1, 'd')
|
|
||||||
expect(url({ channel, date })).toBe(
|
|
||||||
'https://service.canal-overseas.com/ott-frontend/vector/63001/channel/60243/events?filter.day=1'
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can parse response', done => {
|
|
||||||
const content = `{
|
|
||||||
"timeSlices": [
|
|
||||||
{
|
|
||||||
"contents": [
|
|
||||||
{
|
|
||||||
"title": "Almeria / Real Madrid",
|
|
||||||
"subtitle": "Football",
|
|
||||||
"thirdTitle": "BEIN SPORTS 2 HD",
|
|
||||||
"startTime": 1660780800,
|
|
||||||
"endTime": 1660788000,
|
|
||||||
"onClick": {
|
|
||||||
"displayTemplate": "miniDetail",
|
|
||||||
"displayName": "Almeria / Real Madrid",
|
|
||||||
"URLPage": "https://service.canal-overseas.com/ott-frontend/vector/63001/event/140382363",
|
|
||||||
"URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/63001/program/224523053/recommendations"
|
|
||||||
},
|
|
||||||
"programID": 224523053,
|
|
||||||
"diffusionID": "140382363",
|
|
||||||
"URLImageDefault": "https://service.canal-overseas.com/image-api/v1/image/a6b640e16608ffa3d862e2bd8a4b3e4c",
|
|
||||||
"URLImage": "https://service.canal-overseas.com/image-api/v1/image/47000149dabce60d1769589c766aad20"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"timeSlice": "4"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}`
|
|
||||||
axios.get.mockImplementation(url => {
|
|
||||||
if (url === 'https://service.canal-overseas.com/ott-frontend/vector/63001/event/140382363') {
|
|
||||||
return Promise.resolve({
|
|
||||||
data: JSON.parse(`{
|
|
||||||
"currentPage": {
|
|
||||||
"displayName": "Almeria / Real Madrid",
|
|
||||||
"displayTemplate": "detailPage",
|
|
||||||
"URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/63001/program/224523053/recommendations"
|
|
||||||
},
|
|
||||||
"detail": {
|
|
||||||
"informations": {
|
|
||||||
"programmeType": "EPG",
|
|
||||||
"isInOffer": false,
|
|
||||||
"isInOfferOnDevice": false,
|
|
||||||
"isInOfferForD2G": false,
|
|
||||||
"availableInVoDOnDevice": false,
|
|
||||||
"availableInVoDOnG5": false,
|
|
||||||
"availableInD2GOnDevice": false,
|
|
||||||
"availableInLiveOnDevice": false,
|
|
||||||
"rediffusions": true,
|
|
||||||
"canBeRecorded": false,
|
|
||||||
"channelName": "BEIN SPORTS 2 HD",
|
|
||||||
"startTime": 1660780800,
|
|
||||||
"endTime": 1660788000,
|
|
||||||
"title": "Almeria / Real Madrid",
|
|
||||||
"subtitle": "Football",
|
|
||||||
"thirdTitle": "BEIN SPORTS 2 HD",
|
|
||||||
"genre": "Sport",
|
|
||||||
"subGenre": "Football",
|
|
||||||
"editorialTitle": "Sport, Espagne, 2h00",
|
|
||||||
"audioLanguage": "VF",
|
|
||||||
"summary": "Diffusion d'un match de LaLiga Santander, championnat d'Espagne de football, la plus haute compétition de football d'Espagne. Cette compétition professionnelle, placée sous la supervision de la Fédération espagnole de football, a été fondée en 1928 et s'appelle Primera Division jusqu'en 2008. Elle se nomme ensuite Liga BBVA jusqu'en 2016 puis LaLiga Santander depuis cette date.",
|
|
||||||
"summaryMedium": "Diffusion d'un match de LaLiga Santander, championnat d'Espagne de football, la plus haute compétition de football d'Espagne. Cette compétition professionnelle, placée sous la supervision de la Fédération espagnole de football, a été fondée en 1928 et s'appelle Primera Division jusqu'en 2008. Elle se nomme ensuite Liga BBVA jusqu'en 2016 puis LaLiga Santander depuis cette date.",
|
|
||||||
"programID": 224523053,
|
|
||||||
"sharingURL": "https://www.canalplus-reunion.com/grille-tv/event/140382363-almeria-real-madrid.html",
|
|
||||||
"EpgId": 60243,
|
|
||||||
"CSA": 1,
|
|
||||||
"HD": false,
|
|
||||||
"3D": false,
|
|
||||||
"diffusionID": "140382363",
|
|
||||||
"duration": "7200",
|
|
||||||
"URLImageDefault": "https://service.canal-overseas.com/image-api/v1/image/a6b640e16608ffa3d862e2bd8a4b3e4c",
|
|
||||||
"URLImage": "https://service.canal-overseas.com/image-api/v1/image/47000149dabce60d1769589c766aad20",
|
|
||||||
"URLLogo": "https://service.canal-overseas.com/image-api/v1/image/6e2124827406ed41236a8430352d4ed9",
|
|
||||||
"URLLogoBlack": "https://service.canal-overseas.com/image-api/v1/image/6e2124827406ed41236a8430352d4ed9",
|
|
||||||
"URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/63001/program/224523053/recommendations"
|
|
||||||
},
|
|
||||||
"diffusions": [
|
|
||||||
{
|
|
||||||
"diffusionDateUTC": 1660780800,
|
|
||||||
"sharingUrl": "https://www.canalplus-reunion.com/grille-tv/event/140382363-almeria-real-madrid.html",
|
|
||||||
"broadcastId": "140382363",
|
|
||||||
"name": "BEIN SPORTS 2 HD",
|
|
||||||
"epgID": "60243",
|
|
||||||
"ZapNumber": "96",
|
|
||||||
"URLLogo": "https://service.canal-overseas.com/image-api/v1/image/6e2124827406ed41236a8430352d4ed9",
|
|
||||||
"URLLogoBlack": "https://service.canal-overseas.com/image-api/v1/image/6e2124827406ed41236a8430352d4ed9"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}`)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
return Promise.resolve({ data: '' })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
parser({ content })
|
|
||||||
.then(result => {
|
|
||||||
result = result.map(p => {
|
|
||||||
p.start = p.start.toJSON()
|
|
||||||
p.stop = p.stop.toJSON()
|
|
||||||
return p
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(result).toMatchObject([
|
|
||||||
{
|
|
||||||
start: '2022-08-18T00:00:00.000Z',
|
|
||||||
stop: '2022-08-18T02:00:00.000Z',
|
|
||||||
title: 'Almeria / Real Madrid',
|
|
||||||
icon: 'https://service.canal-overseas.com/image-api/v1/image/47000149dabce60d1769589c766aad20',
|
|
||||||
category: 'Football',
|
|
||||||
description:
|
|
||||||
"Diffusion d'un match de LaLiga Santander, championnat d'Espagne de football, la plus haute compétition de football d'Espagne. Cette compétition professionnelle, placée sous la supervision de la Fédération espagnole de football, a été fondée en 1928 et s'appelle Primera Division jusqu'en 2008. Elle se nomme ensuite Liga BBVA jusqu'en 2016 puis LaLiga Santander depuis cette date."
|
|
||||||
}
|
|
||||||
])
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
.catch(done)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('can handle empty guide', done => {
|
|
||||||
parser({
|
|
||||||
content:
|
|
||||||
'{"currentPage":{"displayTemplate":"error","BOName":"Page introuvable"},"title":"Page introuvable","text":"La page que vous demandez est introuvable. Si le problème persiste, vous pouvez contacter l\'assistance de CANAL+/CANALSAT.","code":404}'
|
|
||||||
})
|
|
||||||
.then(result => {
|
|
||||||
expect(result).toMatchObject([])
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
.catch(done)
|
|
||||||
})
|
|
Loading…
Add table
Add a link
Reference in a new issue