Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
91ad05ab89 | |||
e9116631d8 | |||
330099049a | |||
06dca856ad | |||
b042f5ac8e | |||
4ba2fce7cf | |||
3c66cce5dd | |||
50ae72364c |
@ -1,4 +1,4 @@
|
|||||||
FROM node:21-alpine
|
FROM node:22-alpine
|
||||||
ARG GIT_REPO=https://github.com/iptv-org/epg.git
|
ARG GIT_REPO=https://github.com/iptv-org/epg.git
|
||||||
ARG GIT_BRANCH=master
|
ARG GIT_BRANCH=master
|
||||||
ENV CRON_SCHEDULE="0 0,12 * * *"
|
ENV CRON_SCHEDULE="0 0,12 * * *"
|
||||||
@ -22,7 +22,7 @@ RUN apk update \
|
|||||||
&& npm install pm2 -g \
|
&& npm install pm2 -g \
|
||||||
&& mkdir $(echo "${BIN_FOLDER}/${EPG_FOLDER}") -p \
|
&& mkdir $(echo "${BIN_FOLDER}/${EPG_FOLDER}") -p \
|
||||||
&& git -C $(echo "${BIN_FOLDER}") clone --depth 1 -b $(echo "${GIT_BRANCH} ${GIT_REPO}") \
|
&& git -C $(echo "${BIN_FOLDER}") clone --depth 1 -b $(echo "${GIT_BRANCH} ${GIT_REPO}") \
|
||||||
&& cd $WORKDIR && npm install && npm update \
|
&& cd $WORKDIR && npm install && npm update \
|
||||||
&& rm .eslintrc.json \
|
&& rm .eslintrc.json \
|
||||||
&& rm -rf .github \
|
&& rm -rf .github \
|
||||||
&& rm -rf .git \
|
&& rm -rf .git \
|
||||||
|
14
README.md
14
README.md
@ -11,7 +11,7 @@ A public mirror is available at https://github.com/davidclaeysquinones/epg-info-
|
|||||||
[pm2](https://www.npmjs.com/package/pm2)<br>
|
[pm2](https://www.npmjs.com/package/pm2)<br>
|
||||||
[serve](https://www.npmjs.com/package/serve)<br>
|
[serve](https://www.npmjs.com/package/serve)<br>
|
||||||
|
|
||||||
The image is based on `node:21-alpine` in order to be more lightweight.
|
The image is based on `node:22-alpine` in order to be more lightweight.
|
||||||
The `pm2` and `serve` packages are used in order to run the application in the container.
|
The `pm2` and `serve` packages are used in order to run the application in the container.
|
||||||
## Docker image
|
## Docker image
|
||||||
|
|
||||||
@ -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) in draft stage |
|
||||||
| pickx.be | [davidclaeysquinones](https://github.com/davidclaeysquinones) and [BellezaEmporium](https://github.com/BellezaEmporium) | [PR](https://github.com/iptv-org/epg/pull/2480) merged since commit [296d616](https://github.com/iptv-org/epg/commit/296d6162ecbeb1b3c3e392845187d30624d50aa2) |
|
| 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) |
|
||||||
|
|
||||||
@ -151,4 +151,10 @@ Sometimes a new version of this image will be bound to the same source commit. T
|
|||||||
- 1.0.29
|
- 1.0.29
|
||||||
[12-11-2024](https://github.com/iptv-org/epg/commit/581f5e0ca94bd6d05c33f53951df078d702b2510)
|
[12-11-2024](https://github.com/iptv-org/epg/commit/581f5e0ca94bd6d05c33f53951df078d702b2510)
|
||||||
- 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
|
||||||
|
[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.0.33
|
||||||
|
[12-21-2024](https://github.com/iptv-org/epg/commit/c108aa586e25d2e8914baeca6c05cc6755718665)
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<channels>
|
<channels>
|
||||||
<!--This is a sample of a channel you can add look at https://github.com/iptv-org/epg/tree/master/sites for the complete list-->
|
<!--This is a sample of a channel you can add look at https://github.com/iptv-org/epg/tree/master/sites for the complete list-->
|
||||||
<channel site="movistarplus.es" lang="es" xmltv_id="24Horas.es" site_id="24H">24 Horas</channel>
|
<channel site="pickx.be" lang="nl" xmltv_id="Een.be" site_id="UID50037">VRT 1</channel>
|
||||||
|
<!--<channel site="movistarplus.es" lang="es" xmltv_id="24Horas.es" site_id="24H">24 Horas</channel>-->
|
||||||
</channels>
|
</channels>
|
@ -24,7 +24,7 @@
|
|||||||
<channel site="orangetv.es" lang="es" xmltv_id="Enfamilia.es" site_id="11063">Enfamilia</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Enfamilia.es" site_id="11063">Enfamilia</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="Decasa.es" site_id="11027">Decasa</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Decasa.es" site_id="11027">Decasa</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="CanalCocina.es" site_id="11020">CanalCocina</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="CanalCocina.es" site_id="11020">CanalCocina</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeSeries.es" site_id="11093">Runtime Series</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVSeries.es" site_id="11093">Runtime Series</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="FactoriadeFiccion.es" site_id="1032">FDF</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="FactoriadeFiccion.es" site_id="1032">FDF</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="Neox.es" site_id="1027">Neox</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Neox.es" site_id="1027">Neox</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="Energy.es" site_id="1030">Energy</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Energy.es" site_id="1030">Energy</channel>
|
||||||
@ -37,13 +37,13 @@
|
|||||||
<channel site="orangetv.es" lang="es" xmltv_id="TCM.es" site_id="11012">TCM</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="TCM.es" site_id="11012">TCM</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="SundanceTV.es" site_id="11052">Sundance TV</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="SundanceTV.es" site_id="11052">Sundance TV</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="Dark.es" site_id="11053">Dark</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Dark.es" site_id="11053">Dark</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeCineSeries.es" site_id="1089">Runtime Cine y Series</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVSeries.es" site_id="1089">Runtime Cine y Series</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeCineTerror.es" site_id="11091">Runtime Thriller/Terror</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeCineTerror.es" site_id="11091">Runtime Thriller/Terror</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeAccion.es" site_id="11094">Runtime Acción</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVCineAccion.es" site_id="11094">Runtime Acción</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeComedia.es" site_id="11092">Runtime Comedia</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVSeriesComedia.es" site_id="11092">Runtime Comedia</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeCrimen.es" site_id="11095">Runtime Crimen</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeCrimen.es" site_id="11095">Runtime Crimen</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RuntimeRomance.es" site_id="11096">Runtime Romance</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVCineRomantico.es" site_id="11096">Runtime Romance</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="RunTimeClasico.es" site_id="11097">RunTime Clásico</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="PlutoTVCineClasico.es" site_id="11097">RunTime Clásico</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="CinesVerdiTV.es" site_id="11098">Cines Verdi TV</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="CinesVerdiTV.es" site_id="11098">Cines Verdi TV</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="CineFeelGood.es" site_id="11099">Cine Feel Good</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="CineFeelGood.es" site_id="11099">Cine Feel Good</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="ParamountNetwork.es" site_id="12032">Paramount Network</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="ParamountNetwork.es" site_id="12032">Paramount Network</channel>
|
||||||
@ -122,8 +122,8 @@
|
|||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV2porMovistarPlusPlus.es" site_id="1057">M+ LALIGATV 3</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV2porMovistarPlusPlus.es" site_id="1057">M+ LALIGATV 3</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV3porMovistarPlusPlus.es" site_id="1058">M+ LALIGATV 4</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV3porMovistarPlusPlus.es" site_id="1058">M+ LALIGATV 4</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV.es" site_id="11129">LA LIGA TV</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaTV.es" site_id="11129">LA LIGA TV</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="DAZNLaLiga" site_id="11077">DAZN LALIGA</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="DAZNLaLiga.es" site_id="11077">DAZN LALIGA</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="DAZNLaLiga2" site_id="11080">DAZN LALIGA 2</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="DAZNLaLiga2.es" site_id="11080">DAZN LALIGA 2</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion.es" site_id="11083">LALIGATV HYPERMOTION</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion.es" site_id="11083">LALIGATV HYPERMOTION</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion2.es" site_id="11084">LALIGATV HYPERMOTION 2</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion2.es" site_id="11084">LALIGATV HYPERMOTION 2</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion3.es" site_id="11085">LALIGATV HYPERMOTION 3</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="LaLigaHypermotion3.es" site_id="11085">LALIGATV HYPERMOTION 3</channel>
|
||||||
@ -145,7 +145,7 @@
|
|||||||
<channel site="orangetv.es" lang="es" xmltv_id="EWTNEspanaLatinAmerica.us" site_id="1068">EWTN</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="EWTNEspanaLatinAmerica.us" site_id="1068">EWTN</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="Gulli.fr" site_id="1077">Gulli</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="Gulli.fr" site_id="1077">Gulli</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="France2.fr" site_id="1082">France 2</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="France2.fr" site_id="1082">France 2</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="France5" site_id="1083">France 5</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="France5.fr" site_id="1083">France 5</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="TraceSportStars.fr" site_id="1095">Trace Sport Stars</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="TraceSportStars.fr" site_id="1095">Trace Sport Stars</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="TV5MondeEurope.fr" site_id="11023">TV5MONDE</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="TV5MondeEurope.fr" site_id="11023">TV5MONDE</channel>
|
||||||
<channel site="orangetv.es" lang="es" xmltv_id="QwestTV.fr" site_id="1088">Qwest TV</channel>
|
<channel site="orangetv.es" lang="es" xmltv_id="QwestTV.fr" site_id="1088">Qwest TV</channel>
|
||||||
|
@ -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 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)
|
||||||
|
|
||||||
@ -141,53 +134,39 @@ module.exports = {
|
|||||||
function fetchApiVersion() {
|
function fetchApiVersion() {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
// load pickx bundle and get react version hash (regex).
|
// you'll never find what happened here :)
|
||||||
|
// 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.
|
||||||
|
|
||||||
// find bundle version
|
const hashUrl = 'https://www.pickx.be/nl/televisie/tv-gids';
|
||||||
const minBundleVer = "https://www.pickx.be/minimal-bundle-version"
|
|
||||||
const bundleVerData = await axios.get(minBundleVer, {
|
const hashData = await axios.get(hashUrl)
|
||||||
headers: {
|
.then(r => {
|
||||||
Origin: 'https://www.pickx.be',
|
const re = /"hashes":\["(.*)"\]/
|
||||||
Referer: 'https://www.pickx.be/'
|
const match = r.data.match(re)
|
||||||
}
|
if (match && match[1]) {
|
||||||
|
return match[1]
|
||||||
|
} else {
|
||||||
|
throw new Error('React app version hash not found')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(console.error);
|
||||||
|
|
||||||
|
const versionUrl = `https://www.pickx.be/api/s-${hashData}`
|
||||||
|
|
||||||
|
const response = await axios.get(versionUrl, {
|
||||||
|
headers: {
|
||||||
|
Origin: 'https://www.pickx.be',
|
||||||
|
Referer: 'https://www.pickx.be/'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (bundleVerData.status !== 200) {
|
if (response.status === 200) {
|
||||||
console.error(`Failed to fetch bundle version. Status: ${bundleVerData.status}`)
|
apiVersion = response.data.version
|
||||||
reject(`Failed to fetch bundle version. Status: ${bundleVerData.status}`)
|
resolve()
|
||||||
} else {
|
} else {
|
||||||
const bundleVer = bundleVerData.data.version
|
console.error(`Failed to fetch API version. Status: ${response.status}`)
|
||||||
// get the minified JS app bundle
|
reject(`Failed to fetch API version. Status: ${response.status}`)
|
||||||
const bundleUrl = `https://components.pickx.be/pxReactPlayer/${bundleVer}/bundle.min.js`
|
|
||||||
|
|
||||||
// now, find the react hash inside the bundle URL
|
|
||||||
const bundle = await axios.get(bundleUrl).then(r => {
|
|
||||||
const re = /REACT_APP_VERSION_HASH:"([^"]+)"/
|
|
||||||
const match = r.data.match(re)
|
|
||||||
if (match && match[1]) {
|
|
||||||
return match[1]
|
|
||||||
} else {
|
|
||||||
throw new Error('React app version hash not found')
|
|
||||||
}
|
|
||||||
}).catch(console.error)
|
|
||||||
|
|
||||||
const versionUrl = `https://www.pickx.be/api/s-${bundle.replace('/REACT_APP_VERSION_HASH:"', '')}`
|
|
||||||
|
|
||||||
const response = await axios.get(versionUrl, {
|
|
||||||
headers: {
|
|
||||||
Origin: 'https://www.pickx.be',
|
|
||||||
Referer: 'https://www.pickx.be/'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (response.status === 200) {
|
|
||||||
apiVersion = response.data.version
|
|
||||||
resolve()
|
|
||||||
} else {
|
|
||||||
console.error(`Failed to fetch API version. Status: ${response.status}`)
|
|
||||||
reject(`Failed to fetch API version. Status: ${response.status}`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error during fetchApiVersion:', error)
|
console.error('Error during fetchApiVersion:', error)
|
||||||
|
4
start.sh
4
start.sh
@ -27,7 +27,7 @@ fi
|
|||||||
sed -i -E "s/(https:\x2f\x2fiptv-org.github.io\x2fapi)/$api_url/g" $work_dir/scripts/core/apiClient.ts
|
sed -i -E "s/(https:\x2f\x2fiptv-org.github.io\x2fapi)/$api_url/g" $work_dir/scripts/core/apiClient.ts
|
||||||
|
|
||||||
pm2 --name epg start npm -- run serve
|
pm2 --name epg start npm -- run serve
|
||||||
npm run grab -- --channels=channels.xml --maxConnections=$max_connections --days=$days --gzip
|
npm run grab --- --channels=channels.xml --maxConnections=$max_connections --days=$days --gzip
|
||||||
ln -s $work_dir/guide.xml /public/guide.xml
|
ln -s $work_dir/guide.xml /public/guide.xml
|
||||||
ln -s $work_dir/guide.xml.gz /public/guide.xml.gz
|
ln -s $work_dir/guide.xml.gz /public/guide.xml.gz
|
||||||
npm run grab -- --channels=channels.xml --cron="$chron_schedule" --maxConnections=$max_connections --days=$days --gzip
|
npm run grab --- --channels=channels.xml --cron="$chron_schedule" --maxConnections=$max_connections --days=$days --gzip
|
Reference in New Issue
Block a user