Merge pull request #3082 from iptv-org/update-movistarplus.es

Update movistarplus.es
This commit is contained in:
PopeyeTheSai10r
2026-04-19 13:33:04 -07:00
committed by GitHub
5 changed files with 63 additions and 4116 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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 []
} }

View File

@@ -34,14 +34,14 @@ it('can parse response', async () => {
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha.json'), 'utf8')) data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha.json'), 'utf8'))
}) })
} else if ( } else if (
url === 'https://ottcache.dof6.com/movistarplus/webplayer/contents/63182873/details?mediaType=FOTOV&profile=OTT&mode=VODREJILLA&channels=SEXTA&version=8&tlsStream=true&mdrm=true&catalog=events&showNonRated=true' url ===
'https://ottcache.dof6.com/movistarplus/webplayer/contents/63182873/details?mediaType=FOTOV&profile=OTT&mode=VODREJILLA&channels=SEXTA&version=8&tlsStream=true&mdrm=true&catalog=events&showNonRated=true'
) { ) {
return Promise.resolve({ return Promise.resolve({
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha2.json'), 'utf8')) data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha2.json'), 'utf8'))
}) })
} }
}) })
let results = await parser({ content, date }) let results = await parser({ content, date })
results = results.map(p => { results = results.map(p => {
@@ -55,21 +55,26 @@ it('can parse response', async () => {
start: '2026-02-08T21:45:00.000Z', start: '2026-02-08T21:45:00.000Z',
stop: '2026-02-09T00:30:00.000Z', stop: '2026-02-09T00:30:00.000Z',
title: 'Especial ARV elecciones Aragón', title: 'Especial ARV elecciones Aragón',
description: 'Antonio García Ferreras y Ana Pastor analizan y debaten sobre el recuento y los resultados que arrojen las urnas con analistas como Lluís Orriols, Antonio Maestre, Ignacio Escolar, Pilar Velasco, Santiago Martínez Vares y Pablo Montesinos.' description:
'Antonio García Ferreras y Ana Pastor analizan y debaten sobre el recuento y los resultados que arrojen las urnas con analistas como Lluís Orriols, Antonio Maestre, Ignacio Escolar, Pilar Velasco, Santiago Martínez Vares y Pablo Montesinos.',
icon: 'https://estatico.emisiondof6.com/recorte/n/dispficha/MSEXTAP4235944',
images: ['https://estatico.emisiondof6.com/recorte/n/vegend/MSEXTAF4235944.jpg']
}) })
expect(results[19]).toMatchObject({ expect(results[19]).toMatchObject({
start: '2026-02-09T20:30:00.000Z', start: '2026-02-09T20:30:00.000Z',
stop: '2026-02-09T22:00:00.000Z', stop: '2026-02-09T22:00:00.000Z',
title: 'El intermedio', title: 'El intermedio',
description: 'El Gran Wyoming, con la ayuda de sus colaboradores, analiza en clave de humor las noticias más importantes del día. El sello inconfundible del cómico sirve para completar la información desde un punto de vista más distendido e irónico.' description:
'El Gran Wyoming, con la ayuda de sus colaboradores, analiza en clave de humor las noticias más importantes del día. El sello inconfundible del cómico sirve para completar la información desde un punto de vista más distendido e irónico.',
icon: 'https://estatico.emisiondof6.com/recorte/n/dispficha/MSEXTAP4236939',
images: ['https://estatico.emisiondof6.com/recorte/n/vegend/MSEXTAF4236939.jpg']
}) })
}) })
it('can handle empty guide', async () => { it('can handle empty guide', async () => {
const results = await parser({ const results = await parser({
date, date,
channel, channel,
content: '[]' content: '[]'
}) })