diff --git a/sites/cosmote.gr/cosmote.gr.channels.xml b/sites/cosmote.gr/cosmote.gr.channels.xml index cfb9158f..c739d76d 100644 --- a/sites/cosmote.gr/cosmote.gr.channels.xml +++ b/sites/cosmote.gr/cosmote.gr.channels.xml @@ -1,88 +1,100 @@ - - - 4E - Action 24 - Aigaio TV - Alarabiya - Aljazeera - Alpha TV - Ant1 - Baby TV - BBC Earth HD - BBC World News - Bloomberg TV - Blue Hustler - Body in Balance - CBS Reality - CNBC - CNN - Cosmote Cinema 1 - Cosmote Cinema 2 - Cosmote Cinema 3 - Cosmote History - Cosmote Series - Cosmote Series Marathon - Cosmote Sport 1 - Cosmote Sport 2 - Cosmote Sport 3 - Cosmote Sport 4 - Cosmote Sport 5 - Cosmote Sport 6 - Cosmote Sport 7 - Cosmote Sport 8 - Cosmote Sport 9 - Cosmote Sport Highlights - Crime + Investigation - Disney Channel Middle East - DW - Edge Sport HD - E! HD - Ena Channel - Epsilon TV - ERT 1 - ERT 2 - ERT 3 - ERT World - EuroNews English - EuroNews - FashionTV - Fox HD - Fox Life HD - France 24 English - France 24 Français - Ginx eSports TV - Vouli TV - Hustler HD - Kriti TV - Luxe TV HD - Mad TV - Mad Viral - Makedonia TV - Mega TV HD - Mezzo Live HD - Motorvision TV HD - MTV Global - MTV Live HD - National Geographic - National Geographic Wild HD - Nautical Channel - Nea TV - One Channel - Open Beyond TV - Penthouse Gold - Private TV - RT News - Sirina TV - SKAI - Smile TV - Star Channel - Star Kentrikis Elladas - Stingray CMusic - Stingray IConcerts - Vergina TV - VH1 Europe - Viasat Explore - Viasat History - Viasat Nature - Village Cinemas HD - + + + + + Αιγαίο 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 index d5fcc97c..85c26c91 100644 --- a/sites/cosmote.gr/cosmote.gr.config.js +++ b/sites/cosmote.gr/cosmote.gr.config.js @@ -1,3 +1,4 @@ +const axios = require('axios') const cheerio = require('cheerio') const { DateTime } = require('luxon') @@ -38,6 +39,30 @@ module.exports = { }) 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 } } diff --git a/sites/cosmote.gr/cosmote.gr.test.js b/sites/cosmote.gr/cosmote.gr.test.js index ab8e215f..7703694c 100644 --- a/sites/cosmote.gr/cosmote.gr.test.js +++ b/sites/cosmote.gr/cosmote.gr.test.js @@ -1,4 +1,5 @@ -// npm run grab -- --site=cosmote.gr +// [Geo-blocked] npm run channels:parse -- --config=./sites/cosmote.gr/cosmote.gr.config.js --output=./sites/cosmote.gr/cosmote.gr.channels.xml +// [Geo-blocked] npm run grab -- --site=cosmote.gr const { parser, url } = require('./cosmote.gr.config.js') const fs = require('fs')