mirror of
https://github.com/iptv-org/epg
synced 2026-03-21 19:30:52 -04:00
Update Init
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,24 +5,33 @@ const utc = require('dayjs/plugin/utc')
|
||||
dayjs.extend(utc)
|
||||
|
||||
const headers = {
|
||||
'X-Apikey': 'xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI',
|
||||
'X-Core-Appversion': '2.20.0.3',
|
||||
'X-Core-Contentratinglimit': '0',
|
||||
'X-Core-Deviceid': '',
|
||||
'X-Core-Devicetype': 'web',
|
||||
Origin: 'https://nostv.pt',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
||||
'accept': 'application/json, text/plain, */*',
|
||||
'accept-language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7,pt;q=0.6,cs;q=0.5',
|
||||
'cache-control': 'no-cache',
|
||||
'origin': 'https://nostv.pt',
|
||||
'pragma': 'no-cache',
|
||||
'priority': 'u=1, i',
|
||||
'referer': 'https://nostv.pt/',
|
||||
'sec-ch-ua': '"Not(A:Brand";v="8", "Chromium";v="144", "Google Chrome";v="144"',
|
||||
'sec-ch-ua-mobile': '?1',
|
||||
'sec-ch-ua-platform': '"Android"',
|
||||
'sec-fetch-dest': 'empty',
|
||||
'sec-fetch-mode': 'cors',
|
||||
'sec-fetch-site': 'cross-site',
|
||||
'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36',
|
||||
'x-apikey': 'xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI',
|
||||
'x-core-appversion': '2.20.2.2',
|
||||
'x-core-contentratinglimit': '0',
|
||||
'x-core-deviceid': '',
|
||||
'x-core-devicetype': 'web',
|
||||
'x-core-timezoneoffset': '3600000'
|
||||
}
|
||||
|
||||
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,7 +40,7 @@ module.exports = {
|
||||
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']}`
|
||||
? `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,
|
||||
@@ -54,7 +63,7 @@ module.exports = {
|
||||
async channels() {
|
||||
const result = await axios
|
||||
.get(
|
||||
`https://api.clg.nos.pt/nostv/ott/channels/guest?client_id=${headers['X-Apikey']}`,
|
||||
`https://api.clg.nos.pt/nostv/ott/channels/guest?client_id=${headers['x-apikey']}`,
|
||||
{ headers }
|
||||
)
|
||||
.then(r => r.data)
|
||||
|
||||
@@ -28,20 +28,17 @@ 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',
|
||||
title: 'Village Vets',
|
||||
description:
|
||||
'A história de dois melhores amigos veterinários e o seu extraordinário trabalho na Austrália.',
|
||||
season: 1,
|
||||
episode: 12,
|
||||
start: '2026-01-23T22:39:00.000Z',
|
||||
stop: '2026-01-24T00:23:00.000Z',
|
||||
title: 'Em Casa d\'Amália',
|
||||
description: 'Que mais poderíamos pedir para o regresso deste programa, do que receber um dos poetas de Amália? Manuel Alegre, autor do icónico "Trova do Vento que Passa", estará connosco. A este raro momento, juntam-se também ilustres convidados: Paulo de Carvalho e o seu filho Agir, Rita Guerra e André Amaro...',
|
||||
season: 9,
|
||||
episode: 15,
|
||||
icon: {
|
||||
src: image
|
||||
src: 'https://mage.stream.nos.pt/mage/v1/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/901d96a8f1534749b076212c296d821e&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
|
||||
},
|
||||
image
|
||||
image: 'https://mage.stream.nos.pt/mage/v1/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/901d96a8f1534749b076212c296d821e&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user