From f403e5c1d1d9c997570e0cc4195463c4388f90e9 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sun, 19 Apr 2026 02:28:58 +0300 Subject: [PATCH] Update movistarplus.es.config.js --- .../movistarplus.es/movistarplus.es.config.js | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/sites/movistarplus.es/movistarplus.es.config.js b/sites/movistarplus.es/movistarplus.es.config.js index eac40b510..dd4fa193b 100644 --- a/sites/movistarplus.es/movistarplus.es.config.js +++ b/sites/movistarplus.es/movistarplus.es.config.js @@ -29,20 +29,23 @@ module.exports = { items.forEach(el => { programs.push({ - title: el.title, - description: el.description, - season: el.season, - episode: el.episode, - start: el.start, - stop: el.stop - }) + title: el.title, + description: el.description, + icon: el.icon, + images: el.images, + season: el.season, + episode: el.episode, + start: el.start, + stop: el.stop }) + }) return programs - }, async channels() { const json = await axios - .get('https://ottcache.dof6.com/movistarplus/webplayer/OTT/contents/channels?mdrm=true&tlsstream=true&demarcation=18&version=8') + .get( + 'https://ottcache.dof6.com/movistarplus/webplayer/OTT/contents/channels?mdrm=true&tlsstream=true&demarcation=18&version=8' + ) .then(r => r.data) .catch(console.log) @@ -58,45 +61,57 @@ module.exports = { } } +function parseImages(images) { + return images.filter(image => image.id === 'watch2tgr-end').map(image => image.uri) +} + async function parseItems(content) { try { const data = JSON.parse(content) const programs = Array.isArray(data) ? data : [data] - return await Promise.all(programs.map(async (json) => { - const start = dayjs.utc(Number(json?.FechaHoraInicio)) - const stop = dayjs.utc(Number(json?.FechaHoraFin)) - const ficha = json?.Ficha || null - if (!ficha) { - return { - title: json?.Titulo || '', - description: json?.Resena || '', - start, - stop - } - } else { - try { - const fichaJson = await axios.get(ficha).then(r => r.data) - return { - title: json?.Titulo || fichaJson?.Titulo || '', - description: fichaJson?.Descripcion || json?.Resena || '', - actors: fichaJson?.Actores || [], - directors: fichaJson?.Directores || [], - classification: fichaJson?.Clasificacion || '', - season: fichaJson?.Temporada || null, - episode: fichaJson?.NumeroEpisodio || null, - start, - stop - } - } catch { + return await Promise.all( + programs.map(async json => { + const start = dayjs.utc(Number(json?.FechaHoraInicio)) + const stop = dayjs.utc(Number(json?.FechaHoraFin)) + const ficha = json?.Ficha || null + if (!ficha) { return { title: json?.Titulo || '', description: json?.Resena || '', + icon: json?.Imagen || '', + images: json.Imagenes ? parseImages(json.Imagenes) : [], start, stop } + } else { + try { + const fichaJson = await axios.get(ficha).then(r => r.data) + return { + title: json?.Titulo || fichaJson?.Titulo || '', + description: fichaJson?.Descripcion || json?.Resena || '', + icon: fichaJson?.Imagen || '', + images: fichaJson.Imagenes ? parseImages(fichaJson.Imagenes) : [], + actors: fichaJson?.Actores || [], + directors: fichaJson?.Directores || [], + classification: fichaJson?.Clasificacion || '', + season: fichaJson?.Temporada || null, + episode: fichaJson?.NumeroEpisodio || null, + start, + stop + } + } catch { + return { + title: json?.Titulo || '', + description: json?.Resena || '', + icon: json?.Imagen || '', + images: json.Imagenes ? parseImages(json.Imagenes) : [], + start, + stop + } + } } - } - })) + }) + ) } catch { return [] }