Update movistarplus.es.config.js

This commit is contained in:
freearhey
2026-04-19 02:28:58 +03:00
parent 5a5798ca0f
commit f403e5c1d1

View File

@@ -29,20 +29,23 @@ module.exports = {
items.forEach(el => { items.forEach(el => {
programs.push({ programs.push({
title: el.title, title: el.title,
description: el.description, description: el.description,
season: el.season, icon: el.icon,
episode: el.episode, images: el.images,
start: el.start, season: el.season,
stop: el.stop episode: el.episode,
}) start: el.start,
stop: el.stop
}) })
})
return programs return programs
}, },
async channels() { async channels() {
const json = await axios 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) .then(r => r.data)
.catch(console.log) .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) { async function parseItems(content) {
try { try {
const data = JSON.parse(content) const data = JSON.parse(content)
const programs = Array.isArray(data) ? data : [data] const programs = Array.isArray(data) ? data : [data]
return await Promise.all(programs.map(async (json) => { return await Promise.all(
const start = dayjs.utc(Number(json?.FechaHoraInicio)) programs.map(async json => {
const stop = dayjs.utc(Number(json?.FechaHoraFin)) const start = dayjs.utc(Number(json?.FechaHoraInicio))
const ficha = json?.Ficha || null const stop = dayjs.utc(Number(json?.FechaHoraFin))
if (!ficha) { const ficha = json?.Ficha || null
return { if (!ficha) {
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 { return {
title: json?.Titulo || '', title: json?.Titulo || '',
description: json?.Resena || '', description: json?.Resena || '',
icon: json?.Imagen || '',
images: json.Imagenes ? parseImages(json.Imagenes) : [],
start, start,
stop 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 { } catch {
return [] return []
} }