Compare commits

..

30 Commits

Author SHA1 Message Date
86e66ede1d update readme and update custom fixes
All checks were successful
Build docker container / build (push) Successful in 15m44s
2026-02-24 12:46:24 +01:00
c113fd0bbc update readme
All checks were successful
Build docker container / build (push) Successful in 10m25s
2026-02-18 12:56:29 +01:00
54f8e6b157 update action 2026-02-18 12:54:40 +01:00
be44be878c change action
All checks were successful
Build docker container / build (push) Successful in 7m33s
2026-02-12 10:17:30 +01:00
1700fbe251 update readme
Some checks failed
Build docker container / build (push) Failing after 1m49s
2026-02-12 08:59:35 +01:00
b760bbdf3e update action 2026-02-12 08:58:18 +01:00
8c609f5515 update action 2026-02-09 15:48:15 +01:00
ff31a3b737 update action 2026-02-09 15:32:40 +01:00
123285107d update action
All checks were successful
Build docker container / build (push) Successful in 8m2s
2026-02-09 10:16:06 +01:00
3d13569146 update action 2026-02-09 09:57:40 +01:00
e9bc6f5246 update action
Some checks failed
Build docker container / build (push) Failing after 6m51s
2026-02-09 09:37:49 +01:00
5c662bae69 update docker action + readme
Some checks failed
Build docker container / build (push) Failing after 7m26s
2026-02-09 09:25:34 +01:00
David Claeys
eece21742c update readme
All checks were successful
Build docker container / build (push) Successful in 8m2s
2026-01-08 13:44:06 +01:00
David Claeys
ee126cf60c update readme
All checks were successful
Build docker container / build (push) Successful in 8m51s
2025-12-24 14:25:57 +01:00
David Claeys
db28863295 update readme
All checks were successful
Build docker container / build (push) Successful in 11m38s
2025-11-26 11:26:24 +01:00
David Claeys
223a4ea6b5 update readme
All checks were successful
Build docker container / build (push) Successful in 7m36s
2025-11-19 10:53:46 +01:00
David Claeys
e6ee948355 update readme
All checks were successful
Build docker container / build (push) Successful in 9m23s
2025-10-09 14:18:30 +02:00
David Claeys
2662567576 update readme
All checks were successful
Build docker container / build (push) Successful in 18m38s
2025-09-25 09:36:24 +02:00
David Claeys
309038bb4a update readme + config
All checks were successful
Build docker container / build (push) Successful in 25m21s
2025-07-15 09:24:34 +02:00
David Claeys
3b019df919 update readme
All checks were successful
Build docker container / build (push) Successful in 8m14s
2025-07-07 08:53:11 +02:00
David Claeys
1cf21ddb98 update readme
All checks were successful
Build docker container / build (push) Successful in 8m52s
2025-06-27 11:15:21 +02:00
David Claeys
0aeb48fe2f update readme
All checks were successful
Build docker container / build (push) Successful in 6m37s
2025-06-17 08:10:34 +02:00
David Claeys
70c7ee79b0 update readme
All checks were successful
Build docker container / build (push) Successful in 8m4s
2025-06-02 11:13:55 +02:00
David Claeys
62937901c2 update readme
All checks were successful
Build docker container / build (push) Successful in 6m34s
2025-05-16 08:42:21 +02:00
David Claeys
4e5a2b4d27 update readme
All checks were successful
Build docker container / build (push) Successful in 6m3s
2025-04-23 08:43:25 +02:00
David Claeys
ab9a8d7160 add delay option
All checks were successful
Build docker container / build (push) Successful in 6m12s
2025-04-14 09:15:43 +02:00
David Claeys
e080a976a6 update readme
All checks were successful
Build docker container / build (push) Successful in 13m7s
2025-04-09 10:23:29 +02:00
David Claeys
252a7b23aa bugfixes
Some checks failed
Build docker container / build (push) Failing after 20m44s
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
11 changed files with 324 additions and 293 deletions

View File

@@ -21,6 +21,64 @@ jobs:
echo "Docker installation not found. Docker will be installed"
curl -fsSL https://get.docker.com | sh
fi
- name: Install npm dependencies
run: |
echo "Installing fetch"
install_node=$false
if ! command -v node &> /dev/null; then
echo "No version of NodeJS detected"
install_node=true
else
node_version=$(node -v)
node_version=${node_version:1} # Remove 'v' at the beginning
node_version=${node_version%\.*} # Remove trailing ".*".
node_version=${node_version%\.*} # Remove trailing ".*".
node_version=$(($node_version)) # Convert the NodeJS version number from a string to an integer.
if [ $node_version -lt 24 ]; then
echo "node version : " $node_version
echo $"removing outdated npm version"
install_node=true
apt-get remove nodejs npm
apt-get purge nodejs
rm -rf /usr/local/bin/npm
rm -rf /usr/local/share/man/man1/node*
rm -rf /usr/local/lib/dtrace/node.d
rm -rf ~/.npm
rm -rf ~/.node-gyp
rm -rf /opt/local/bin/node
rm -rf opt/local/include/node
rm -rf /opt/local/lib/node_modules
rm -rf /usr/local/lib/node*
rm -rf /usr/local/include/node*
rm -rf /usr/local/bin/node*
fi
fi
if $install_node; then
NODE_MAJOR=24
echo "Installing node ${NODE_MAJOR}"
if test -f /etc/apt/keyrings/nodesource.gpg; then
rm /etc/apt/keyrings/nodesource.gpg
fi
if test -f /etc/apt/sources.list.d/nodesource.list; then
rm /etc/apt/sources.list.d/nodesource.list
fi
apt-get update
apt-get install -y -q ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install -y -q nodejs
npm install npm --global
fi
echo "node version : " $(node -v)
package='node-fetch'
if [ `npm list -g | grep -c $package` -eq 0 ]; then
npm install -g $package
fi
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Login to Gitea container registry
@@ -49,6 +107,12 @@ jobs:
tags: |
type=semver,pattern={{raw}}
type=sha
- name: Update docker Hub Description
uses: https://github.com/peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: davidquinonescl/epg-info
- name: Build and push
uses: https://github.com/docker/build-push-action@v5
with:
@@ -56,4 +120,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -4,6 +4,7 @@ ARG GIT_BRANCH=master
ENV CRON_SCHEDULE="0 0,12 * * *"
ENV API_URL="https://iptv-org.github.io/api"
ENV DAYS=14
ENV DELAY=0
ENV MAX_CONNECTIONS=10
ENV ENABLE_FIXES=false
ARG BIN_FOLDER=/bin
@@ -52,9 +53,10 @@ 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/*
SHELL ["/bin/bash", "-c"]
ENTRYPOINT bash $START_SCRIPT chron-schedule="$CRON_SCHEDULE" work-dir="$WORKDIR" days="$DAYS" max_connections="$MAX_CONNECTIONS" enable_fixes="$ENABLE_FIXES" api_url="$API_URL"
ENTRYPOINT bash $START_SCRIPT chron-schedule="$CRON_SCHEDULE" work-dir="$WORKDIR" days="$DAYS" delay=$DELAY max_connections="$MAX_CONNECTIONS" enable_fixes="$ENABLE_FIXES" api_url="$API_URL"
EXPOSE 3000

View File

@@ -56,6 +56,7 @@ It is recommended that you take existing provider code as a base for your custom
|-------------------------------|----------------------------------------------------------------------------|----------------------------------|
| CRON_SCHEDULE | CRON expression describing the recurrence for epg retrieval. | `0 0,12 * * *` |
| DAYS | Describes the desired amount of days in the future for for epg retrieval. | 14 |
| DELAY | Delay between requests in milliseconds | 0 |
| MAX_CONNECTIONS | The maximum amount of parallel connections that can be established | 10 |
| ENABLE_FIXES | Some fixes to providers take a long time to be merged into the main branch.<br>When this option is enabled some of these fixes will also be included.<br>The source code for these fixes can be seen under the `fixes` folder.<br> Recreate the container when changing this variable in order for it to take effect | false |
| API_URL | The endpoint where channel information will be grabbed | `https://iptv-org.github.io/api` |
@@ -204,3 +205,49 @@ Sometimes a new version of this image will be bound to the same source commit. T
[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
- 1.0.60
[04-07-2025](https://github.com/iptv-org/epg/commit/7e1fbcbe154f4efd5c81341351cceb06f71b79a0)
- 1.0.61
[04-07-2025](https://github.com/iptv-org/epg/commit/7e1fbcbe154f4efd5c81341351cceb06f71b79a0)<br>Add delay option
- 1.0.62
[04-22-2025](https://github.com/iptv-org/epg/commit/db56a4d6c0ec7f1169ae60361b623dc032365e47)
- 1.0.63
[05-10-2025](https://github.com/iptv-org/epg/commit/db56a4d6c0ec7f1169ae60361b623dc032365e47)
- 1.0.64
[06-02-2025](https://github.com/iptv-org/epg/commit/cb7e91d3938804618625e381a7fd139e11dfa380)
- 1.0.65
[06-16-2025](https://github.com/iptv-org/epg/commit/e0fdf221e2d2707fe7a9d06a4c2797672888c0eb)
- 1.0.66
[06-26-2025](https://github.com/iptv-org/epg/commit/93f857f3c36cbe00e76fceb4ad875d8e6f6ec6aa)
- 1.0.67
[07-07-2025](https://github.com/iptv-org/epg/commit/3107571168eea356e6fa6311519e3777db99b5a6)
- 1.0.68
[07-14-2025](https://github.com/iptv-org/epg/commit/10685b064d9cc65c1a22234a19527da53d544cbf)
- 1.0.69
[09-21-2025](https://github.com/iptv-org/epg/commit/69774a7e6a2c752d769ad5dfdc41b3fe4baeace1)
- 1.0.70
[10-07-2025](https://github.com/iptv-org/epg/commit/eebfcc8278dc31e9ef17ebbd298d4af061cdc23f)
- 1.0.71
[11-15-2025](https://github.com/iptv-org/epg/commit/4ed1e39d95da18d54628525f9173b7b7f7ae1d21)
- 1.0.72
[11-23-2025](https://github.com/iptv-org/epg/commit/9b331e6cfab19ad2f683b212aa079aac07fe72fe)
- 1.0.73
[12-24-2025](https://github.com/iptv-org/epg/commit/ba1fb58194464a6c50a597ac28a35dc8a4895038)
- 1.0.74
[01-06-2026](https://github.com/iptv-org/epg/commit/cbe17252ca7ef70780600952cf97790f352c8c15)
- 1.0.75
[02-07-2026](https://github.com/iptv-org/epg/commit/c1b3ef5a0e22979ffe06e4e688366eadc05b8537)
- 1.0.76
[02-10-2026](https://github.com/iptv-org/epg/commit/de08d7df85184bb6418cabf56501a9faed2889be)
- 1.0.77
[02-18-2026](https://github.com/iptv-org/epg/commit/a1168b74f5d51a26fdf51129c9af7a296f04b9f6)
- 1.0.78
[02-23-2026](https://github.com/iptv-org/epg/commit/e4f92bb2a2768dcba3dbbd52b19d78d96bebc31e)
<br>Updates custom fixes to latest code
<br>Includes fix for pickx.be provider

View File

@@ -1,31 +1,115 @@
//https://github.com/iptv-org/epg/blob/master/sites/movistarplus.es/movistarplus.es.config.js
const axios = require('axios')
const cheerio = require('cheerio')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const timezone = require('dayjs/plugin/timezone')
dayjs.extend(utc)
dayjs.extend(timezone)
module.exports = {
site: 'movistarplus.es',
days: 2,
url({ channel, date }) {
return `https://www.movistarplus.es/programacion-tv/${channel.site_id}/${date.format(
'YYYY-MM-DD'
)}`
return `https://www.movistarplus.es/programacion-tv/${channel.site_id}/${date.format('YYYY-MM-DD')}`
},
parser({ content }) {
request: {
headers: {
'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: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'es-ES,es;q=0.9,en;q=0.8',
Referer: 'https://www.movistarplus.es/programacion-tv'
},
maxRedirects: 5
},
async parser({ content, date }) {
let programs = []
let items = parseItems(content)
if (!items.length) return programs
items.forEach(el => {
const $ = cheerio.load(content)
const programDivs = $('div[id^="ele-"]').toArray()
for (let i = 0; i < programDivs.length; i++) {
const el = $(programDivs[i])
const title = el.find('li.title').text().trim()
if (!title) continue
const timeText = el.find('li.time').text().trim()
if (!timeText) continue
const [hours, minutes] = timeText.split(':').map(h => parseInt(h, 10))
// Parse time in Spain timezone (Europe/Madrid)
let startDate = dayjs.tz(
`${date.format('YYYY-MM-DD')} ${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`,
'YYYY-MM-DD HH:mm',
'Europe/Madrid'
)
// If the time is in early morning (before 5 AM), it's the next day
if (hours < 5) {
startDate = startDate.add(1, 'day')
}
// Calculate end time from next program's start time
let endDate
if (i < programDivs.length - 1) {
const nextEl = $(programDivs[i + 1])
const nextTimeText = nextEl.find('li.time').text().trim()
if (nextTimeText) {
const [nextHours, nextMinutes] = nextTimeText.split(':').map(h => parseInt(h, 10))
endDate = dayjs.tz(
`${date.format('YYYY-MM-DD')} ${nextHours.toString().padStart(2, '0')}:${nextMinutes.toString().padStart(2, '0')}`,
'YYYY-MM-DD HH:mm',
'Europe/Madrid'
)
// If the next time is in early morning (before 5 AM), it's the next day
if (nextHours < 5) {
endDate = endDate.add(1, 'day')
}
// If end time is still before or same as start time, add another day
if (endDate.isBefore(startDate) || endDate.isSame(startDate)) {
endDate = endDate.add(1, 'day')
}
}
}
// If no end time, use start of next day
if (!endDate) {
endDate = startDate.add(1, 'day').startOf('day')
}
const programLink = el.find('a').attr('href')
let description = null
if (programLink) {
description = await getProgramDescription(programLink).catch(() => null)
}
programs.push({
title: el.item.name,
start: dayjs(el.item.startDate),
stop: dayjs(el.item.endDate)
})
title,
description,
start: startDate,
stop: endDate
})
}
return programs
},
async channels() {
const html = await axios
.get('https://www.movistarplus.es/programacion-tv')
.get('https://www.movistarplus.es/programacion-tv', {
headers: {
'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: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
}
})
.then(r => r.data)
.catch(console.log)
@@ -46,15 +130,17 @@ module.exports = {
}
}
function parseItems(content) {
try {
const $ = cheerio.load(content)
let scheme = $('script:contains("@type": "ItemList")').html()
scheme = JSON.parse(scheme)
if (!scheme || !Array.isArray(scheme.itemListElement)) return []
async function getProgramDescription(programUrl) {
const response = await axios.get(programUrl, {
headers: {
'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',
Referer: 'https://www.movistarplus.es/programacion-tv/'
}
})
return scheme.itemListElement
} catch {
return []
}
const $ = cheerio.load(response.data)
const description = $('.show-content .text p').first().text().trim() || null
return description
}

View File

@@ -1,172 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="orangetv.orange.es" lang="es" xmltv_id="La1.es" site_id="1010">LA 1 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="La2.es" site_id="1062">La 2 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="24Horas.es" site_id="12051">24 Horas</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Teledeporte.es" site_id="1063">TDP HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Clan.es" site_id="1064">Clan HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Antena3.es" site_id="1011">Antena 3 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Cuatro.es" site_id="1012">Cuatro HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Telecinco.es" site_id="1013">Telecinco HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaSexta.es" site_id="1014">laSexta HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Selekt.es" site_id="11045">SELEKT</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="StarChannelSpain.es" site_id="11001">STAR Channel</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AMC.es" site_id="11011">AMC</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AMCBreak.es" site_id="11009">AMC Break</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AMCCrime.es" site_id="11042">AMC CRIME</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="WarnerTV.es" site_id="11007">Warner TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AXN.es" site_id="11002">AXN</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ComedyCentral.es" site_id="11005">Comedy Central</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Calle13Universal.es" site_id="11003">Calle 13</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="XTRM.es" site_id="12057">XTRM</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Syfy.es" site_id="11004">SYFY</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="COSMO.es" site_id="11006">Cosmo</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Enfamilia.es" site_id="11063">Enfamilia</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Decasa.es" site_id="11027">Decasa</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CanalCocina.es" site_id="11020">CanalCocina</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeSeries.es" site_id="11093">Runtime Series</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="FactoriadeFiccion.es" site_id="1032">FDF</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Neox.es" site_id="1027">Neox</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Energy.es" site_id="1030">Energy</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Atreseries.es" site_id="1042">Atreseries</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Divinity.es" site_id="1034">Divinity</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Nova.es" site_id="1028">Nova</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CanalHollywood.es" site_id="11010">Canal Hollywood</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AXNMovies.es" site_id="11008">AXN Movies</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Somos.es" site_id="11029">Somos</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TCM.es" site_id="11012">TCM</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="SundanceTV.es" site_id="11052">Sundance TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Dark.es" site_id="11053">Dark</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeCineSeries.es" site_id="1089">Runtime Cine y Series</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeThriller.es" site_id="11091">Runtime Thriller/Terror</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeAccion.es" site_id="11094">Runtime Acción</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeComedia.es" site_id="11092">Runtime Comedia</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeCrimen.es" site_id="11095">Runtime Crimen</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RuntimeRomance.es" site_id="11096">Runtime Romance</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RunTimeClasicos.es" site_id="11097">RunTime Clásicos</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CinesVerdi.es" site_id="11098">Cines Verdi TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CineFeelGood.es" site_id="11099">Cine Feel Good</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ParamountNetwork.es" site_id="12032">Paramount Network</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DreamWorksChannel.es" site_id="1085">Dreamworks</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="BomCine.es" site_id="2063">Bom Cine</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DKISS.es" site_id="1044">DKISS</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TEN.es" site_id="12054">Ten</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Odisea.es" site_id="11018">Odisea</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Mega.es" site_id="1016">Mega</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Trece.es" site_id="1017">TR3CE</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DMAX.es" site_id="1018">DMAX</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaOtra.es" site_id="2061">La otra HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Boing.es" site_id="1021">Boing</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ToonGogglesenEspanol.us" site_id="11100">Toon Goggles</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NickJr.es" site_id="11055">Nick JR</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DisneyJunior.es" site_id="11015">Disney Junior</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Nickelodeon.es" site_id="11016">Nick</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="BeMad.es" site_id="1043">Be Mad TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Historia.es" site_id="11019">Canal Historia</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NationalGeographic.es" site_id="11017">National Geographic</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NationalGeographicWild.es" site_id="1008">NatGeo Wild</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DiscoveryChannel.es" site_id="1039">Discovery</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NatureTime.es" site_id="1084">NatureTime</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="La7.es" site_id="2011">7RM HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LevanteTV.es" site_id="2070">Levante TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CanalSur.es" site_id="1035">Canal Sur</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CanalSur2.es" site_id="2022">CanalSur 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CanalSurAndalucia.es" site_id="2031">Andalucía TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="7TVAndalucia.e" site_id="2065">7 TV Andalucia</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TV3.es" site_id="2008">TV3 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TV3CAT.es" site_id="1036">TV3CAT</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="324.es" site_id="2050">3/24</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TelevisioCastello.es" site_id="2067">TV Castellon</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="La8Mediterraneo.es" site_id="2062">8 Mediterraneo</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="APunt.es" site_id="2057">A punt HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="IB3.es" site_id="2013">IB3 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TelevisionCanaria.es" site_id="2059">RTV Canaria HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ETB1.es" site_id="2014">ETB1 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ETB2.es" site_id="1037">ETB2 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ETB3.es" site_id="2032">ETB3</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ETB4.es" site_id="2037">ETB4</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ETBBasque.es" site_id="1037">ETB Basque</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="GaliciaTVEuropa.es" site_id="2052">TVG HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TVG2.es" site_id="2053">TVG2 HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TPA7.es" site_id="2009">TPA HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TeleVigo.es" site_id="2068">Televigo</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="GaliciaTVEuropa.es" site_id="1038">Galicia TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CeutaTV.es" site_id="2002">TV Ceuta</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TVR.es" site_id="2055">TVR HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NavarraTV.es" site_id="2060">Navarra TV HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NavarraTV2.es" site_id="2029">Navarra TV2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Telemadrid.es" site_id="12050">Telemadrid HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="RealMadridTV.es" site_id="12052">Real Madrid</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="SevillaFCTV.es" site_id="2081">SEVILLA FC Televisión</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="BetisTV.es" site_id="1019">Betis TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeonesporMovistarPlusPlus.es" site_id="1023">M+ Liga de Campeones</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones1porMovistarPlusPlus.es" site_id="1050">M+ Liga de Campeones 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones2porMovistarPlusPlus.es" site_id="1051">M+ Liga de Campeones 3</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones3porMovistarPlusPlus.es" site_id="1052">M+ Liga de Campeones 4</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones4porMovistarPlusPlus.es" site_id="1053">M+ Liga de Campeones 5</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones5porMovistarPlusPlus.es" site_id="1054">M+ Liga de Campeones 6</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones6porMovistarPlusPlus.es" site_id="1055">M+ Liga de Campeones 7</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones7porMovistarPlusPlus.es" site_id="1056">M+ Liga de Campeones 8</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones8porMovistarPlusPlus.es" site_id="11036">M+ Liga de Campeones 9</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones9porMovistarPlusPlus.es" site_id="1096">M+ Liga de Campeones 10</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones10porMovistarPlusPlus.es" site_id="1097">M+ Liga de Campeones 11</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones11porMovistarPlusPlus.es" site_id="1098">M+ Liga de Campeones 12</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones12porMovistarPlusPlus.es" site_id="1099">M+ Liga de Campeones 13</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones13porMovistarPlusPlus.es" site_id="11065">M+ Liga de Campeones 14</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones14porMovistarPlusPlus.es" site_id="11066">M+ Liga de Campeones 15</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones15porMovistarPlusPlus.es" site_id="11067">M+ Liga de Campeones 16</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LigadeCampeones16porMovistarPlusPlus.es" site_id="11068">M+ Liga de Campeones 17</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaTVUHDporMovistarPlusPlus.es" site_id="11043">M LALIGA TV UHD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaTVporMovistarPlusPlus.es" site_id="11013">M+ LALIGA TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLiga1porMovistarPlusPlus.es" site_id="11026">M+ LALIGA TV 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaTV2porMovistarPlusPlus.es" site_id="1057">M+ LALIGATV 3</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaTV3porMovistarPlusPlus.es" site_id="1058">M+ LALIGATV 4</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaTV.es" site_id="11129">LA LIGA TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DAZNLaLiga.es" site_id="11077">DAZN LALIGA</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DAZNLaLiga2.es" site_id="11080">DAZN LALIGA 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaHypermotion.es" site_id="11083">LALIGATV HYPERMOTION</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaHypermotion2.es" site_id="11084">LALIGATV HYPERMOTION 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="LaLigaHypermotion3.es" site_id="11085">LALIGATV HYPERMOTION 3</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="GOLPLAY.es" site_id="11031">GOL PLAY</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Mezzo.fr" site_id="1031">Mezzo HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="MTV00s.uk" site_id="1026">MTV 00s</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="HITTV.es" site_id="2046">HIT TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="MTV.es" site_id="11050">MTV España</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="MTVLive.us" site_id="11051">MTV Live</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="SolMusica.es" site_id="11119">Sol Música</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="StingrayClassica.ca" site_id="12003">Classica HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="StingrayFestival4K.ca" site_id="11060">Festival 4K</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="StingrayDJAZZ.ca" site_id="12004">Djazz</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="StingrayiConcerts.ca" site_id="12002">iConcerts</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="MezzoLive.fr" site_id="12005">MezzoLiveHD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TraceLatina.fr" site_id="11106">TRACE Latina</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TraceUrban.fr" site_id="11107">TRACE Urban</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CaracolTV.co" site_id="1029">Caracol TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="EWTNEspanaLatinAmerica.us" site_id="1068">EWTN</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Gulli.fr" site_id="1077">Gulli</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="France2.fr" site_id="1082">France 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="France5.fr" site_id="1083">France 5</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TraceSportStars.fr" site_id="1095">Trace Sport Stars</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TV5MondeEurope.fr" site_id="11023">TV5MONDE</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="QwestTV.fr" site_id="1088">Qwest TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Eurosport1.fr" site_id="11035">Eurosport 1</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Eurosport2.fr" site_id="11059">Eurosport 2</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="MyZenTV.fr" site_id="11070">Myzen TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="FightSports.us" site_id="12007">FightSports</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="FightBoxHD.nl" site_id="1091">Fight Box HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Gametoon.es" site_id="1086">Gametoon</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="EuronewsSpanish.fr" site_id="1090">Euronews</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="ElToroTV.es" site_id="11049">El Toro TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Motorvision.de" site_id="11105">Motorvision</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Esport3.es" site_id="2038">Esport3</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="BBCNewsEurope.uk" site_id="11021">BBC World HD</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="CNNInternationalEurope.us" site_id="11022">CNN</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="DWEspanol.de" site_id="11024">Deutsche Welle</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="AlJazeeraEnglish.qa" site_id="11025">Al Jazeera</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="PROTV.ba" site_id="11028">Pro TV</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="Ubeat.es" site_id="11061">Ubeat</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="OUTtv.ca" site_id="11072">OUTtv</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="BUENVIAJE.es" site_id="11112">¡BUENVIAJE!</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="TennisChannel.us" site_id="11120">Tennis Channel</channel>
<channel site="orangetv.orange.es" lang="es" xmltv_id="NauticalChannel.it" site_id="11128">Nautical Channel</channel>
</channels>

View File

@@ -1,3 +1,5 @@
//https://github.com/iptv-org/epg/blob/master/sites/orangetv.orange.es/orangetv.orange.es.config.js
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const doFetch = require('@ntlab/sfetch')
@@ -18,9 +20,12 @@ module.exports = {
request: {
cache: {
ttl: 24 * 60 * 60 * 1000 // 1 day
},
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36'
}
},
url({ date, segment = 1 }) {
url: function({ date, segment = 1 }) {
return `${API_PROGRAM_ENDPOINT}/${date.format('YYYYMMDD')}_8h_${segment}.json`
},
async parser({ content, channel, date }) {

View File

@@ -1,4 +1,4 @@
// 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
//https://github.com/iptv-org/epg/blob/e4f92bb2a2768dcba3dbbd52b19d78d96bebc31e/sites/pickx.be/pickx.be.config.js
const axios = require('axios')
const dayjs = require('dayjs')
@@ -36,7 +36,7 @@ module.exports = {
? item.program.translatedCategory[channel.lang]
: item.program.category.split('.')[1],
image: item.program.posterFileName
? `https://experience-cache.proximustv.be/posterserver/poster/EPG/w-166_h-110/${item.program.posterFileName}`
? `https://experience-cache.cdi.streaming.proximustv.be/posterserver/poster/EPG/${item.program.posterFileName}`
: null,
season: item.program.seasonNumber,
episode: item.program.episodeNumber,

View File

@@ -1,11 +1,11 @@
// credit for this fix goes to davidclaeysquinones for his PR on https://github.com/iptv-org/epg/pull/2429
//https://github.com/iptv-org/epg/blob/e4f92bb2a2768dcba3dbbd52b19d78d96bebc31e/sites/telenet.tv/telenet.tv.config.js
const axios = require('axios')
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';
const API_IMAGE_ENDPOINT = 'https://staticqbr-prod-be.gnp.cloud.telenet.tv/image-service'
module.exports = {
site: 'telenet.tv',
@@ -16,7 +16,7 @@ module.exports = {
}
},
url: function ({ date, channel }) {
return `${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date.format('YYYYMMDDHHmmss')}`
return `${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date.format('YYYYMMDD')}000000`
},
async parser({ content, channel, date }) {
let programs = []
@@ -24,25 +24,19 @@ module.exports = {
if (!items.length) return programs
const promises = [
axios.get(
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date
.add(6, 'h')
.format('YYYYMMDDHHmmss')}`,
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date.format('YYYYMMDD')}060000`,
{
responseType: 'arraybuffer'
}
),
axios.get(
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date
.add(12, 'h')
.format('YYYYMMDDHHmmss')}`,
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date.format('YYYYMMDD')}120000`,
{
responseType: 'arraybuffer'
}
),
axios.get(
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date
.add(18, 'h')
.format('YYYYMMDDHHmmss')}`,
`${API_STATIC_ENDPOINT}/${channel.lang}/events/segments/${date.format('YYYYMMDD')}180000`,
{
responseType: 'arraybuffer'
}
@@ -65,6 +59,7 @@ module.exports = {
const detail = await loadProgramDetails(item, channel)
programs.push({
title: item.title,
subTitle: detail.episodeName,
icon: parseIcon(item),
description: detail.longDescription,
category: detail.genres,
@@ -136,5 +131,5 @@ function parseEpisode(detail) {
}
function parseIcon(item) {
return `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`;
return `${API_IMAGE_ENDPOINT}/intent/${item.id}/posterTile`
}

View File

@@ -1,16 +1,13 @@
// credit for this fix goes to klausellus-wallace for his PR on https://github.com/iptv-org/epg/pull/2458
// https://github.com/iptv-org/epg/blob/e4f92bb2a2768dcba3dbbd52b19d78d96bebc31e/sites/web.magentatv.de/web.magentatv.de.config.js
const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
const fetch = require('node-fetch')
const { upperCase } = require('lodash')
let X_CSRFTOKEN
let COOKIE
let Cookie
const cookiesToExtract = ['JSESSIONID', 'CSESSIONID', 'CSRFSESSION']
const extractedCookies = {}
dayjs.extend(utc)
dayjs.extend(customParseFormat)
@@ -21,10 +18,9 @@ module.exports = {
url: 'https://api.prod.sngtv.magentatv.de/EPG/JSON/PlayBillList',
request: {
method: 'POST',
headers: function () {
return setHeaders()
async headers() {
return await setHeaders()
},
data({ channel, date }) {
return {
count: -1,
@@ -32,7 +28,8 @@ module.exports = {
offset: 0,
properties: [
{
include: 'endtime,genres,id,name,starttime,channelid,pictures,introduce,subName,seasonNum,subNum,cast,country,producedate,externalIds',
include:
'endtime,genres,id,name,starttime,channelid,pictures,introduce,subName,seasonNum,subNum,cast,country,producedate,externalIds',
name: 'playbill'
}
],
@@ -43,8 +40,8 @@ module.exports = {
}
}
},
parser: function ({ content }) {
let programs = []
parser({ content }) {
const programs = []
const items = parseItems(content)
items.forEach(item => {
programs.push({
@@ -60,7 +57,7 @@ module.exports = {
directors: parseDirectors(item),
producers: parseProducers(item),
adapters: parseAdapters(item),
country: upperCase(item.country),
country: item.country?.toUpperCase(),
date: item.producedate,
urls: parseUrls(item)
})
@@ -115,15 +112,15 @@ function parseCategory(item) {
}
function parseDirectors(item) {
if (!item.cast || !item.cast.director) return [];
if (!item.cast || !item.cast.director) return []
return item.cast.director
.replace('und', ',')
.split(',')
.map(i => i.trim());
.map(i => i.trim())
}
function parseProducers(item) {
if (!item.cast || !item.cast.producer) return [];
if (!item.cast || !item.cast.producer) return []
return item.cast.producer
.replace('und', ',')
.split(',')
@@ -131,7 +128,7 @@ function parseProducers(item) {
}
function parseAdapters(item) {
if (!item.cast || !item.cast.adaptor) return [];
if (!item.cast || !item.cast.adaptor) return []
return item.cast.adaptor
.replace('und', ',')
.split(',')
@@ -140,7 +137,7 @@ function parseAdapters(item) {
function parseUrls(item) {
// currently only a imdb id is returned by the api, thus we can construct the url here
if (!item.externalIds) return [];
if (!item.externalIds) return []
return JSON.parse(item.externalIds)
.filter(externalId => externalId.type === 'imdb' && externalId.id)
.map(externalId => ({ system: 'imdb', value: `https://www.imdb.com/title/${externalId.id}` }))
@@ -167,66 +164,52 @@ function parseItems(content) {
return data.playbilllist
}
// Function to try to fetch COOKIE and X_CSRFTOKEN
function fetchCookieAndToken() {
return fetch(
'https://api.prod.sngtv.magentatv.de/EPG/JSON/Authenticate?SID=firstup&T=Windows_chrome_118',
{
headers: {
accept: 'application/json, text/javascript, */*; q=0.01',
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'x-requested-with': 'XMLHttpRequest',
Referer: 'https://web.magentatv.de/',
'Referrer-Policy': 'strict-origin-when-cross-origin'
},
body: '{"terminalid":"00:00:00:00:00:00","mac":"00:00:00:00:00:00","terminaltype":"WEBTV","utcEnable":1,"timezone":"Etc/GMT0","userType":3,"terminalvendor":"Unknown"}',
method: 'POST'
}
)
.then(response => {
// Check if the response status is OK (2xx)
if (!response.ok) {
throw new Error('HTTP request failed')
async function fetchCookieAndToken() {
// Only fetch the cookies and csrfToken if they are not already set
if (X_CSRFTOKEN && Cookie) {
return
}
// Extract the set-cookie header
const setCookieHeader = response.headers.raw()['set-cookie']
try {
const response = await axios.request({
url: 'https://api.prod.sngtv.magentatv.de/EPG/JSON/Authenticate',
params: {
SID: 'firstup',
T: 'Windows_chrome_118'
},
method: 'POST',
data: '{"terminalid":"00:00:00:00:00:00","mac":"00:00:00:00:00:00","terminaltype":"WEBTV","utcEnable":1,"timezone":"Etc/GMT0","userType":3,"terminalvendor":"Unknown"}',
})
// Extract the cookies specified in cookiesToExtract
const setCookieHeader = response.headers['set-cookie'] || []
const extractedCookies = []
cookiesToExtract.forEach(cookieName => {
const regex = new RegExp(`${cookieName}=(.+?)(;|$)`)
const match = setCookieHeader.find(header => regex.test(header))
if (match) {
const cookieValue = regex.exec(match)[1]
extractedCookies[cookieName] = cookieValue
const cookieString = regex.exec(match)[0]
extractedCookies.push(cookieString)
}
})
return response.json()
})
.then(data => {
if (data.csrfToken) {
X_CSRFTOKEN = data.csrfToken
COOKIE = `JSESSIONID=${extractedCookies.JSESSIONID}; CSESSIONID=${extractedCookies.CSESSIONID}; CSRFSESSION=${extractedCookies.CSRFSESSION}; JSESSIONID=${extractedCookies.JSESSIONID};`
} else {
// check if we recieved a csrfToken only then store the values
if (!response.data.csrfToken) {
console.log('csrfToken not found in the response.')
}
})
.catch(error => {
console.error(error)
})
return
}
function setHeaders() {
return fetchCookieAndToken().then(() => {
return {
X_CSRFTOKEN: X_CSRFTOKEN,
'Content-Type': 'application/json',
Cookie: COOKIE
X_CSRFTOKEN = response.data.csrfToken
Cookie = extractedCookies.join(' ')
} catch(error) {
console.error(error)
}
})
}
async function setHeaders() {
await fetchCookieAndToken()
return { X_CSRFTOKEN, Cookie }
}

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_SCHEDULE || null,
instances: 1,
watch: false,
autorestart: false
}
]
}

View File

@@ -6,6 +6,7 @@ for arg in "$@"; do
chron-schedule=*) chron_schedule="${arg#*=}" ;;
work-dir=*) work_dir="${arg#*=}" ;;
days=*) days="${arg#*=}" ;;
delay=*) delay="${arg#*=}" ;;
max_connections=*) max_connections="${arg#*=}" ;;
enable_fixes=*) enable_fixes="${arg#*=}" ;;
api_url=*) api_url="${arg#*=}" ;;
@@ -16,6 +17,7 @@ echo "chron_schedule : ${chron_schedule}"
cd $work_dir
echo "working dir : " $(pwd)
echo "days : ${days}"
echo "delay : ${delay}"
echo "max_connections : ${max_connections}"
echo "enable_fixes : ${enable_fixes}"
echo "api url : ${api_url}"
@@ -25,9 +27,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 --delay=$delay"