From 7684a39b9ca5292e7fa8067a4f037d5030ca370a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Correia?= <37248336+corrreia@users.noreply.github.com> Date: Tue, 28 Oct 2025 22:15:46 +0000 Subject: [PATCH] fix images endpoint --- sites/meo.pt/meo.pt.config.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sites/meo.pt/meo.pt.config.js b/sites/meo.pt/meo.pt.config.js index 439ead16..2208ee93 100644 --- a/sites/meo.pt/meo.pt.config.js +++ b/sites/meo.pt/meo.pt.config.js @@ -39,7 +39,7 @@ module.exports = { let description = '' let image = '' - const programID = item.uniqueId || item.programID || null + const programID = item.uniqueId || null if (programID) { let details = detailsCache.get(programID) if (!details) { @@ -72,7 +72,8 @@ module.exports = { const data = await axios .post('https://authservice.apps.meo.pt/Services/GridTv/GridTvMng.svc/getGridAnon', null, { 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) @@ -135,10 +136,14 @@ async function fetchProgramDetails(programID, axiosInstance) { const program = data?.d if (!program || typeof program !== 'object') return null - // Try different image sizes in order of preference (XL > L > M) - const imageUrl = - program.progImageXL || program.progImageL || program.progImageM || null - const image = imageUrl ? `${imageUrl}.png` : null + // Build image URL using MEO's image handler + let image = null + if (program.progName && program.channelSigla) { + 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 return { description, image }