diff --git a/sites/orangetv.es/orangetv.es.channels.xml b/sites/orangetv.es/orangetv.es.channels.xml new file mode 100644 index 00000000..d7950f7b --- /dev/null +++ b/sites/orangetv.es/orangetv.es.channels.xml @@ -0,0 +1,172 @@ + + + LA 1 HD + La 2 HD + 24h horas + TDP HD + Clan HD + Antena 3 HD + Cuatro HD + Telecinco HD + laSexta HD + SELEKT + STAR Channel + AMC + AMC Break + AMC CRIME + Warner TV + AXN + Comedy Central + Calle 13 + XTRM + SYFY + Cosmo + Enfamilia + Decasa + CanalCocina + Runtime Series + FDF + Neox + Energy + Atreseries + Divinity + Nova + Canal Hollywood + AXN Movies + Somos + TCM + Sundance TV + Dark + Runtime Cine y Series + Runtime Thriller/Terror + Runtime Acción + Runtime Comedia + Runtime Crimen + Runtime Romance + RunTime Clásico + Cines Verdi TV + Cine Feel Good + Paramount Network + Dreamworks + Bom Cine + DKISS + Ten + Odisea + Mega + TR3CE + DMAX + La otra HD + Boing + Toon Goggles + Nick JR + Disney Junior + Nick + Be Mad TV + Canal Historia + National Geographic + NatGeo Wild + Discovery + NatureTime + 7RM HD + Levante TV + Canal Sur + CanalSur 2 + Andalucía TV + 7 TV Andalucia + TV3 HD + TV3CAT + 3/24 + TV Castellon + 8 Mediterraneo + A punt HD + IB3 HD + RTV Canaria HD + ETB1 HD + ETB2 HD + ETB3 + ETB4 + ETB Basque + TVG HD + TVG2 HD + TPA HD + Televigo + Galicia TV + TV Ceuta + TVR HD + Navarra TV HD + Navarra TV2 + Telemadrid HD + Real Madrid + SEVILLA FC Televisión + Betis TV + M+ Liga de Campeones + M+ Liga de Campeones 2 + M+ Liga de Campeones 3 + M+ Liga de Campeones 4 + M+ Liga de Campeones 5 + M+ Liga de Campeones 6 + M+ Liga de Campeones 7 + M+ Liga de Campeones 8 + M+ Liga de Campeones 9 + M+ Liga de Campeones 10 + M+ Liga de Campeones 11 + M+ Liga de Campeones 12 + M+ Liga de Campeones 13 + M+ Liga de Campeones 14 + M+ Liga de Campeones 15 + M+ Liga de Campeones 16 + M+ Liga de Campeones 17 + M LALIGA TV UHD + M+ LALIGA TV + M+ LALIGA TV 2 + M+ LALIGATV 3 + M+ LALIGATV 4 + LA LIGA TV + DAZN LALIGA + DAZN LALIGA 2 + LALIGATV HYPERMOTION + LALIGATV HYPERMOTION 2 + LALIGATV HYPERMOTION 3 + GOL PLAY + Mezzo HD + MTV 00s + HIT TV + MTV España + MTV Live + Sol Música + Classica HD + Festival 4K + Djazz + iConcerts + MezzoLiveHD + TRACE Latina + TRACE Urban + Caracol TV + EWTN + Gulli + France 2 + France 5 + Trace Sport Stars + TV5MONDE + Qwest TV + Eurosport 1 + Eurosport 2 + Myzen TV + FightSports + Fight Box HD + Gametoon + Euronews + El Toro TV + Motorvision + Esport3 + BBC World HD + CNN + Deutsche Welle + Al Jazeera + Pro TV + Ubeat + OUTtv + ¡BUENVIAJE! + Tennis Channel + Nautical Channel + diff --git a/sites/orangetv.es/orangetv.es.config.js b/sites/orangetv.es/orangetv.es.config.js new file mode 100644 index 00000000..3efc2795 --- /dev/null +++ b/sites/orangetv.es/orangetv.es.config.js @@ -0,0 +1,77 @@ +const dayjs = require('dayjs') + +const API_PROGRAM_ENDPOINT = 'https://epg.orangetv.orange.es/epg/Smartphone_Android/1_PRO' +const API_CHANNEL_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/GetChannelList?bouquet_id=1&model_external_id=PC&filter_unsupported_channels=false&client=json' +const API_IMAGE_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/images' + + + +module.exports = { + site: 'orangetv.es', + days: 2, + request: { + cache: { + ttl: 60 * 60 * 1000 // 1 hour + } + }, + url({ date }) { + return `${API_PROGRAM_ENDPOINT}/${date.format('YYYYMMDD')}_8h_1.json` + }, + parser: function ({ content, channel }) { + let programs = [] + const items = parseItems(content, channel) + items.forEach(item => { + programs.push({ + title: item.name, + description: item.description, + season: item.seriesSeason || null, + episode: item.episodeId || null, + icon: parseIcon(item), + start: dayjs.utc(item.startDate) || null, + stop: dayjs.utc(item.endDate) || null, + }) + }) + + return programs + }, + async channels() { + const axios = require('axios') + const data = await axios + .get(API_CHANNEL_ENDPOINT) + .then(r => r.data) + .catch(console.log) + return data.response.map(item => { + return { + lang: 'es', + name: item.name, + site_id: item.externalChannelId + } + }) + } +} + +function parseIcon(item){ + + if(item.attachments.length > 0){ + const cover = item.attachments.find(i => i.name === "COVER" || i.name === "cover") + + if(cover) + { + return `${API_IMAGE_ENDPOINT}${cover.value}`; + } + } + + return '' +} + +function parseItems(content, channel) { + const json = typeof content === 'string' ? JSON.parse(content) : content + + const channelData = json.find(i => i.channelExternalId == channel.site_id); + + if(!channelData) + return []; + + + return channelData.programs; +} \ No newline at end of file diff --git a/sites/orangetv.es/readme.md b/sites/orangetv.es/readme.md new file mode 100644 index 00000000..a70e5812 --- /dev/null +++ b/sites/orangetv.es/readme.md @@ -0,0 +1,35 @@ +# orangetv.es + +https://orangetv.orange.es/epg + +### Download the guide + +```sh +npm run grab -- --site=orangetv.es +``` + +### Update channel list + +```sh +npm run channels:parse -- --config=./sites/orangetv.es/orangetv.es.config.js --output=./sites/orangetv.es/orangetv.es.channels.xml +``` + +### Test + +No tests available yet + +### Todo + +Some channels of this provider are not added to the channel database : + +- RuntimeSeries.es +- RuntimeCineSeries.es +- RuntimeCineTerror.es +- RuntimeAccion.es +- RuntimeComedia.es +- RuntimeCrimen.es +- RuntimeRomance.es +- RunTimeClasico.es +- CinesVerdiTV.es +- CineFeelGood.es +- Gametoon.es