Compare commits

...

9 Commits
1.0.51 ... main

Author SHA1 Message Date
David Claeys
252a7b23aa bugfixes
All checks were successful
Build docker container / build (push) Successful in 10m26s
2025-04-07 09:02:22 +02:00
David Claeys
0a4d9c4452 update readme
All checks were successful
Build docker container / build (push) Successful in 12m5s
2025-04-04 08:25:49 +02:00
David Claeys
6939823646 update readme
All checks were successful
Build docker container / build (push) Successful in 7m3s
2025-03-27 08:32:17 +01:00
David Claeys
60503e87ed update readme
All checks were successful
Build docker container / build (push) Successful in 7m23s
2025-03-20 10:00:44 +01:00
David Claeys
2f732b6dcc update readme
All checks were successful
Build docker container / build (push) Successful in 6m14s
2025-03-11 08:09:05 +01:00
David Claeys
1f999d1c3c update readme
All checks were successful
Build docker container / build (push) Successful in 4m55s
2025-03-07 09:11:14 +01:00
David Claeys
3f5b36a878 update readme
All checks were successful
Build docker container / build (push) Successful in 5m10s
2025-02-26 08:41:29 +01:00
David Claeys
f1c905f5dd update readme
All checks were successful
Build docker container / build (push) Successful in 5m44s
2025-02-18 08:44:54 +01:00
David Claeys
d83069f300 update pickx.be 2025-02-18 08:44:02 +01:00
5 changed files with 97 additions and 103 deletions

View File

@ -52,6 +52,7 @@ RUN apk update \
&& mkdir /public
COPY start.sh $WORKDIR
COPY serve.json $WORKDIR
COPY pm2.config.js $WORKDIR
RUN chmod +x "$START_SCRIPT" \
&& apk del git curl \
&& rm -rf /var/cache/apk/*

View File

@ -193,4 +193,20 @@ Sometimes a new version of this image will be bound to the same source commit. T
- 1.0.50
[02-05-2025](https://github.com/iptv-org/epg/commit/7f6849869f7182ddfa1a01b08a160ff8d2129441)
- 1.0.51
[02-11-2025](https://github.com/iptv-org/epg/commit/6cbe64f2dde47a3eb042cac35932989a7eefb2db)
[02-11-2025](https://github.com/iptv-org/epg/commit/6cbe64f2dde47a3eb042cac35932989a7eefb2db)
- 1.0.52
[02-18-2025](https://github.com/iptv-org/epg/commit/39c4c5143e7cf7591ac49227e73e564be70c7615)
- 1.0.53
[02-23-2025](https://github.com/iptv-org/epg/commit/2721fe1ba06761fd06799a233dda27af6184fd17)
- 1.0.54
[03-07-2025](https://github.com/iptv-org/epg/commit/40c9af82d6f7f4e562cd239237fdf46a396d5728)
- 1.0.55
[03-11-2025](https://github.com/iptv-org/epg/commit/40c9af82d6f7f4e562cd239237fdf46a396d5728)
- 1.0.56
[03-16-2025](https://github.com/iptv-org/epg/commit/cf82b4089ef00c1fc94b7751652bfa598f8ab06a)
- 1.0.57
[03-25-2025](https://github.com/iptv-org/epg/commit/138842009bb3f9135430cdc667502ffa51d4a295)
- 1.0.58
[04-04-2025](https://github.com/iptv-org/epg/commit/4df25c92bcad1e4892640f532eae71cf9f5e7b95)
- 1.0.59
[04-04-2025](https://github.com/iptv-org/epg/commit/4df25c92bcad1e4892640f532eae71cf9f5e7b95)<br>Includes fixes for new configuration changes

View File

@ -2,26 +2,17 @@
const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
let apiVersion
dayjs.extend(utc)
module.exports = {
site: 'pickx.be',
days: 2,
setApiVersion: function (version) {
apiVersion = version
},
getApiVersion: function () {
return apiVersion
},
fetchApiVersion: fetchApiVersion,
url: async function ({ channel, date }) {
async url({ channel, date }) {
if (!apiVersion) {
await fetchApiVersion()
}
return `https://px-epg.azureedge.net/airings/${apiVersion}/${date.format(
'YYYY-MM-DD'
)}/channel/${channel.site_id}?timezone=Europe%2FBrussels`
@ -51,19 +42,21 @@ module.exports = {
episode: item.program.episodeNumber,
actors: item.program.actors,
director: item.program.director ? [item.program.director] : null,
start: dayjs.utc(item.programScheduleStart),
stop: dayjs.utc(item.programScheduleEnd)
start: dayjs(item.programScheduleStart),
stop: dayjs(item.programScheduleEnd)
})
})
}
return programs
},
async channels({ lang = '' }) {
async channels() {
let channels = []
const query = {
operationName: 'getChannels',
variables: {
language: lang,
language: 'fr',
queryParams: {},
id: '0',
params: {
@ -71,96 +64,60 @@ module.exports = {
}
},
query: `query getChannels($language: String!, $queryParams: ChannelQueryParams, $id: String, $params: ChannelParams) {
channels(language: $language, queryParams: $queryParams, id: $id, params: $params) {
id
channelReferenceNumber
name
callLetter
number
logo {
key
url
__typename
}
language
hd
radio
replayable
ottReplayable
playable
ottPlayable
recordable
subscribed
cloudRecordable
catchUpWindowInHours
isOttNPVREnabled
ottNPVRStart
subscription {
channelRef
subscribed
upselling {
upsellable
packages
__typename
}
__typename
}
packages
__typename
}
}`
channels(language: $language, queryParams: $queryParams, id: $id, params: $params) {
id
name
language
radio
}
}`
}
const result = await axios
const data = await axios
.post('https://api.proximusmwc.be/tiams/v3/graphql', query)
.then(r => r.data)
.catch(console.error)
return (
result?.data?.channels
.filter(
channel =>
!channel.radio && (!lang || channel.language === (lang === 'de' ? 'ger' : lang))
)
.map(channel => {
return {
lang: channel.language === 'ger' ? 'de' : channel.language,
site_id: channel.id,
name: channel.name
}
}) || []
)
data.data.channels.forEach(channel => {
let lang = channel.language || 'fr'
if (channel.language === 'ger') lang = 'de'
channels.push({
lang,
site_id: channel.id,
name: channel.name
})
})
return channels
}
}
function fetchApiVersion() {
return new Promise(async (resolve, reject) => {
async function fetchApiVersion() {
const hashUrl = 'https://www.pickx.be/nl/televisie/tv-gids'
const hashData = await axios
.get(hashUrl)
.then(r => {
const re = /"hashes":\["(.*)"\]/
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/'
}
})
return new Promise((resolve, reject) => {
try {
// 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.
const hashUrl = 'https://www.pickx.be/nl/televisie/tv-gids';
const hashData = await axios.get(hashUrl)
.then(r => {
const re = /"hashes":\["(.*)"\]/
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 (response.status === 200) {
apiVersion = response.data.version
resolve()

23
pm2.config.js Normal file
View File

@ -0,0 +1,23 @@
module.exports = {
apps: [
{
name: 'serve',
script: 'npx serve -- public',
instances: 1,
watch: false,
autorestart: true
},
{
name: 'grab',
script: process.env.SITE
? `npm run grab -- --site=${process.env.SITE} ${
process.env.CLANG ? `--lang=${process.env.CLANG}` : ''
} --output=public/guide.xml`
: `npm run grab -- --gzip --channels=channels.xml --output=public/guide.xml`,
cron_restart: process.env.CRON || null,
instances: 1,
watch: false,
autorestart: false
}
]
}

View File

@ -8,7 +8,7 @@ for arg in "$@"; do
days=*) days="${arg#*=}" ;;
max_connections=*) max_connections="${arg#*=}" ;;
enable_fixes=*) enable_fixes="${arg#*=}" ;;
api_url=*) api_url="${arg#*=}" ;;
api_url=*) api_url="${arg#*=}" ;;
esac
done
@ -25,9 +25,6 @@ if [ "$enable_fixes" = true ] ; then
fi
sed -i -E "s/(https:\x2f\x2fiptv-org.github.io\x2fapi$\123filename\125)/$api_url$\123filename\125/g" $work_dir/scripts/core/apiClient.ts
pm2 --name epg start npm -- run serve
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.gz /public/guide.xml.gz
npm run grab --- --channels=channels.xml --cron="$chron_schedule" --maxConnections=$max_connections --days=$days --gzip
pm2-runtime pm2.config.js --name epg --node-args="--no-autorestart --cron-restart="$chron_schedule" --maxConnections=$max_connections --days=$days"