From af1149548ee14ff4a3bfd0f758fa0bd1e8f6e7b5 Mon Sep 17 00:00:00 2001
From: fraudiay79 <60631277+fraudiay79@users.noreply.github.com>
Date: Mon, 30 Dec 2024 09:05:46 -0500
Subject: [PATCH 1/5] Create cosmotetv.gr.config.js
---
sites/cosmotetv.gr/cosmotetv.gr.config.js | 81 +++++++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 sites/cosmotetv.gr/cosmotetv.gr.config.js
diff --git a/sites/cosmotetv.gr/cosmotetv.gr.config.js b/sites/cosmotetv.gr/cosmotetv.gr.config.js
new file mode 100644
index 00000000..ef26df1f
--- /dev/null
+++ b/sites/cosmotetv.gr/cosmotetv.gr.config.js
@@ -0,0 +1,81 @@
+const dayjs = require('dayjs')
+const utc = require('dayjs/plugin/utc')
+const customParseFormat = require('dayjs/plugin/customParseFormat')
+const timezone = require('dayjs/plugin/timezone')
+
+dayjs.extend(utc)
+dayjs.extend(customParseFormat)
+dayjs.extend(timezone)
+
+module.exports = {
+ site: 'cosmotetv.gr',
+ days: 5,
+ request: {
+ cache: {
+ ttl: 60 * 60 * 1000 // 1 hour
+ },
+ method: 'GET',
+ headers: {
+ 'referer': 'https://www.cosmotetv.gr/',
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
+ 'Accept': '*/*',
+ 'Accept-Language': 'en-US,en;q=0.9',
+ 'Accept-Encoding': 'gzip, deflate, br, zstd',
+ 'Origin': 'https://www.cosmotetv.gr',
+ 'Sec-Ch-Ua': '"Not.A/Brand";v="24", "Chromium";v="131", "Google Chrome";v="131"',
+ 'Sec-Ch-Ua-Mobile': '?0',
+ 'Sec-Ch-Ua-Platform': '"Windows"',
+ 'Sec-Fetch-Dest': 'empty',
+ 'Sec-Fetch-Mode': 'cors',
+ 'Sec-Fetch-Site': 'cross-site'
+ }
+ },
+ url: function ({date, channel}) {
+ const startOfDay = dayjs(date).startOf('day').utc().unix()
+ const endOfDay = dayjs(date).endOf('day').utc().unix()
+ return `https://mwapi-prod.cosmotetvott.gr/api/v3.4/epg/listings/el?from=${startOfDay}&to=${endOfDay}&callSigns=${channel.site_id}&endingIncludedInRange=false`
+ },
+ parser: function ({ date, content }) {
+ let programs = []
+ const data = JSON.parse(content)
+ data.channels.forEach(channel => {
+ channel.items.forEach(item => {
+ const start = dayjs(item.startTime).utc().toISOString()
+ const stop = dayjs(item.endTime).utc().toISOString()
+ programs.push({
+ title: item.title,
+ description: item.description || 'No description available',
+ category: item.qoe.genre,
+ image: item.thumbnails.standard,
+ start,
+ stop
+ })
+ })
+ })
+ return programs
+ },
+ async channels() {
+ const axios = require('axios')
+ try {
+ const response = await axios.get('https://mwapi-prod.cosmotetvott.gr/api/v3.4/epg/channels/all/el', {
+ headers: this.request.headers
+ })
+ const data = response.data
+
+ if (data && data.channels) {
+ return data.channels.map(item => ({
+ lang: 'el',
+ site_id: item.callSign,
+ name: item.title,
+ //logo: item.logos.square
+ }))
+ } else {
+ console.error('Unexpected response structure:', data)
+ return []
+ }
+ } catch (error) {
+ console.error('Error fetching channel data:', error)
+ return []
+ }
+ }
+}
From 312b654937a41c7a306ebb2ff6e077d9904ed850 Mon Sep 17 00:00:00 2001
From: fraudiay79 <60631277+fraudiay79@users.noreply.github.com>
Date: Mon, 30 Dec 2024 09:06:17 -0500
Subject: [PATCH 2/5] Create cosmotetv.gr.channels.xml
---
sites/cosmotetv.gr/cosmotetv.gr.channels.xml | 111 +++++++++++++++++++
1 file changed, 111 insertions(+)
create mode 100644 sites/cosmotetv.gr/cosmotetv.gr.channels.xml
diff --git a/sites/cosmotetv.gr/cosmotetv.gr.channels.xml b/sites/cosmotetv.gr/cosmotetv.gr.channels.xml
new file mode 100644
index 00000000..bee76812
--- /dev/null
+++ b/sites/cosmotetv.gr/cosmotetv.gr.channels.xml
@@ -0,0 +1,111 @@
+
+
+ Action 24
+ Al Arabiya
+ Al Jazeera
+ ALPHA
+ ANT1
+ Asharq News
+ ATTICA TV
+ Baby TV
+ BBC Earth HD
+ BBC News
+ Bloomberg
+ 4Ε
+ COSMOTE Cinema 1 HD
+ COSMOTE Cinema 2 HD
+ COSMOTE Cinema 3
+ COSMOTE Series HD
+ CNBC
+ CNN
+ Crime and Investigation
+ Deutsche Welle
+ Disney Channel
+ Disney Junior
+ ducktv
+ E! HD
+ ENA Channel
+ ΕΡΤ1 HD
+ ΕΡΤ2 HD
+ ΕΡΤ3 HD
+ ΕΡΤ NEWS
+ ERT WORLD
+ Euronews English
+ Euronews Greek
+ FTV HD
+ FX
+ FX Life
+ France 24 En
+ GINX eSports
+ COSMOTE Sport Highlights HD
+ COSMOTE History HD
+ Kontra
+ Κρήτη Νέα Τηλεόραση
+ Κρήτη TV
+ Luxe TV HD
+ MAD HD
+ MAD Viral HD
+ Μακεδονία TV HD
+ COSMOTE Series Marathon
+ MEGA HD
+ MEZZO LIVE HD
+ Motorvision+
+ MTV Europe
+ MTV Hits
+ MTV Live
+ Museum TV
+ MyZen TV
+ Naftemporiki
+ Nat Geo Wild HD
+ National Geographic HD
+ Nautical Channel HD
+ Nickelodeon HD
+ Novasports1HD
+ Novasports2HD
+ Novasports3HD
+ Novasports4HD
+ Novasports5HD
+ Novasports6HD
+ Novasportsextra1HD
+ Novasportsextra2HD
+ Novasportsextra3HD
+ Novasportsextra4HD
+ Novasports News HD
+ Novasports Premier League HD
+ Novasports Prime HD
+ Novasports Start HD
+ ONE Channel HD
+ OPEN BEYOND
+ Panik TV
+ CosmoteCinemaChristmasHD
+ Promo HD
+ ΣΚΑΪ
+ Sky News
+ Smile TV
+ COSMOTE Sport 1 HD
+ COSMOTE Sport 2 HD
+ COSMOTE Sport 3 HD
+ COSMOTE Sport 4 HD
+ COSMOTE Sport 4K
+ COSMOTE Sport 5 HD
+ COSMOTE Sport 6 HD
+ COSMOTE Sport 7 HD
+ COSMOTE Sport 8 HD
+ COSMOTE Sport 9 HD
+ STAR
+ Star Κεντρικής Ελλάδας
+ Stingray CMusic
+ Stingray iConcerts
+ TCM
+ ΑΕΚ SL Pass
+ ΟΛΥΜΠΙΑΚΟΣ SL Pass
+ ΠΑΝΑΘΗΝΑΪΚΟΣ SL Pass
+ TV100
+ Βεργίνα TV
+ MTV 00s
+ Viasat Explore HD
+ Viasat History HD
+ Viasat Nature HD
+ Village Cinema HD
+ ΒΟΥΛΗ HD
+
From b4dafb2dc1512d46dff5fa33768a8f94ec0c4818 Mon Sep 17 00:00:00 2001
From: fraudiay79 <60631277+fraudiay79@users.noreply.github.com>
Date: Mon, 30 Dec 2024 09:06:40 -0500
Subject: [PATCH 3/5] Create cosmotetv.gr.test.js
---
sites/cosmotetv.gr/cosmotetv.gr.test.js | 81 +++++++++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 sites/cosmotetv.gr/cosmotetv.gr.test.js
diff --git a/sites/cosmotetv.gr/cosmotetv.gr.test.js b/sites/cosmotetv.gr/cosmotetv.gr.test.js
new file mode 100644
index 00000000..dc73ce7e
--- /dev/null
+++ b/sites/cosmotetv.gr/cosmotetv.gr.test.js
@@ -0,0 +1,81 @@
+const { parser, url, channels } = require('./cosmotetv.gr.config.js')
+const dayjs = require('dayjs')
+const utc = require('dayjs/plugin/utc')
+const customParseFormat = require('dayjs/plugin/customParseFormat')
+const timezone = require('dayjs/plugin/timezone')
+const axios = require('axios')
+
+dayjs.extend(utc)
+dayjs.extend(customParseFormat)
+dayjs.extend(timezone)
+
+jest.mock('axios')
+
+const date = dayjs.utc('2024-12-26', 'YYYY-MM-DD').startOf('d')
+const channel = { site_id: 'vouli', xmltv_id: 'HellenicParliamentTV.gr' }
+
+const mockChannelData = {
+ "channels": [
+ {
+ "guid": "XTV100000954",
+ "title": "ΒΟΥΛΗ HD",
+ "callSign": "vouli",
+ "logos": {
+ "square": "https://tr.static.cdn.cosmotetvott.gr/ote-prod/channel_logos/vouli1-normal.png",
+ "wide": "https://tr.static.cdn.cosmotetvott.gr/ote-prod/channel_logos/vouli1-wide.png"
+ }
+ }
+ ]
+}
+
+const mockEpgData = {
+ "channels": [
+ {
+ "items": [
+ {
+ "startTime": "2024-12-26T23:00:00+00:00",
+ "endTime": "2024-12-27T00:00:00+00:00",
+ "title": "Τι Λέει ο Νόμος",
+ "description": "νημερωτική εκπομπή. Συζήτηση με τους εισηγητές των κομμάτων για το νομοθετικό έργο.",
+ "qoe": {
+ "genre": "Special"
+ },
+ "thumbnails": {
+ "standard": "https://gr-ermou-prod-cache05.static.cdn.cosmotetvott.gr/ote-prod/70/280/040029714812000800_1734415727199.jpg"
+ }
+ }
+ ]
+ }
+ ]
+}
+
+it('can generate valid url', () => {
+ const startOfDay = dayjs(date).startOf('day').utc().unix()
+ const endOfDay = dayjs(date).endOf('day').utc().unix()
+ expect(url({ date, channel })).toBe(`https://mwapi-prod.cosmotetvott.gr/api/v3.4/epg/listings/el?from=${startOfDay}&to=${endOfDay}&callSigns=${channel.site_id}&endingIncludedInRange=false`)
+})
+
+it('can parse response', () => {
+ const content = JSON.stringify(mockEpgData)
+ const result = parser({ date, content }).map(p => {
+ p.start = dayjs(p.start).toISOString()
+ p.stop = dayjs(p.stop).toISOString()
+ return p
+ })
+
+ expect(result).toMatchObject([
+ {
+ title: "Τι Λέει ο Νόμος",
+ description: "νημερωτική εκπομπή. Συζήτηση με τους εισηγητές των κομμάτων για το νομοθετικό έργο.",
+ category: "Special",
+ image: "https://gr-ermou-prod-cache05.static.cdn.cosmotetvott.gr/ote-prod/70/280/040029714812000800_1734415727199.jpg",
+ start: "2024-12-26T23:00:00.000Z",
+ stop: "2024-12-27T00:00:00.000Z"
+ }
+ ])
+})
+
+it('can handle empty guide', () => {
+ const result = parser({ date, channel, content: '{"date":"2024-12-26","categories":[],"channels":[]}' });
+ expect(result).toMatchObject([])
+})
From e1a501b0bda9d5296643157e662134881a7136f5 Mon Sep 17 00:00:00 2001
From: fraudiay79 <60631277+fraudiay79@users.noreply.github.com>
Date: Mon, 30 Dec 2024 09:06:56 -0500
Subject: [PATCH 4/5] Delete sites/cosmote.gr directory
---
sites/cosmote.gr/__data__/content1.html | 5571 ----------------------
sites/cosmote.gr/__data__/content2.html | 5435 ---------------------
sites/cosmote.gr/cosmote.gr.channels.xml | 100 -
sites/cosmote.gr/cosmote.gr.config.js | 103 -
sites/cosmote.gr/cosmote.gr.test.js | 77 -
sites/cosmote.gr/readme.md | 21 -
6 files changed, 11307 deletions(-)
delete mode 100644 sites/cosmote.gr/__data__/content1.html
delete mode 100644 sites/cosmote.gr/__data__/content2.html
delete mode 100644 sites/cosmote.gr/cosmote.gr.channels.xml
delete mode 100644 sites/cosmote.gr/cosmote.gr.config.js
delete mode 100644 sites/cosmote.gr/cosmote.gr.test.js
delete mode 100644 sites/cosmote.gr/readme.md
diff --git a/sites/cosmote.gr/__data__/content1.html b/sites/cosmote.gr/__data__/content1.html
deleted file mode 100644
index 335e0bcb..00000000
--- a/sites/cosmote.gr/__data__/content1.html
+++ /dev/null
@@ -1,5571 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- COSMOTE TV
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
Second Tab
-
-
-
Third tab
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sites/cosmote.gr/__data__/content2.html b/sites/cosmote.gr/__data__/content2.html
deleted file mode 100644
index 7923b527..00000000
--- a/sites/cosmote.gr/__data__/content2.html
+++ /dev/null
@@ -1,5435 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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-
-
-
-
-
diff --git a/sites/cosmote.gr/cosmote.gr.channels.xml b/sites/cosmote.gr/cosmote.gr.channels.xml
deleted file mode 100644
index 5deca451..00000000
--- a/sites/cosmote.gr/cosmote.gr.channels.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
- α.Epsilon
- Action 24
- ALPHA HD
- ANT1 HD
- BBC News
- Βεργίνα TV
- COSMOTE CINEMA 1HD
- COSMOTE CINEMA 2 HD
- COSMOTE CINEMA 3
- COSMOTE Cinema Kids HD
- COSMOTE HISTORY HD
- COSMOTE SERIES HD
- COSMOTE SERIES MARATHON
- COSMOTE SPORT 1HD
- COSMOTE SPORT 2HD
- COSMOTE SPORT 3HD
- COSMOTE SPORT 4HD
- COSMOTE Sport 4K
- COSMOTE SPORT 5HD
- COSMOTE SPORT 6HD
- COSMOTE SPORT 7HD
- COSMOTE SPORT 8HD
- COSMOTE SPORT 9HD
- COSMOTE SPORT HIGHLIGHTS HD
- Disney Junior
- ducktv
- DW
- ENA Channel
- ΕΡΤ NEWS
- ΕΡΤ1 HD
- ΕΡΤ2 HD
- ΕΡΤ3 HD
- Euronews Greek
- FTV HD
- FX
- FX Life
- Kontra
- Κρήτη Νέα Τηλεόραση
- MAD Viral HD
- Μακεδονία TV HD
- MEZZO LIVE HD
- MTV 00s
- MTV Live
- Museum TV
- MyZen TV
- Naftemporiki
- National Geographic HD
- Nickelodeon HD
- ONE Channel HD
- OPEN BEYOND HD
- Panik TV
- Penthouse Gold
- ΣΚΑΪ HD
- Sky News
- STAR HD
- Stingray CMusic
- Stingray iConcerts
- TCM HD
- Viasat Explore HD
- Viasat History HD
- Viasat Nature HD
- VIXEN
- 4Ε
- Αιγαίο TV
- Al Arabiya
- Al Jazeera
- Baby TV
- BBC Earth HD
- Bloomberg
- Blue Hustler
- CBS Reality
- CNBC
- CNN
- Crime and Investigation
- Disney Channel
- EDGEsport HD
- E! HD
- TV100
- ERT WORLD
- Euronews English
- France 24 En
- France 24 Fr
- GINX eSports
- ΒΟΥΛΗ
- Hustler TV HD
- ΚΡΗΤΗ TV
- Luxe TV HD
- MAD
- MEGA HD
- Motorvision+
- MTV Europe
- Nat Geo Wild HD
- Nautical Channel HD
- Sirina TV
- Smile TV
- Star Κεντρικής Ελλάδας
- Village Cinema HD
-
diff --git a/sites/cosmote.gr/cosmote.gr.config.js b/sites/cosmote.gr/cosmote.gr.config.js
deleted file mode 100644
index 85c26c91..00000000
--- a/sites/cosmote.gr/cosmote.gr.config.js
+++ /dev/null
@@ -1,103 +0,0 @@
-const axios = require('axios')
-const cheerio = require('cheerio')
-const { DateTime } = require('luxon')
-
-module.exports = {
- site: 'cosmote.gr',
- days: 2,
- url: function ({ date, channel }) {
- return `https://www.cosmotetv.gr/portal/residential/program/epg/programchannel?p_p_id=channelprogram_WAR_OTETVportlet&p_p_lifecycle=0&_channelprogram_WAR_OTETVportlet_platform=IPTV&_channelprogram_WAR_OTETVportlet_date=${date.format(
- 'DD-MM-YYYY'
- )}&_channelprogram_WAR_OTETVportlet_articleTitleUrl=${channel.site_id}`
- },
- parser: function ({ date, content }) {
- let programs = []
- const items = parseItems(content)
- items.forEach((item, i) => {
- const prev = programs[programs.length - 1]
- const $item = cheerio.load(item)
- let start = parseStart($item, date)
- if (i === 0 && start.hour > 12 && start.hour < 21) {
- date = date.subtract(1, 'd')
- start = start.minus({ days: 1 })
- }
- if (prev && start < prev.start) {
- start = start.plus({ days: 1 })
- date = date.add(1, 'd')
- }
- let stop = parseStop($item, date)
- if (stop < start) {
- stop = stop.plus({ days: 1 })
- date = date.add(1, 'd')
- }
- programs.push({
- title: parseTitle($item),
- category: parseCategory($item),
- start,
- stop
- })
- })
-
- return programs
- },
- async channels() {
- const data = await axios
- .get(`https://www.cosmotetv.gr/portal/residential/program`)
- .then(r => r.data)
- .catch(console.log)
-
- let channels = []
- const $ = cheerio.load(data)
- $('#program-channels-selectbox > option').each((i, el) => {
- const value = $(el).attr('value')
- if (!value || value == '-1') return
-
- const url = new URL(decodeURIComponent(value))
- const site_id = url.searchParams.get('_channelprogram_WAR_OTETVportlet_articleTitleUrl')
-
- channels.push({
- lang: 'el',
- site_id,
- name: $(el).text().trim()
- })
- })
-
- return channels
- }
-}
-
-function parseTitle($item) {
- return $item('.channel_program-table--program > a').text()
-}
-
-function parseCategory($item) {
- const typeString = $item('.channel_program-table--program_type')
- .children()
- .remove()
- .end()
- .text()
- .trim()
- const [, category] = typeString.match(/\| (.*)/) || [null, null]
-
- return category
-}
-
-function parseStart($item, date) {
- const timeString = $item('span.start-time').text()
- const dateString = `${date.format('YYYY-MM-DD')} ${timeString}`
-
- return DateTime.fromFormat(dateString, 'yyyy-MM-dd HH:mm', { zone: 'Europe/Athens' }).toUTC()
-}
-
-function parseStop($item, date) {
- const timeString = $item('span.end-time').text()
- const dateString = `${date.format('YYYY-MM-DD')} ${timeString}`
-
- return DateTime.fromFormat(dateString, 'yyyy-MM-dd HH:mm', { zone: 'Europe/Athens' }).toUTC()
-}
-
-function parseItems(content) {
- const $ = cheerio.load(content)
-
- return $('#_channelprogram_WAR_OTETVportlet_programs > tr.d-sm-table-row').toArray()
-}
diff --git a/sites/cosmote.gr/cosmote.gr.test.js b/sites/cosmote.gr/cosmote.gr.test.js
deleted file mode 100644
index 59f18290..00000000
--- a/sites/cosmote.gr/cosmote.gr.test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-const { parser, url } = require('./cosmote.gr.config.js')
-const fs = require('fs')
-const path = require('path')
-const dayjs = require('dayjs')
-const utc = require('dayjs/plugin/utc')
-const timezone = require('dayjs/plugin/timezone')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-
-dayjs.extend(utc)
-dayjs.extend(timezone)
-dayjs.extend(customParseFormat)
-
-const date = dayjs.utc('2023-06-08', 'YYYY-MM-DD').startOf('d')
-const channel = {
- site_id: '4e',
- xmltv_id: '4E.gr'
-}
-
-it('can generate valid url', () => {
- expect(url({ channel, date })).toBe(
- 'https://www.cosmotetv.gr/portal/residential/program/epg/programchannel?p_p_id=channelprogram_WAR_OTETVportlet&p_p_lifecycle=0&_channelprogram_WAR_OTETVportlet_platform=IPTV&_channelprogram_WAR_OTETVportlet_date=08-06-2023&_channelprogram_WAR_OTETVportlet_articleTitleUrl=4e'
- )
-})
-
-it('can parse response', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/content1.html'))
- const results = parser({ content, date }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(results[0]).toMatchObject({
- start: '2023-06-07T20:30:00.000Z',
- stop: '2023-06-07T21:45:00.000Z',
- title: 'Τηλεφημερίδα',
- category: 'Εκπομπή - Μαγκαζίνο'
- })
-
- expect(results[30]).toMatchObject({
- start: '2023-06-08T19:45:00.000Z',
- stop: '2023-06-08T20:30:00.000Z',
- title: 'Μικρό Απόδειπνο',
- category: 'Special'
- })
-})
-
-it('can parse response when the guide starting before midnight', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/content2.html'))
- const results = parser({ content, date }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(results[0]).toMatchObject({
- start: '2023-06-07T21:30:00.000Z',
- stop: '2023-06-07T22:30:00.000Z',
- title: 'Καλύτερα Αργά',
- category: 'Ψυχαγωγική Εκπομπή'
- })
-
- expect(results[22]).toMatchObject({
- start: '2023-06-08T19:00:00.000Z',
- stop: '2023-06-08T21:30:00.000Z',
- title: 'Πίσω Από Τις Γραμμές',
- category: 'Εκπομπή - Μαγκαζίνο'
- })
-})
-
-it('can handle empty guide', () => {
- const result = parser({
- date,
- content: ''
- })
- expect(result).toMatchObject([])
-})
diff --git a/sites/cosmote.gr/readme.md b/sites/cosmote.gr/readme.md
deleted file mode 100644
index 34d51abe..00000000
--- a/sites/cosmote.gr/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# cosmote.gr
-
-https://www.cosmote.gr/ _[Geo-blocked]_
-
-### Download the guide
-
-```sh
-npm run grab --- --site=cosmote.gr
-```
-
-### Update channel list
-
-```sh
-npm run channels:parse --- --config=./sites/cosmote.gr/cosmote.gr.config.js --output=./sites/cosmote.gr/cosmote.gr.channels.xml
-```
-
-### Test
-
-```sh
-npm test --- cosmote.gr
-```
From 345be3a71da835419885ca27001ce65776fb6416 Mon Sep 17 00:00:00 2001
From: fraudiay79 <60631277+fraudiay79@users.noreply.github.com>
Date: Mon, 30 Dec 2024 10:50:23 -0500
Subject: [PATCH 5/5] Create readme.md
---
sites/cosmotetv.gr/readme.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 sites/cosmotetv.gr/readme.md
diff --git a/sites/cosmotetv.gr/readme.md b/sites/cosmotetv.gr/readme.md
new file mode 100644
index 00000000..be33dd17
--- /dev/null
+++ b/sites/cosmotetv.gr/readme.md
@@ -0,0 +1,21 @@
+# cosmotetv.gr
+
+https://www.cosmotetv.gr/portal/program
+
+### Download the guide
+
+```sh
+npm run grab --- --site=cosmotetv.gr
+```
+
+### Update channel list
+
+```sh
+npm run channels:parse --- --config=./sites/cosmotetv.gr/cosmotetv.gr.config.js --output=./sites/cosmotetv.gr/cosmotetv.gr.channels.xml
+```
+
+### Test
+
+```sh
+npm test --- cosmotetv.gr
+```