mirror of
https://github.com/iptv-org/epg
synced 2026-05-06 01:17:02 -04:00
Merge pull request #3082 from iptv-org/update-movistarplus.es
Update movistarplus.es
This commit is contained in:
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
@@ -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 []
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ it('can parse response', async () => {
|
||||
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha.json'), 'utf8'))
|
||||
})
|
||||
} 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({
|
||||
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/ficha2.json'), 'utf8'))
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let results = await parser({ content, date })
|
||||
results = results.map(p => {
|
||||
@@ -55,21 +55,26 @@ it('can parse response', async () => {
|
||||
start: '2026-02-08T21:45:00.000Z',
|
||||
stop: '2026-02-09T00:30:00.000Z',
|
||||
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({
|
||||
start: '2026-02-09T20:30:00.000Z',
|
||||
stop: '2026-02-09T22:00:00.000Z',
|
||||
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 () => {
|
||||
const results = await parser({
|
||||
date,
|
||||
channel,
|
||||
channel,
|
||||
content: '[]'
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user