mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 00:20:08 -04:00
Merge pull request #2703 from Aandree5/nostv-icon-image
feat: added icon tag to xml export for nostv
This commit is contained in:
commit
0044f19615
2 changed files with 17 additions and 10 deletions
|
@ -19,11 +19,10 @@ module.exports = {
|
|||
site: 'nostv.pt',
|
||||
days: 2,
|
||||
url({ channel, date }) {
|
||||
return `https://api.clg.nos.pt/nostv/ott/schedule/range/contents/guest?channels=${
|
||||
channel.site_id
|
||||
}&minDate=${date.format('YYYY-MM-DD')}T00:00:00Z&maxDate=${date.format(
|
||||
'YYYY-MM-DD'
|
||||
)}T23:59:59Z&isDateInclusive=true&client_id=${headers['X-Apikey']}`
|
||||
return `https://api.clg.nos.pt/nostv/ott/schedule/range/contents/guest?channels=${channel.site_id
|
||||
}&minDate=${date.format('YYYY-MM-DD')}T00:00:00Z&maxDate=${date.format(
|
||||
'YYYY-MM-DD'
|
||||
)}T23:59:59Z&isDateInclusive=true&client_id=${headers['X-Apikey']}`
|
||||
},
|
||||
request: { headers },
|
||||
parser({ content }) {
|
||||
|
@ -31,15 +30,19 @@ module.exports = {
|
|||
if (content) {
|
||||
const items = Array.isArray(content) ? content : JSON.parse(content)
|
||||
items.forEach(item => {
|
||||
const image = item.Images
|
||||
? `https://mage.stream.nos.pt/mage/v1/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}`
|
||||
: null
|
||||
programs.push({
|
||||
title: item.Metadata?.Title,
|
||||
sub_title: item.Metadata?.SubTitle ? item.Metadata?.SubTitle : null,
|
||||
description: item.Metadata?.Description,
|
||||
season: item.Metadata?.Season,
|
||||
episode: item.Metadata?.Episode,
|
||||
image: item.Images
|
||||
? `https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}`
|
||||
: null,
|
||||
icon: {
|
||||
src: image
|
||||
},
|
||||
image,
|
||||
start: dayjs.utc(item.UtcDateTimeStart),
|
||||
stop: dayjs.utc(item.UtcDateTimeEnd)
|
||||
})
|
||||
|
|
|
@ -28,6 +28,8 @@ it('can parse response', () => {
|
|||
return p
|
||||
})
|
||||
|
||||
const image = 'https://mage.stream.nos.pt/mage/v1/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2023-12-11T16:30:00.000Z',
|
||||
stop: '2023-12-11T17:00:00.000Z',
|
||||
|
@ -36,8 +38,10 @@ it('can parse response', () => {
|
|||
'A história de dois melhores amigos veterinários e o seu extraordinário trabalho na Austrália.',
|
||||
season: 1,
|
||||
episode: 12,
|
||||
image:
|
||||
'https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
|
||||
icon: {
|
||||
src: image
|
||||
},
|
||||
image
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue