mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 09:30:06 -04:00
Merge branch 'iptv-org:master' into issue_2368
This commit is contained in:
commit
0cf0421731
6 changed files with 412 additions and 345 deletions
12
SITES.md
12
SITES.md
|
@ -35,7 +35,7 @@
|
|||
| [directv.com.ar](sites/directv.com.ar) | 🔴 | https://github.com/iptv-org/epg/issues/2248 |
|
||||
| [directv.com.uy](sites/directv.com.uy) | 🟢 | |
|
||||
| [dishtv.in](sites/dishtv.in) | 🟢 | |
|
||||
| [disneystar.com](sites/disneystar.com) | 🟢 | |
|
||||
| [disneystar.com](sites/disneystar.com) | 🔴 | https://github.com/iptv-org/epg/issues/2408 |
|
||||
| [dsmart.com.tr](sites/dsmart.com.tr) | 🟢 | |
|
||||
| [dstv.com](sites/dstv.com) | 🟢 | |
|
||||
| [elcinema.com](sites/elcinema.com) | 🟢 | |
|
||||
|
@ -98,11 +98,11 @@
|
|||
| [nowplayer.now.com](sites/nowplayer.now.com) | 🔴 | https://github.com/iptv-org/epg/issues/2247 |
|
||||
| [nuevosiglo.com.uy](sites/nuevosiglo.com.uy) | 🟢 | |
|
||||
| [nzxmltv.com](sites/nzxmltv.com) | 🟢 | |
|
||||
| [ontvtonight.com](sites/ontvtonight.com) | 🟢 | |
|
||||
| [ontvtonight.com](sites/ontvtonight.com) | 🔴 | https://github.com/iptv-org/epg/issues/2416 |
|
||||
| [osn.com](sites/osn.com) | 🔴 | https://github.com/iptv-org/epg/issues/2282, https://github.com/iptv-org/epg/issues/2358 |
|
||||
| [pbsguam.org](sites/pbsguam.org) | 🟢 | |
|
||||
| [player.ee.co.uk](sites/player.ee.co.uk) | 🟢 | |
|
||||
| [pickx.be](sites/pickx.be) | 🟢 | |
|
||||
| [pickx.be](sites/pickx.be) | 🔴 | https://github.com/iptv-org/epg/issues/2428 |
|
||||
| [playtv.unifi.com.my](sites/playtv.unifi.com.my) | 🟢 | |
|
||||
| [plex.tv](sites/plex.tv) | 🟢 | |
|
||||
| [programacion-tv.elpais.com](sites/programacion-tv.elpais.com) | 🟢 | |
|
||||
|
@ -173,13 +173,13 @@
|
|||
| [tvireland.ie](sites/tvireland.ie) | 🟢 | |
|
||||
| [tvmi.mt](sites/tvmi.mt) | 🟢 | |
|
||||
| [tvmusor.hu](sites/tvmusor.hu) | 🟢 | |
|
||||
| [tvpassport.com](sites/tvpassport.com) | 🟢 | |
|
||||
| [tvpassport.com](sites/tvpassport.com) | 🔴 | https://github.com/iptv-org/epg/issues/2349 |
|
||||
| [tvplus.com.tr](sites/tvplus.com.tr) | 🔴 | https://github.com/iptv-org/epg/issues/2377 |
|
||||
| [tvprofil.com](sites/tvprofil.com) | 🟡 | https://github.com/iptv-org/epg/issues/2399 |
|
||||
| [tvtv.us](sites/tvtv.us) | 🟡 | https://github.com/iptv-org/epg/issues/2357 |
|
||||
| [tvtv.us](sites/tvtv.us) | 🟡 | https://github.com/iptv-org/epg/issues/2357, https://github.com/iptv-org/epg/issues/2353 |
|
||||
| [vidio.com](sites/vidio.com) | 🟢 | |
|
||||
| [virginmediatelevision.ie](sites/virginmediatelevision.ie) | 🟢 | |
|
||||
| [virgintvgo.virginmedia.com](sites/virgintvgo.virginmedia.com) | 🟢 | |
|
||||
| [virgintvgo.virginmedia.com](sites/virgintvgo.virginmedia.com) | 🟡 | https://github.com/iptv-org/epg/issues/2310 |
|
||||
| [visionplus.id](sites/visionplus.id) | 🟢 | |
|
||||
| [vivacom.bg](sites/vivacom.bg) | 🔴 | https://github.com/iptv-org/epg/issues/2270 |
|
||||
| [vtm.be](sites/vtm.be) | 🟢 | |
|
||||
|
|
|
@ -10,41 +10,84 @@ dayjs.extend(timezone)
|
|||
module.exports = {
|
||||
site: 'mediasetinfinity.mediaset.it',
|
||||
days: 2,
|
||||
url: function ({ date, channel }) {
|
||||
url: function ({date, channel}) {
|
||||
// Get the epoch timestamp
|
||||
const todayEpoch = date.startOf('day').utc().valueOf();
|
||||
const todayEpoch = date.startOf('day').utc().valueOf()
|
||||
// Get the epoch timestamp for the next day
|
||||
const nextDayEpoch = date.add(1, 'day').startOf('day').utc().valueOf();
|
||||
const nextDayEpoch = date.add(1, 'day').startOf('day').utc().valueOf()
|
||||
return `https://api-ott-prod-fe.mediaset.net/PROD/play/feed/allListingFeedEpg/v2.0?byListingTime=${todayEpoch}~${nextDayEpoch}&byCallSign=${channel.site_id}`
|
||||
},
|
||||
parser: function ({ content, date }) {
|
||||
const programs = [];
|
||||
const data = JSON.parse(content);
|
||||
parser: function ({content}) {
|
||||
const programs = []
|
||||
const data = JSON.parse(content)
|
||||
|
||||
if (!data.response || !data.response.entries || !data.response.entries[0] || !data.response.entries[0].listings) {
|
||||
// If the structure is not as expected, return an empty array
|
||||
return programs;
|
||||
return programs
|
||||
}
|
||||
|
||||
const listings = data.response.entries[0].listings;
|
||||
const listings = data.response.entries[0].listings
|
||||
|
||||
listings.forEach((listing) => {
|
||||
if (listing.program.title && listing.startTime && listing.endTime) {
|
||||
const start = parseTime(listing.startTime);
|
||||
const stop = parseTime(listing.endTime);
|
||||
const title = listing.mediasetlisting$epgTitle
|
||||
const subTitle = listing.program.title
|
||||
const season = parseSeason(listing)
|
||||
const episode = parseEpisode(listing)
|
||||
|
||||
|
||||
if (listing.program.title && listing.startTime && listing.endTime) {
|
||||
programs.push({
|
||||
title: listing.program.title,
|
||||
description: listing.program.description,
|
||||
start,
|
||||
stop
|
||||
});
|
||||
title: title || subTitle,
|
||||
sub_title: title && title != subTitle ? subTitle : null,
|
||||
description: listing.program.description || null,
|
||||
category: listing.program.mediasetprogram$skyGenre || null,
|
||||
season: episode && !season ? '0' : season,
|
||||
episode: episode,
|
||||
start: parseTime(listing.startTime),
|
||||
stop: parseTime(listing.endTime),
|
||||
image: getMaxResolutionThumbnails(listing)
|
||||
})
|
||||
}
|
||||
});
|
||||
return programs;
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function parseTime(timestamp) {
|
||||
return dayjs(timestamp).utc().format('YYYY-MM-DD HH:mm');
|
||||
return dayjs(timestamp).utc().format('YYYY-MM-DD HH:mm')
|
||||
}
|
||||
|
||||
function parseSeason(item) {
|
||||
if (!item.mediasetlisting$shortDescription) return null
|
||||
const season = item.mediasetlisting$shortDescription.match(/S(\d+)\s/)
|
||||
return season ? season[1] : null
|
||||
}
|
||||
|
||||
function parseEpisode(item) {
|
||||
if (!item.mediasetlisting$shortDescription) return null
|
||||
const episode = item.mediasetlisting$shortDescription.match(/Ep(\d+)\s/)
|
||||
return episode ? episode[1] : null
|
||||
}
|
||||
|
||||
function getMaxResolutionThumbnails(item) {
|
||||
const thumbnails = item.program.thumbnails || null
|
||||
const maxResolutionThumbnails = {}
|
||||
|
||||
for (const key in thumbnails) {
|
||||
const type = key.split('-')[0] // Estrarre il tipo di thumbnail
|
||||
const {width, height, url, title} = thumbnails[key]
|
||||
|
||||
if (!maxResolutionThumbnails[type] ||
|
||||
(width * height > maxResolutionThumbnails[type].width * maxResolutionThumbnails[type].height)) {
|
||||
maxResolutionThumbnails[type] = {width, height, url, title}
|
||||
}
|
||||
}
|
||||
if (maxResolutionThumbnails.image_keyframe_poster)
|
||||
return maxResolutionThumbnails.image_keyframe_poster.url
|
||||
else if (maxResolutionThumbnails.image_header_poster)
|
||||
return maxResolutionThumbnails.image_header_poster.url
|
||||
else
|
||||
return null
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { parser, url } = require('./mediasetinfinity.mediaset.it.config.js')
|
||||
const {parser, url} = require('./mediasetinfinity.mediaset.it.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const dayjs = require('dayjs')
|
||||
|
@ -9,27 +9,32 @@ dayjs.extend(utc)
|
|||
|
||||
const date = dayjs.utc('2024-01-20', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: 'LB',
|
||||
xmltv_id: '20.it'
|
||||
site_id: 'LB', xmltv_id: '20.it'
|
||||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://api-ott-prod-fe.mediaset.net/PROD/play/feed/allListingFeedEpg/v2.0?byListingTime=1705708800000~1705795200000&byCallSign=LB'
|
||||
)
|
||||
expect(url({
|
||||
channel,
|
||||
date
|
||||
})).toBe('https://api-ott-prod-fe.mediaset.net/PROD/play/feed/allListingFeedEpg/v2.0?byListingTime=1705708800000~1705795200000&byCallSign=LB')
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'), 'utf8')
|
||||
const results = parser({ content, date }).map(p => {
|
||||
const results = parser({content, date}).map(p => {
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2024-01-19 22:37',
|
||||
stop: '2024-01-20 00:54',
|
||||
title: 'Independence day: Rigenerazione',
|
||||
description: 'Sequel del film di fantascienza Independence Day, con L. Hemsworth e B. Pullman. Dopo 20 anni la Terra si prepara a subire un secondo, terrificante attacco alieno.',
|
||||
expect(results[3]).toMatchObject({
|
||||
start: '2024-01-20 02:14',
|
||||
stop: '2024-01-20 02:54',
|
||||
title: 'Chicago Fire',
|
||||
sub_title: 'Ep. 22 - Io non ti lascio',
|
||||
description: 'Severide e Kidd continuano a indagare su un vecchio caso doloso di Benny. Notizie inaspettate portano Brett a meditare su una grande decisione.',
|
||||
category: 'Intrattenimento',
|
||||
season: '7',
|
||||
episode: '22',
|
||||
image: 'https://static2.mediasetplay.mediaset.it/Mediaset_Italia_Production_-_Main/F309370301002204/media/0/0/1ef76b73-3173-43bd-9c16-73986a0ec131/46896726-11e7-4438-b947-d2ae53f58c0b.jpg'
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ const dayjs = require('dayjs')
|
|||
|
||||
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
|
||||
const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
|
||||
const API_IMAGE_ENDPOINT = 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service';
|
||||
|
||||
module.exports = {
|
||||
site: 'telenet.tv',
|
||||
|
@ -62,6 +63,7 @@ module.exports = {
|
|||
const detail = await loadProgramDetails(item, channel)
|
||||
programs.push({
|
||||
title: item.title,
|
||||
icon: parseIcon(item),
|
||||
description: detail.longDescription,
|
||||
category: detail.genres,
|
||||
actors: detail.actors,
|
||||
|
@ -92,7 +94,7 @@ module.exports = {
|
|||
|
||||
async function loadProgramDetails(item, channel) {
|
||||
if (!item.id) return {}
|
||||
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
|
||||
const url = `${API_PROD_ENDPOINT}/replayEvent/${item.id}?returnLinearContent=true&language=${channel.lang}`
|
||||
const data = await axios
|
||||
.get(url)
|
||||
.then(r => r.data)
|
||||
|
@ -130,3 +132,7 @@ function parseEpisode(detail) {
|
|||
if (String(detail.episodeNumber).length > 3) return null
|
||||
return detail.episodeNumber
|
||||
}
|
||||
|
||||
function parseIcon(item) {
|
||||
return `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`;
|
||||
}
|
|
@ -9,7 +9,7 @@ dayjs.extend(customParseFormat)
|
|||
dayjs.extend(utc)
|
||||
|
||||
const API_STATIC_ENDPOINT = 'https://static.spark.telenet.tv/eng/web/epg-service-lite/be'
|
||||
const API_PROD_ENDPOINT = 'https://prod.spark.telenet.tv/eng/web/linear-service/v2'
|
||||
const API_PROD_ENDPOINT = 'https://spark-prod-be.gnp.cloud.telenet.tv/eng/web/linear-service/v2'
|
||||
|
||||
jest.mock('axios')
|
||||
|
||||
|
@ -63,6 +63,7 @@ it('can parse response', async () => {
|
|||
start: '2022-10-29T23:56:00.000Z',
|
||||
stop: '2022-10-30T01:44:00.000Z',
|
||||
title: 'Queer as Folk USA',
|
||||
icon: 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service/intent/crid:~~2F~~2Fgn.tv~~2F2459095~~2FEP036477800004,imi:0a2f4207b03c16c70b7fb3be8e07881aafe44106/posterTile',
|
||||
description:
|
||||
"Justin belandt in de gevangenis, Brian en Brandon banen zich een weg door de lijst, Ben treurt, Melanie en Lindsay proberen een interne scheiding en Emmett's stalker onthult zichzelf.",
|
||||
category: ['Dramaserie', 'LHBTI'],
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue