mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
fix images endpoint
This commit is contained in:
@@ -39,7 +39,7 @@ module.exports = {
|
|||||||
let description = ''
|
let description = ''
|
||||||
let image = ''
|
let image = ''
|
||||||
|
|
||||||
const programID = item.uniqueId || item.programID || null
|
const programID = item.uniqueId || null
|
||||||
if (programID) {
|
if (programID) {
|
||||||
let details = detailsCache.get(programID)
|
let details = detailsCache.get(programID)
|
||||||
if (!details) {
|
if (!details) {
|
||||||
@@ -72,7 +72,8 @@ module.exports = {
|
|||||||
const data = await axios
|
const data = await axios
|
||||||
.post('https://authservice.apps.meo.pt/Services/GridTv/GridTvMng.svc/getGridAnon', null, {
|
.post('https://authservice.apps.meo.pt/Services/GridTv/GridTvMng.svc/getGridAnon', null, {
|
||||||
headers: {
|
headers: {
|
||||||
Origin: 'https://www.meo.pt'
|
Origin: 'https://www.meo.pt',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; en-US Trident/4.0)'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
@@ -135,10 +136,14 @@ async function fetchProgramDetails(programID, axiosInstance) {
|
|||||||
const program = data?.d
|
const program = data?.d
|
||||||
if (!program || typeof program !== 'object') return null
|
if (!program || typeof program !== 'object') return null
|
||||||
|
|
||||||
// Try different image sizes in order of preference (XL > L > M)
|
// Build image URL using MEO's image handler
|
||||||
const imageUrl =
|
let image = null
|
||||||
program.progImageXL || program.progImageL || program.progImageM || null
|
if (program.progName && program.channelSigla) {
|
||||||
const image = imageUrl ? `${imageUrl}.png` : null
|
const encodedTitle = encodeURIComponent(program.progName)
|
||||||
|
image = `https://proxycache.online.meo.pt/eemstb/ImageHandler.ashx?evTitle=${encodedTitle}&chCallLetter=${program.channelSigla}&profile=16_9&width=600`
|
||||||
|
console.log(image)
|
||||||
|
}
|
||||||
|
|
||||||
const description = program.description || null
|
const description = program.description || null
|
||||||
|
|
||||||
return { description, image }
|
return { description, image }
|
||||||
|
|||||||
Reference in New Issue
Block a user