From 706cf7ec72d2fd46acf9867ff51ce96652cfef4d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 17 Jan 2025 22:57:00 +0300 Subject: [PATCH 1/5] Fix linter issues --- sites/rikstv.no/readme.md | 42 +++---- sites/rikstv.no/rikstv.no.channels.xml | 166 ++++++++++++------------- sites/rikstv.no/rikstv.no.config.js | 148 +++++++++++----------- sites/rikstv.no/rikstv.no.test.js | 138 ++++++++++---------- 4 files changed, 252 insertions(+), 242 deletions(-) diff --git a/sites/rikstv.no/readme.md b/sites/rikstv.no/readme.md index 31eb0b38..463a3282 100644 --- a/sites/rikstv.no/readme.md +++ b/sites/rikstv.no/readme.md @@ -1,21 +1,21 @@ -# rikstv.no - -https://play.rikstv.no/tv-guide - -### Download the guide - -```sh -npm run grab --- --site=rikstv.no -``` - -### Update channel list - -```sh -npm run channels:parse --- --config=./sites/rikstv.no/rikstv.no.config.js --output=./sites/rikstv.no/rikstv.no.channels.xml -``` - -### Test - -```sh -npm test --- rikstv.no -``` +# rikstv.no + +https://play.rikstv.no/tv-guide + +### Download the guide + +```sh +npm run grab --- --site=rikstv.no +``` + +### Update channel list + +```sh +npm run channels:parse --- --config=./sites/rikstv.no/rikstv.no.config.js --output=./sites/rikstv.no/rikstv.no.channels.xml +``` + +### Test + +```sh +npm test --- rikstv.no +``` diff --git a/sites/rikstv.no/rikstv.no.channels.xml b/sites/rikstv.no/rikstv.no.channels.xml index 96aebc97..8e9e46c9 100644 --- a/sites/rikstv.no/rikstv.no.channels.xml +++ b/sites/rikstv.no/rikstv.no.channels.xml @@ -1,83 +1,83 @@ - - - BBC News - Discovery - TLC - Disney Channel - Eurosport 1 - FEM - Frikanalen - REX - National Geographic - NRK Super/3 - NRK1 - NRK1 Tegnspråk - NRK2 - SVT1 - TV 2 Livsstil - TV 2 Direkte - TV 2 Nyheter - TV 2 Zebra - TV3 - TVNorge - TV3+ - Visjon Norge - VOX - Animal Planet - BBC Nordic - TV6 - History Channel - Eurosport Norge - Nick Jr. - Nickelodeon - TV 2 Danmark - DR2 - DR1 - SVT2 - TV4 - CNN - Discovery Science - Investigation Discovery - Norway Live - V Sport + - V Sport 1 - V Sport 2 - V Sport 3 - Hits - Stars - SF-kanalen - TV 2 Sport 1 - TV 2 Sport 2 - Sky News - CNBC - Deutsche Welle - France 24 - NRK1 Sørlandet - NRK1 Nordland - NRK1 Midtnytt - NRK1 Vestfold og Telemark - NRK1 Vestlandsrevyen - NRK1 Nordnytt - NRK1 Innlandet - MTV00s - TV Nord - Travel Channel - Food Network - Euronews - Auto Motor og Sport TV - Rikstoto Direkte - TV Øst - NRK1 Rogaland - NRK1 Møre og Romsdal - NRK1 Lydtekst - NRK2 Lydtekst - NRK3 Super Lydtekst - Heim TV - V sport golf - NRK1 Underteksting - NRK2 Underteksting - Naturkanal1 - V Film Action - V Film Premiere - V Series - + + + BBC News + Discovery + TLC + Disney Channel + Eurosport 1 + FEM + Frikanalen + REX + National Geographic + NRK Super/3 + NRK1 + NRK1 Tegnspråk + NRK2 + SVT1 + TV 2 Livsstil + TV 2 Direkte + TV 2 Nyheter + TV 2 Zebra + TV3 + TVNorge + TV3+ + Visjon Norge + VOX + Animal Planet + BBC Nordic + TV6 + History Channel + Eurosport Norge + Nick Jr. + Nickelodeon + TV 2 Danmark + DR2 + DR1 + SVT2 + TV4 + CNN + Discovery Science + Investigation Discovery + Norway Live + V Sport + + V Sport 1 + V Sport 2 + V Sport 3 + Hits + Stars + SF-kanalen + TV 2 Sport 1 + TV 2 Sport 2 + Sky News + CNBC + Deutsche Welle + France 24 + NRK1 Sørlandet + NRK1 Nordland + NRK1 Midtnytt + NRK1 Vestfold og Telemark + NRK1 Vestlandsrevyen + NRK1 Nordnytt + NRK1 Innlandet + MTV00s + TV Nord + Travel Channel + Food Network + Euronews + Auto Motor og Sport TV + Rikstoto Direkte + TV Øst + NRK1 Rogaland + NRK1 Møre og Romsdal + NRK1 Lydtekst + NRK2 Lydtekst + NRK3 Super Lydtekst + Heim TV + V sport golf + NRK1 Underteksting + NRK2 Underteksting + Naturkanal1 + V Film Action + V Film Premiere + V Series + diff --git a/sites/rikstv.no/rikstv.no.config.js b/sites/rikstv.no/rikstv.no.config.js index 29c64be7..b897473b 100644 --- a/sites/rikstv.no/rikstv.no.config.js +++ b/sites/rikstv.no/rikstv.no.config.js @@ -1,72 +1,76 @@ -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const axios = require('axios') - -dayjs.extend(utc) - -module.exports = { - site: 'rikstv.no', - days: 3, - request: { - cache: { - ttl: 60 * 60 * 1000 // 1 hour - } - }, - url({ channel, date }) { - return `https://play.rikstv.no/api/content-search/1/channel/${channel.site_id}/epg/${date.format('YYYY-MM-DD')}` - }, - parser: function ({ content }) { - let data - try { - data = JSON.parse(content) - } catch (error) { - console.error('Error parsing JSON:', error) - return [] - } - - const programs = [] - - if (data && Array.isArray(data)) { - data.forEach(item => { - if (!item) return - //const start = dayjs.utc(item.broadcastedTime) - //const stop = dayjs.utc(item.broadcastedTimeEnd) - - programs.push({ - title: item.seriesName, - sub_title: item.name, - description: item.description || item.synopsis, - season: item.season || null, - episode: item.episode || null, - category: item.genres, - actors: item.actors, - directors: item.director || item.directors, - icon: item.imagePackUri, - start: item.broadcastedTime, - stop: item.broadcastedTimeEnd - }) - }) - } - - return programs - }, - async channels() { - try { - const response = await axios.get('https://play.rikstv.no/api/content-search/1/channel?includePrograms=false') - if (!response.data || !Array.isArray(response.data)) { - console.error('Error: No channels data found') - return [] - } - return response.data.map(item => { - return { - lang: 'no', - site_id: item.channelId, - name: item.serviceName - } - }) - } catch (error) { - console.error('Error fetching channels:', error) - return [] - } - } -} +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const axios = require('axios') + +dayjs.extend(utc) + +module.exports = { + site: 'rikstv.no', + days: 3, + request: { + cache: { + ttl: 60 * 60 * 1000 // 1 hour + } + }, + url({ channel, date }) { + return `https://play.rikstv.no/api/content-search/1/channel/${ + channel.site_id + }/epg/${date.format('YYYY-MM-DD')}` + }, + parser: function ({ content }) { + let data + try { + data = JSON.parse(content) + } catch (error) { + console.error('Error parsing JSON:', error) + return [] + } + + const programs = [] + + if (data && Array.isArray(data)) { + data.forEach(item => { + if (!item) return + //const start = dayjs.utc(item.broadcastedTime) + //const stop = dayjs.utc(item.broadcastedTimeEnd) + + programs.push({ + title: item.seriesName, + sub_title: item.name, + description: item.description || item.synopsis, + season: item.season || null, + episode: item.episode || null, + category: item.genres, + actors: item.actors, + directors: item.director || item.directors, + icon: item.imagePackUri, + start: item.broadcastedTime, + stop: item.broadcastedTimeEnd + }) + }) + } + + return programs + }, + async channels() { + try { + const response = await axios.get( + 'https://play.rikstv.no/api/content-search/1/channel?includePrograms=false' + ) + if (!response.data || !Array.isArray(response.data)) { + console.error('Error: No channels data found') + return [] + } + return response.data.map(item => { + return { + lang: 'no', + site_id: item.channelId, + name: item.serviceName + } + }) + } catch (error) { + console.error('Error fetching channels:', error) + return [] + } + } +} diff --git a/sites/rikstv.no/rikstv.no.test.js b/sites/rikstv.no/rikstv.no.test.js index b37143e2..ce0f0959 100644 --- a/sites/rikstv.no/rikstv.no.test.js +++ b/sites/rikstv.no/rikstv.no.test.js @@ -1,66 +1,72 @@ -const { parser, url } = require('./rikstv.no.config.js') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') -const customParseFormat = require('dayjs/plugin/customParseFormat') - -dayjs.extend(customParseFormat) -dayjs.extend(utc) - -const date = dayjs.utc('2025-01-14', 'YYYY-MM-DD').startOf('d') -const channel = { - site_id: '47', - xmltv_id: 'NRK1.no' -} - -describe('rikstv.no Module Tests', () => { - it('can generate valid url', () => { - expect(url({ date, channel })).toBe(`https://play.rikstv.no/api/content-search/1/channel/${channel.site_id}/epg/${date.format('YYYY-MM-DD')}`) - }) - - it('can parse response', () => { - const content = JSON.stringify([ - { - seriesName: 'Vakre og ville Oman', - name: 'Vakre og ville Oman', - description: 'Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.', - season: 1, - episode: 1, - genres: ['Dokumentar', 'Fakta', 'Natur'], - actors: ['Gergana Muskalla'], - director: 'Stefania Muller', - imagePackUri: 'https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg', - broadcastedTime: '2025-01-13T23:00:00Z', - broadcastedTimeEnd: '2025-01-13T23:55:00Z' - } - ]) - - const result = parser({ content }).map(p => { - p.start = dayjs(p.start).toISOString() - p.stop = dayjs(p.stop).toISOString() - return p - }) - - expect(result).toMatchObject([ - { - title: 'Vakre og ville Oman', - sub_title: 'Vakre og ville Oman', - description: 'Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.', - season: 1, - episode: 1, - category: ['Dokumentar', 'Fakta', 'Natur'], - actors: ['Gergana Muskalla'], - directors: 'Stefania Muller', - icon: 'https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg', - start: '2025-01-13T23:00:00.000Z', - stop: '2025-01-13T23:55:00.000Z' - } - ]) - }) - - it('can handle empty guide', () => { - const result = parser({ - content: '[]' - }) - expect(result).toMatchObject([]) - }) -}) +const { parser, url } = require('./rikstv.no.config.js') +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const customParseFormat = require('dayjs/plugin/customParseFormat') + +dayjs.extend(customParseFormat) +dayjs.extend(utc) + +const date = dayjs.utc('2025-01-14', 'YYYY-MM-DD').startOf('d') +const channel = { + site_id: '47', + xmltv_id: 'NRK1.no' +} + +describe('rikstv.no Module Tests', () => { + it('can generate valid url', () => { + expect(url({ date, channel })).toBe( + `https://play.rikstv.no/api/content-search/1/channel/${channel.site_id}/epg/${date.format( + 'YYYY-MM-DD' + )}` + ) + }) + + it('can parse response', () => { + const content = JSON.stringify([ + { + seriesName: 'Vakre og ville Oman', + name: 'Vakre og ville Oman', + description: + 'Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.', + season: 1, + episode: 1, + genres: ['Dokumentar', 'Fakta', 'Natur'], + actors: ['Gergana Muskalla'], + director: 'Stefania Muller', + imagePackUri: 'https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg', + broadcastedTime: '2025-01-13T23:00:00Z', + broadcastedTimeEnd: '2025-01-13T23:55:00Z' + } + ]) + + const result = parser({ content }).map(p => { + p.start = dayjs(p.start).toISOString() + p.stop = dayjs(p.stop).toISOString() + return p + }) + + expect(result).toMatchObject([ + { + title: 'Vakre og ville Oman', + sub_title: 'Vakre og ville Oman', + description: + 'Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.', + season: 1, + episode: 1, + category: ['Dokumentar', 'Fakta', 'Natur'], + actors: ['Gergana Muskalla'], + directors: 'Stefania Muller', + icon: 'https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg', + start: '2025-01-13T23:00:00.000Z', + stop: '2025-01-13T23:55:00.000Z' + } + ]) + }) + + it('can handle empty guide', () => { + const result = parser({ + content: '[]' + }) + expect(result).toMatchObject([]) + }) +}) From 9836992122d6f422877f73a8627c2350c6107e9d Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 17 Jan 2025 22:57:28 +0300 Subject: [PATCH 2/5] Delete canalplus-haiti.com.channels.xml --- .../canalplus-haiti.com.channels.xml | 115 ------------------ 1 file changed, 115 deletions(-) delete mode 100644 sites/canalplus-haiti.com/canalplus-haiti.com.channels.xml diff --git a/sites/canalplus-haiti.com/canalplus-haiti.com.channels.xml b/sites/canalplus-haiti.com/canalplus-haiti.com.channels.xml deleted file mode 100644 index e7dc2648..00000000 --- a/sites/canalplus-haiti.com/canalplus-haiti.com.channels.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - Sony Channel Centro - 13ème Rue - 6ter - Action - Alizés - A+ - Automoto la chaîne - BBC World News Americas - Bblack! Caribbean - C8 - Canal 10 - Canal + Cinéma France - Canal + Haïti - Canal + Kids - Canal + Sport France - Cine + Classic - Cine + Club - Cine + Émotion - Cine + Famiz - Cine + Frisson - Cine + Premier - C News - CNN International Latin America - Comédie + - C Star - Cuisines - Discovery Channel France - Discovery Science France - Disney Channel France - Disney Junior France - Dorcel TV Africa - E! France - English Club TV - ESPN 2 Caribbean - ESPN Caribbean - ETV - Eurosport 1 - Eurosport 2 - France 2 - France 24 Français - France 3 - France 5 - Franceinfo: - Game One - Globo News - Graphé TV - Guadeloupe 1ère - Guyane 1ère - Haiti Sports TV 1 - Haiti Sports TV 2 - HBO Xtreme Latinoamérica - InfoSport + - IOTV - KMT - KTO - KTV Guyane - LCI - L'Équipe - Ludikids - M6 - Martinique 1ère - MCM France - Metropole - ES1 - MTV France - MTV Hits France - Nathan TV - National Geographic France - National Geographic Wild France - Nickelodeon France - Nick Jr Africa - Nollywood TV - Novelas TV - NRJ 12 - Paramount Channel France - Paris Première - Penthouse Black - Piwi + - Planète + - Planète + A&E - Planète + CI - LCP Public Sénat - RTL 9 - Seasons - Studiocanal - STVS 8.1 - Syfy France - Télé 20 - Telemicro Internacional - Telemundo - Tele Pacific - Tele Soleil - TéléToon + - TF 1 - TF 1 Séries Films - TFX - TNH - Toute l'Histoire - Trace Ayiti - Trace Caribbean - Trace Gospel - Trace Latina - Trace Urban - TV5Monde Amérique Latine - TV Caraïbes - Ushuaïa TV - ViàATV - Vixen - Wataaa TV - XXL - Zitata TV - Zouk TV - \ No newline at end of file From 3a2757b79c2e98c8846cde802868bd4ce470afa6 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:00:16 +0300 Subject: [PATCH 3/5] Delete canalplus-haiti.com.config.js --- .../canalplus-haiti.com.config.js | 94 ------------------- 1 file changed, 94 deletions(-) delete mode 100644 sites/canalplus-haiti.com/canalplus-haiti.com.config.js diff --git a/sites/canalplus-haiti.com/canalplus-haiti.com.config.js b/sites/canalplus-haiti.com/canalplus-haiti.com.config.js deleted file mode 100644 index 77c7d7fe..00000000 --- a/sites/canalplus-haiti.com/canalplus-haiti.com.config.js +++ /dev/null @@ -1,94 +0,0 @@ -const axios = require('axios') -const cheerio = require('cheerio') -const dayjs = require('dayjs') -const utc = require('dayjs/plugin/utc') - -dayjs.extend(utc) - -module.exports = { - site: 'canalplus-haiti.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/53101/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), - image: parseImage(item), - start: parseStart(item), - stop: parseStop(item) - }) - } - - return programs - }, - async channels() { - const html = await axios - .get('https://www.canalplus-haiti.com/guide-tv-ce-soir') - .then(r => r.data) - .catch(console.log) - - const $ = cheerio.load(html) - const script = $('body > script:nth-child(2)').html() - const [, json] = script.match(/window.APP_STATE=(.*);/) || [null, null] - const data = JSON.parse(json) - const items = data.tvGuide.channels.byZapNumber - - return Object.values(items).map(item => { - return { - lang: 'fr', - site_id: item.epgID, - name: item.name - } - }) - } -} - -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 parseImage(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 -} From f5a5beacc6177c7b210ab14a719d5473cdd0130b Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:01:20 +0300 Subject: [PATCH 4/5] Delete canalplus-haiti.com.test.js --- .../canalplus-haiti.com.test.js | 174 ------------------ 1 file changed, 174 deletions(-) delete mode 100644 sites/canalplus-haiti.com/canalplus-haiti.com.test.js diff --git a/sites/canalplus-haiti.com/canalplus-haiti.com.test.js b/sites/canalplus-haiti.com/canalplus-haiti.com.test.js deleted file mode 100644 index 4590d1ff..00000000 --- a/sites/canalplus-haiti.com/canalplus-haiti.com.test.js +++ /dev/null @@ -1,174 +0,0 @@ -const { parser, url } = require('./canalplus-haiti.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: '51006', - xmltv_id: 'ViaATV.mq' -} - -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/53101/channel/51006/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/53101/channel/51006/events?filter.day=1' - ) -}) - -it('can parse response', done => { - const content = `{ - "timeSlices": [ - { - "contents": [ - { - "title": "New Amsterdam - S3 - Ep7", - "subtitle": "Episode 7 - Le mur de la honte", - "thirdTitle": "viaATV", - "startTime": 1660780500, - "endTime": 1660783200, - "onClick": { - "displayTemplate": "miniDetail", - "displayName": "New Amsterdam - S3 - Ep7", - "URLPage": "https://service.canal-overseas.com/ott-frontend/vector/53101/event/140952809", - "URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/53101/program/187882282/recommendations" - }, - "programID": 187882282, - "diffusionID": "140952809", - "URLImageDefault": "https://service.canal-overseas.com/image-api/v1/image/generic", - "URLImage": "https://service.canal-overseas.com/image-api/v1/image/52a18a209e28380b199201961c27097e" - } - ], - "timeSlice": "2" - } - ] - }` - axios.get.mockImplementation(url => { - if (url === 'https://service.canal-overseas.com/ott-frontend/vector/53101/event/140952809') { - return Promise.resolve({ - data: JSON.parse(`{ - "currentPage": { - "displayName": "New Amsterdam - S3 - Ep7", - "displayTemplate": "detailPage", - "URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/53101/program/187882282/recommendations" - }, - "detail": { - "informations": { - "programmeType": "EPG", - "isInOffer": false, - "isInOfferOnDevice": false, - "isInOfferForD2G": false, - "availableInVoDOnDevice": false, - "availableInVoDOnG5": false, - "availableInD2GOnDevice": false, - "availableInLiveOnDevice": false, - "rediffusions": true, - "canBeRecorded": false, - "channelName": "viaATV", - "startTime": 1660780500, - "endTime": 1660783200, - "title": "New Amsterdam - S3 - Ep7", - "subtitle": "Episode 7 - Le mur de la honte", - "thirdTitle": "viaATV", - "genre": "Séries", - "subGenre": "Série Hôpital", - "editorialTitle": "Séries, Etats-Unis, 2020, 0h45", - "audioLanguage": "VF", - "personnalities": [ - { - "prefix": "De :", - "content": "Darnell Martin" - }, - { - "prefix": "Avec :", - "content": "André De Shields, Anna Suzuki, Anupam Kher, Baylen Thomas, Christine Chang, Craig Wedren, Daniel Dae Kim, Dierdre Friel, Em Grosland, Emma Ramos, Freema Agyeman, Gina Gershon, Graham Norris, Jamie Ann Romero, Janet Montgomery, Jefferson Friedman, Joshua Gitta, Kerry Flanagan, Larry Bryggman, Mike Doyle, Nora Clow, Opal Clow, Ryan Eggold, Simone Policano, Stephen Spinella, Tyler Labine" - } - ], - "summary": "C'est la journée nationale de dépistage du VIH et Max offre des soins gratuits à tous les malades séropositifs qui se présentent à New Amsterdam.", - "summaryMedium": "C'est la journée nationale de dépistage du VIH et Max offre des soins gratuits à tous les malades séropositifs qui se présentent à New Amsterdam.", - "programID": 187882282, - "sharingURL": "https://www.canalplus-haiti.com/grille-tv/event/140952809-new-amsterdam-s3-ep7.html", - "labels": { - "allocine": false, - "telerama": false, - "sensCritique": false - }, - "EpgId": 51006, - "CSA": 1, - "HD": false, - "3D": false, - "diffusionID": "140952809", - "duration": "2700", - "URLImageDefault": "https://service.canal-overseas.com/image-api/v1/image/generic", - "URLImage": "https://service.canal-overseas.com/image-api/v1/image/52a18a209e28380b199201961c27097e", - "URLLogo": "https://service.canal-overseas.com/image-api/v1/image/0f67b2e85f74101c4c776cf423240fce", - "URLLogoBlack": "https://service.canal-overseas.com/image-api/v1/image/0f67b2e85f74101c4c776cf423240fce", - "URLVitrine": "https://service.canal-overseas.com/ott-frontend/vector/53101/program/187882282/recommendations" - }, - "diffusions": [ - { - "diffusionDateUTC": 1660780500, - "sharingUrl": "https://www.canalplus-haiti.com/grille-tv/event/140952809-new-amsterdam.html", - "broadcastId": "140952809", - "name": "viaATV", - "epgID": "51006", - "ZapNumber": "28", - "URLLogo": "https://service.canal-overseas.com/image-api/v1/image/0f67b2e85f74101c4c776cf423240fce", - "URLLogoBlack": "https://service.canal-overseas.com/image-api/v1/image/0f67b2e85f74101c4c776cf423240fce" - } - ] - } - }`) - }) - } 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-17T23:55:00.000Z', - stop: '2022-08-18T00:40:00.000Z', - title: 'New Amsterdam - S3 - Ep7', - image: - 'https://service.canal-overseas.com/image-api/v1/image/52a18a209e28380b199201961c27097e', - category: 'Série Hôpital', - description: - "C'est la journée nationale de dépistage du VIH et Max offre des soins gratuits à tous les malades séropositifs qui se présentent à New Amsterdam." - } - ]) - 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) -}) From 630f031239cb2afe365b86ff6cfbb6d7632756ef Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:01:55 +0300 Subject: [PATCH 5/5] Delete readme.md --- sites/canalplus-haiti.com/readme.md | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 sites/canalplus-haiti.com/readme.md diff --git a/sites/canalplus-haiti.com/readme.md b/sites/canalplus-haiti.com/readme.md deleted file mode 100644 index 5ba0efbc..00000000 --- a/sites/canalplus-haiti.com/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# canalplus-haiti.com - -https://www.canalplus-haiti.com/guide-tv-maintenant - -### Download the guide - -```sh -npm run grab --- --site=canalplus-haiti.com -``` - -### Update channel list - -```sh -npm run channels:parse --- --config=./sites/canalplus-haiti.com/canalplus-haiti.com.config.js --output=./sites/canalplus-haiti.com/canalplus-haiti.com.channels.xml -``` - -### Test - -```sh -npm test --- canalplus-haiti.com -```