feat: added icon tag to xml export for nostv, this will allow to work with tools like StreamMaster and Jellyfin

updated nostv image url
This commit is contained in:
Aandree5 2025-02-23 22:36:44 +00:00
parent 2721fe1ba0
commit c021aa3e01

View file

@ -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)
})