provider fixes + version update
This commit is contained in:
parent
4ba2fce7cf
commit
b042f5ac8e
@ -41,8 +41,8 @@ This the list of the provided custom fixes :
|
|||||||
| Provider | Author(s) | Status |
|
| Provider | Author(s) | Status |
|
||||||
|------------------|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| movistarplus.es | [davidclaeysquinones](https://github.com/davidclaeysquinones) | [PR](https://github.com/iptv-org/epg/pull/2440) pending approval |
|
| movistarplus.es | [davidclaeysquinones](https://github.com/davidclaeysquinones) | [PR](https://github.com/iptv-org/epg/pull/2440) pending approval |
|
||||||
| orangetv.es | [fraudiay79](https://github.com/fraudiay79) and [davidclaeysquinones](https://github.com/davidclaeysquinones) | PR not submitted |
|
| orangetv.es | [fraudiay79](https://github.com/fraudiay79) and [davidclaeysquinones](https://github.com/davidclaeysquinones) | [PR](https://github.com/iptv-org/epg/pull/2485) not in draft stage |
|
||||||
| pickx.be | [davidclaeysquinones](https://github.com/davidclaeysquinones) and [BellezaEmporium](https://github.com/BellezaEmporium) | [PR](https://github.com/iptv-org/epg/pull/2520) pending approval |
|
| pickx.be | [davidclaeysquinones](https://github.com/davidclaeysquinones) and [BellezaEmporium](https://github.com/BellezaEmporium) | [PR](https://github.com/iptv-org/epg/pull/2525) merged since commit [fd91a9c] (https://github.com/iptv-org/epg/commit/fd91a9c532b476f6e192a564371d30e766b762ab) |
|
||||||
| telenet.tv | [davidclaeysquinones](https://github.com/davidclaeysquinones) | [PR](https://github.com/iptv-org/epg/pull/2429) merged since commit [fd382db](https://github.com/iptv-org/epg/commit/fd382db08da7a96150928b8dcfef115e29e661d3) |
|
| telenet.tv | [davidclaeysquinones](https://github.com/davidclaeysquinones) | [PR](https://github.com/iptv-org/epg/pull/2429) merged since commit [fd382db](https://github.com/iptv-org/epg/commit/fd382db08da7a96150928b8dcfef115e29e661d3) |
|
||||||
| web.magentatv.de | [klausellus-wallace](https://github.com/klausellus-wallace) | [PR](https://github.com/iptv-org/epg/pull/2458) merged since commit [61afe09](https://github.com/iptv-org/epg/commit/61afe090b6e7892cc5426457d960e9452222f885) |
|
| web.magentatv.de | [klausellus-wallace](https://github.com/klausellus-wallace) | [PR](https://github.com/iptv-org/epg/pull/2458) merged since commit [61afe09](https://github.com/iptv-org/epg/commit/61afe090b6e7892cc5426457d960e9452222f885) |
|
||||||
|
|
||||||
@ -153,4 +153,6 @@ Sometimes a new version of this image will be bound to the same source commit. T
|
|||||||
- 1.0.30
|
- 1.0.30
|
||||||
[12-16-2024](https://github.com/iptv-org/epg/commit/b9bbd32d354315eb292e3b82da09785e575a9781)
|
[12-16-2024](https://github.com/iptv-org/epg/commit/b9bbd32d354315eb292e3b82da09785e575a9781)
|
||||||
- 1.0.31
|
- 1.0.31
|
||||||
[12-17-2024](https://github.com/iptv-org/epg/commit/7237a62d94c5691f7f467b334f846efce93b08ff)<br>Fix for Pickx.be + mayor program updates
|
[12-17-2024](https://github.com/iptv-org/epg/commit/7237a62d94c5691f7f467b334f846efce93b08ff)<br>Fix for Pickx.be + mayor program updates
|
||||||
|
- 1.0.32
|
||||||
|
[12-20-2024](https://github.com/iptv-org/epg/commit/f00d53cb7be3cd7f6625897709cab005fe1b3dc4)
|
@ -1,16 +1,17 @@
|
|||||||
// credit for this fix goes to fraudiay79 and to davidclaeysquinones for their work
|
// credit for this fix goes to fraudiay79, BellezaEmporium and to davidclaeysquinones for their work
|
||||||
// the PR is not submitted since the test suite for this provider needs to be developed
|
// the PR is not submitted since the test suite for this provider needs to be developed
|
||||||
// for now the source code can be found at https://github.com/davidclaeysquinones/epg/tree/orangetv.orange.es
|
// for now the source code can be found at https://github.com/davidclaeysquinones/epg/tree/orangetv.orange.es
|
||||||
|
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
|
const utc = require('dayjs/plugin/utc')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
|
||||||
|
dayjs.extend(utc)
|
||||||
|
|
||||||
const API_PROGRAM_ENDPOINT = 'https://epg.orangetv.orange.es/epg/Smartphone_Android/1_PRO'
|
const API_PROGRAM_ENDPOINT = 'https://epg.orangetv.orange.es/epg/Smartphone_Android/1_PRO'
|
||||||
const API_CHANNEL_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/GetChannelList?bouquet_id=1&model_external_id=PC&filter_unsupported_channels=false&client=json'
|
const API_CHANNEL_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/GetChannelList?bouquet_id=1&model_external_id=PC&filter_unsupported_channels=false&client=json'
|
||||||
const API_IMAGE_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/images'
|
const API_IMAGE_ENDPOINT = 'https://pc.orangetv.orange.es/pc/api/rtv/v1/images'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'orangetv.es',
|
site: 'orangetv.es',
|
||||||
days: 2,
|
days: 2,
|
||||||
@ -23,7 +24,9 @@ module.exports = {
|
|||||||
return `${API_PROGRAM_ENDPOINT}/${date.format('YYYYMMDD')}_8h_1.json`
|
return `${API_PROGRAM_ENDPOINT}/${date.format('YYYYMMDD')}_8h_1.json`
|
||||||
},
|
},
|
||||||
async parser({ content, channel, date }) {
|
async parser({ content, channel, date }) {
|
||||||
let items = []
|
let programs = []
|
||||||
|
let items = parseItems(content, channel)
|
||||||
|
if (!items.length) return programs
|
||||||
|
|
||||||
const promises = [
|
const promises = [
|
||||||
axios.get(
|
axios.get(
|
||||||
@ -37,23 +40,23 @@ module.exports = {
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
await Promise.all(promises)
|
await Promise.allSettled(promises)
|
||||||
.then(results => {
|
.then(results => {
|
||||||
results.forEach(r => {
|
results.forEach(r => {
|
||||||
const responseContent = r.data
|
if (r.status === 'fulfilled') {
|
||||||
items = items.concat(parseItems(responseContent, channel))
|
const parsed = parseItems(r.value.data, channel)
|
||||||
|
|
||||||
|
items = items.filter((item, index) => items.findIndex(oi => oi.id === item.id) === index).concat(parsed)
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
.catch(console.error)
|
||||||
.catch(console.error)
|
|
||||||
|
|
||||||
// remove duplicates
|
|
||||||
items = items.filter((item, index) => items.findIndex(oi => oi.id === item.id) === index);
|
|
||||||
|
|
||||||
let programs = []
|
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.name,
|
title: item.name,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
|
category: parseGenres(item),
|
||||||
season: item.seriesSeason || null,
|
season: item.seriesSeason || null,
|
||||||
episode: item.episodeId || null,
|
episode: item.episodeId || null,
|
||||||
icon: parseIcon(item),
|
icon: parseIcon(item),
|
||||||
@ -94,14 +97,21 @@ function parseIcon(item){
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseGenres(item){
|
||||||
|
return item.genres.map(i => i.name);
|
||||||
|
}
|
||||||
|
|
||||||
function parseItems(content, channel) {
|
function parseItems(content, channel) {
|
||||||
const json = typeof content === 'string' ? JSON.parse(content) : typeof content === 'object' ? content : []
|
const json = typeof content === 'string' ? JSON.parse(content) : Array.isArray(content) ? content : []
|
||||||
|
|
||||||
|
if (!Array.isArray(json)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
const channelData = json.find(i => i.channelExternalId == channel.site_id);
|
const channelData = json.find(i => i.channelExternalId == channel.site_id);
|
||||||
|
|
||||||
if(!channelData)
|
if(!channelData)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
|
|
||||||
return channelData.programs;
|
return channelData.programs;
|
||||||
}
|
}
|
@ -1,33 +1,26 @@
|
|||||||
// credit for this fix goes to davidclaeysquinones for his PR on https://github.com/iptv-org/epg/pull/2430, https://github.com/iptv-org/epg/pull/2520 and to BellezaEmporium for his PR on https://github.com/iptv-org/epg/pull/2480
|
// credit for this fix goes to davidclaeysquinones for his PR on https://github.com/iptv-org/epg/pull/2430, https://github.com/iptv-org/epg/pull/2520 and to BellezaEmporium for his PR on https://github.com/iptv-org/epg/pull/2480, https://github.com/iptv-org/epg/pull/2525
|
||||||
|
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
|
|
||||||
let apiVersion
|
let apiVersion
|
||||||
let isApiVersionFetched = false
|
|
||||||
|
|
||||||
;(async () => {
|
|
||||||
try {
|
|
||||||
await fetchApiVersion()
|
|
||||||
isApiVersionFetched = true
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error during script initialization:', error)
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'pickx.be',
|
site: 'pickx.be',
|
||||||
days: 2,
|
days: 2,
|
||||||
apiVersion: function () {
|
setApiVersion: function (version) {
|
||||||
|
apiVersion = version
|
||||||
|
},
|
||||||
|
getApiVersion: function () {
|
||||||
return apiVersion
|
return apiVersion
|
||||||
},
|
},
|
||||||
fetchApiVersion: fetchApiVersion, // Export fetchApiVersion
|
fetchApiVersion: fetchApiVersion,
|
||||||
url: async function ({ channel, date }) {
|
url: async function ({ channel, date }) {
|
||||||
while (!isApiVersionFetched) {
|
if (!apiVersion) {
|
||||||
await new Promise(resolve => setTimeout(resolve, 100)) // Wait for 100 milliseconds
|
await fetchApiVersion()
|
||||||
}
|
}
|
||||||
return `https://px-epg.azureedge.net/airings/${apiVersion}/${date.format(
|
return `https://px-epg.azureedge.net/airings/${apiVersion}/${date.format(
|
||||||
'YYYY-MM-DD'
|
'YYYY-MM-DD'
|
||||||
@ -118,7 +111,7 @@ module.exports = {
|
|||||||
}`
|
}`
|
||||||
}
|
}
|
||||||
const result = await axios
|
const result = await axios
|
||||||
.post('https://api.proximusmwc.be/tiams/v2/graphql', query)
|
.post('https://api.proximusmwc.be/tiams/v3/graphql', query)
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
||||||
@ -142,7 +135,7 @@ function fetchApiVersion() {
|
|||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
// you'll never find what happened here :)
|
// you'll never find what happened here :)
|
||||||
// load pickx bundle and get react version hash (regex).
|
// load the pickx page and get the hash from the MWC configuration.
|
||||||
// it's not the best way to get the version but it's the only way to get it.
|
// it's not the best way to get the version but it's the only way to get it.
|
||||||
|
|
||||||
const hashUrl = 'https://www.pickx.be/nl/televisie/tv-gids';
|
const hashUrl = 'https://www.pickx.be/nl/televisie/tv-gids';
|
||||||
@ -180,4 +173,4 @@ function fetchApiVersion() {
|
|||||||
reject(error)
|
reject(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user