diff --git a/sites/horizon.tv/horizon.tv.config.js b/sites/horizon.tv/horizon.tv.config.js
index de72115c..95d40d80 100644
--- a/sites/horizon.tv/horizon.tv.config.js
+++ b/sites/horizon.tv/horizon.tv.config.js
@@ -1,22 +1,25 @@
const axios = require('axios')
const dayjs = require('dayjs')
-const API_ENDPOINT = `https://legacy-static.oesp.horizon.tv/oesp/v4/DE/deu/web/programschedules`
+const API_ENDPOINT = `https://legacy-static.oesp.horizon.tv/oesp/v4`
module.exports = {
site: 'horizon.tv',
- url: function ({ date }) {
- return `${API_ENDPOINT}/${date.format('YYYYMMDD')}/1`
+ url: function ({ date, channel }) {
+ const [country, lang] = channel.site_id.split('#')
+
+ return `${API_ENDPOINT}/${country}/${lang}/web/programschedules/${date.format('YYYYMMDD')}/1`
},
async parser({ content, channel, date }) {
+ const [country, lang] = channel.site_id.split('#')
let programs = []
let items = parseItems(content, channel)
if (!items.length) return programs
const d = date.format('YYYYMMDD')
const promises = [
- axios.get(`${API_ENDPOINT}/${d}/2`),
- axios.get(`${API_ENDPOINT}/${d}/3`),
- axios.get(`${API_ENDPOINT}/${d}/4`)
+ axios.get(`${API_ENDPOINT}/${country}/${lang}/web/programschedules/${d}/2`),
+ axios.get(`${API_ENDPOINT}/${country}/${lang}/web/programschedules/${d}/3`),
+ axios.get(`${API_ENDPOINT}/${country}/${lang}/web/programschedules/${d}/4`)
]
await Promise.allSettled(promises)
.then(results => {
@@ -37,16 +40,17 @@ module.exports = {
return programs
},
- async channels() {
+ async channels({ country, lang }) {
+ const langs = { deu: 'de', slk: 'sk' }
const data = await axios
- .get(`https://legacy-dynamic.oesp.horizon.tv/oesp/v4/DE/deu/web/channels`)
+ .get(`https://legacy-dynamic.oesp.horizon.tv/oesp/v4/${country}/${lang}/web/channels`)
.then(r => r.data)
.catch(console.log)
return data.channels.map(item => {
return {
- lang: 'de',
- site_id: item.id.replace('lgi-obolite-de-prod-master:65535-', ''),
+ lang: langs[lang],
+ site_id: `${country}#${lang}#${item.stationSchedules[0].station.id}`,
name: item.title
}
})
@@ -62,9 +66,10 @@ function parseStop(item) {
}
function parseItems(content, channel) {
+ const [_, __, channelId] = channel.site_id.split('#')
const data = typeof content === 'string' ? JSON.parse(content) : content
if (!data || !Array.isArray(data.entries)) return []
- const entity = data.entries.find(e => e.o === `lgi-obolite-de-prod-master:${channel.site_id}`)
+ const entity = data.entries.find(e => e.o === channelId)
return entity ? entity.l : []
}
diff --git a/sites/horizon.tv/horizon.tv.test.js b/sites/horizon.tv/horizon.tv.test.js
index ca917b95..ec86e9ae 100644
--- a/sites/horizon.tv/horizon.tv.test.js
+++ b/sites/horizon.tv/horizon.tv.test.js
@@ -1,5 +1,7 @@
-// npm run channels:parse -- --config=./sites/horizon.tv/horizon.tv.config.js --output=./sites/horizon.tv/horizon.tv_de.channels.xml
+// npm run channels:parse -- --config=./sites/horizon.tv/horizon.tv.config.js --output=./sites/horizon.tv/horizon.tv_de.channels.xml --set=country:DE --set=lang:deu
+// npm run channels:parse -- --config=./sites/horizon.tv/horizon.tv.config.js --output=./sites/horizon.tv/horizon.tv_sk.channels.xml --set=country:SK --set=lang:slk
// npx epg-grabber --config=sites/horizon.tv/horizon.tv.config.js --channels=sites/horizon.tv/horizon.tv_de.channels.xml --output=guide.xml --days=2
+// npx epg-grabber --config=sites/horizon.tv/horizon.tv.config.js --channels=sites/horizon.tv/horizon.tv_sk.channels.xml --output=guide.xml --days=2
const { parser, url } = require('./horizon.tv.config.js')
const axios = require('axios')
@@ -13,12 +15,12 @@ jest.mock('axios')
const date = dayjs.utc('2022-03-09', 'YYYY-MM-DD').startOf('d')
const channel = {
- site_id: '123_tv',
+ site_id: 'DE#deu#lgi-obolite-de-prod-master:123_tv',
xmltv_id: '123tv.de'
}
it('can generate valid url', () => {
- expect(url({ date })).toBe(
+ expect(url({ date, channel })).toBe(
'https://legacy-static.oesp.horizon.tv/oesp/v4/DE/deu/web/programschedules/20220309/1'
)
})
diff --git a/sites/horizon.tv/horizon.tv_de.channels.xml b/sites/horizon.tv/horizon.tv_de.channels.xml
index 7c5f40d1..11389469 100644
--- a/sites/horizon.tv/horizon.tv_de.channels.xml
+++ b/sites/horizon.tv/horizon.tv_de.channels.xml
@@ -1,250 +1,250 @@
- 1-2-3.tv
- 13th Street HD
- 3sat
- Al Arabiya
- Al Jazeera
- Antenna TV
- ARD-alpha
- arte
- Astro TV
- ATV Avrupa
- Baby TV
- Balkanika Music Television
- BBC World News
- Beate Uhse HD
- Bibel TV
- BILD HD
- Bloomberg
- BN TV
- Boomerang
- BR Fernsehen Nord
- BR Fernsehen Süd
- BVN
- 24Horas
- Cartoon Network
- CGTN
- CGTN Documentary
- Channel21
- CMC
- CNBC
- CNN
- COMEDY CENTRAL
- Crime + Investigation
- Das Erste
- DELUXE MUSIC
- Deutsches Musik Fernsehen
- DIE NEUE ZEIT TV
- Discovery Channel HD
- Disney HD
- DMAX
- DM SAT
- ERT World
- eSPORTS1 HD
- EURO D
- euronews (D)
- Eurosport1 HD
- EUROSPORT 2
- Eurosport360HD 1
- Eurosport360HD 2
- Eurosport360HD 3
- Eurosport360HD 4
- Eurosport360HD 5
- Eurosport360HD 6
- Eurosport360HD 7
- Eurosport360HD 8
- Eurosport360HD 9
- EURO STAR
- Fashion TV
- Fix&Foxi
- Fox HD
- France 2
- France 24 (in English)
- France 24 (en francais)
- France 3
- France 4
- France 5
- GEO TV HD
- Ginx TV
- Habertürk
- Handystar
- Hayat TV
- Heimatkanal
- HOME & GARDEN TV HD
- The HISTORY Channel
- HopeTV
- hr-fernsehen
- HRT TV 1
- HSE
- HSE Extra
- HSE Trend
- itvn
- JSTV
- Junior
- Juwelo
- kabel eins classics
- Kabel eins HD
- kabel eins Doku
- Kanal 7
- KIKA
- Kinowelt TV HD
- Klan Kosova
- Kohavision TV
- k-tv
- Lust Pur
- MBC Maghreb al Arabia
- MDR Sachsen
- MDR S-Anhalt
- MDR Thüringen HD
- Mediaset
- Motorvision
- MTV
- N24 Doku
- Nasch Kinomir
- NatGeo HD
- National Geographic Wild HD
- NDR FS HH
- NDR FS MV
- NDR FS NDS
- NDR FS SH
- NHK WORLD-JAPAN
- Nick HD
- Nick.Jr.
- Nitro
- Nederland 2
- NRWision HD
- ntv
- NTV Mir
- ONE HD
- OstWest
- Channel One Russia
- phoenix
- Pink Extra
- Pink Film
- Pink FOLK
- Pink Music
- Pink Plus
- ProSieben HD
- ProSieben FUN HD
- ProSieben MAXX
- Pro TV International
- KAZAKH TV
- QVC
- QVC Style
- QVC ZWEI
- Radio Bremen TV
- Rai Uno
- Rai Due
- Rai Tre
- Rai News 24
- Rai Storia
- rbb Berlin
- rbb Brandenburg
- Record Internacional
- RiC
- Romance TV
- RTK1
- RTL Crime HD
- RTL
- RTL Living HD
- RTLup
- RTLZWEI
- Russia Today
- RTPi
- RTR Planeta
- RTS Sat
- RTV21
- SAT.1
- SAT.1 emotions
- SAT.1 GOLD
- SonLife
- ServusTV
- Show Max
- SHOW TURK
- Silverline Movie Channel
- SIXX
- Sky Atlantic HD
- Sky Cinema Action HD
- Sky Cinema Best Of HD
- Sky Cinema Classics
- Sky Cinema Family
- Sky Cinema Fun
- Sky Cinema Premieren HD
- Sky Cinema Premieren +24
- Sky Cinema Special HD
- Sky Cinema Thriller HD
- Sky Comedy HD
- Sky Crime HD
- Sky Documentaries HD
- Sky Krimi HD
- Sky Nature HD
- Sky One HD
- Sky Replay HD
- Sky Serien & Shows HD
- Sky Sport 10 HD
- Sky Sport 11 HD
- Sky Sport 1 HD
- Sky Sport 2 HD
- Sky Sport 3 HD
- Sky Sport 4 HD
- Sky Sport 5 HD
- Sky Sport 6 HD
- Sky Sport 7 HD
- Sky Sport 8 HD
- Sky Sport 9 HD
- Sky Sport Bundesliga 10 HD
- Sky Sport Bundesliga 1 HD
- Sky Sport Bundesliga 2 HD
- Sky Sport Bundesliga 3 HD
- Sky Sport Bundesliga 4 HD
- Sky Sport Bundesliga 5 HD
- Sky Sport Bundesliga 6 HD
- Sky Sport Bundesliga 7 HD
- Sky Sport Bundesliga 8 HD
- Sky Sport Bundesliga 9 HD
- Sky Sport F1 HD
- Sky Sport News HD
- sonnenklar.TV
- SONY AXN
- SONY CHANNEL HD
- Spiegel Geschichte
- Spiegel TV Wissen HD
- Sport1 HD
- Sport1+
- SPORTDIGITAL FUSSBALL
- SR Fernsehen HD
- Super RTL
- SWR BW HD
- SWR Fernsehen RP
- SYFY HD
- tagesschau24 HD
- Tele 5
- Telebom / Tele Dom
- TLC
- TOGGO plus
- TRT Türk
- TV5MONDE Europe
- TV 8
- TV Crne Gore Sat
- TVE Internacional
- TVN 24
- TV Polonia
- iTVS
- Universal TV HD
- Vodafone TV
- VOX
- VOXup
- Warner TV Comedy HD
- Warner TV Film
- Warner TV Serie
- WDR Aachen
- WDR Bonn
- WDR Köln HD
- WELT
- ZDF
- ZDFinfo HD
- zdf_neo
+ 1-2-3.tv
+ 13th Street HD
+ 3sat
+ Al Arabiya
+ Al Jazeera
+ Antenna TV
+ ARD-alpha
+ arte
+ Astro TV
+ ATV Avrupa
+ Baby TV
+ Balkanika Music Television
+ BBC World News
+ Beate Uhse HD
+ Bibel TV
+ BILD HD
+ Bloomberg
+ BN TV
+ Boomerang
+ BR Fernsehen Nord
+ BR Fernsehen Süd
+ BVN
+ 24Horas
+ Cartoon Network
+ CGTN
+ CGTN Documentary
+ Channel21
+ Channel One Russia
+ CMC
+ CNBC
+ CNN
+ COMEDY CENTRAL
+ Crime + Investigation
+ Das Erste
+ DELUXE MUSIC
+ Deutsches Musik Fernsehen
+ DIE NEUE ZEIT TV
+ Discovery Channel HD
+ Disney HD
+ DMAX
+ DM SAT
+ eSPORTS1 HD
+ EURO D
+ euronews (D)
+ Eurosport1 HD
+ EUROSPORT 2
+ Eurosport360HD 1
+ Eurosport360HD 2
+ Eurosport360HD 3
+ Eurosport360HD 4
+ Eurosport360HD 5
+ Eurosport360HD 6
+ Eurosport360HD 7
+ Eurosport360HD 8
+ Eurosport360HD 9
+ EURO STAR
+ Fashion TV
+ Fix&Foxi
+ Fox HD
+ France 2
+ France 24 (in English)
+ France 24 (en francais)
+ France 3
+ France 4
+ France 5
+ GEO TV HD
+ Ginx TV
+ Habertürk
+ Handystar
+ Hayat TV
+ Heimatkanal
+ HOME & GARDEN TV HD
+ The HISTORY Channel
+ HopeTV
+ hr-fernsehen
+ HRT TV 1
+ HSE
+ HSE Extra
+ HSE Trend
+ itvn
+ JSTV
+ Junior
+ Juwelo
+ Kabel eins HD
+ kabel eins classics
+ kabel eins Doku
+ Kanal 7
+ KIKA
+ Kinowelt TV HD
+ Klan Kosova
+ Kohavision TV
+ k-tv
+ Lust Pur
+ MBC Maghreb al Arabia
+ MDR Sachsen
+ MDR S-Anhalt
+ MDR Thüringen HD
+ Mediaset
+ Motorvision
+ MTV
+ N24 Doku
+ Nasch Kinomir
+ NatGeo HD
+ National Geographic Wild HD
+ NDR FS HH
+ NDR FS MV
+ NDR FS NDS
+ NDR FS SH
+ NHK WORLD-JAPAN
+ Nick HD
+ Nick.Jr.
+ Nitro
+ Nederland 2
+ NRWision HD
+ ntv
+ NTV Mir
+ ONE HD
+ OstWest
+ phoenix
+ Pink Extra
+ Pink Film
+ Pink FOLK
+ Pink Music
+ Pink Plus
+ ProSieben FUN HD
+ ProSieben HD
+ ProSieben MAXX
+ Pro TV International
+ KAZAKH TV
+ QVC
+ QVC Style
+ QVC ZWEI
+ Radio Bremen TV
+ Rai Uno
+ Rai Due
+ Rai Tre
+ Rai News 24
+ Rai Storia
+ rbb Berlin
+ rbb Brandenburg
+ Record Internacional
+ RiC
+ Romance TV
+ Russia Today
+ RTK1
+ RTL Crime HD
+ RTL
+ RTL Living HD
+ RTLup
+ RTLZWEI
+ RTPi
+ RTR Planeta
+ RTS Sat
+ RTV21
+ SAT.1 emotions
+ SAT.1
+ SAT.1 GOLD
+ SonLife
+ ServusTV
+ Show Max
+ SHOW TURK
+ Silverline Movie Channel
+ SIXX
+ Sky Atlantic HD
+ Sky Cinema Action HD
+ Sky Cinema Best Of HD
+ Sky Cinema Classics
+ Sky Cinema Family
+ Sky Cinema Fun
+ Sky Cinema Premieren HD
+ Sky Cinema Premieren +24
+ Sky Cinema Special HD
+ Sky Cinema Thriller HD
+ Sky Comedy HD
+ Sky Crime HD
+ Sky Documentaries HD
+ Sky Krimi HD
+ Sky Nature HD
+ Sky One HD
+ Sky Replay HD
+ Sky Serien & Shows HD
+ Sky Sport 10 HD
+ Sky Sport 11 HD
+ Sky Sport 1 HD
+ Sky Sport 2 HD
+ Sky Sport 3 HD
+ Sky Sport 4 HD
+ Sky Sport 5 HD
+ Sky Sport 6 HD
+ Sky Sport 7 HD
+ Sky Sport 8 HD
+ Sky Sport 9 HD
+ Sky Sport Bundesliga 10 HD
+ Sky Sport Bundesliga 1 HD
+ Sky Sport Bundesliga 2 HD
+ Sky Sport Bundesliga 3 HD
+ Sky Sport Bundesliga 4 HD
+ Sky Sport Bundesliga 5 HD
+ Sky Sport Bundesliga 6 HD
+ Sky Sport Bundesliga 7 HD
+ Sky Sport Bundesliga 8 HD
+ Sky Sport Bundesliga 9 HD
+ Sky Sport F1 HD
+ Sky Sport News HD
+ sonnenklar.TV
+ SONY AXN
+ SONY CHANNEL HD
+ Spiegel Geschichte
+ Spiegel TV Wissen HD
+ Sport1 HD
+ Sport1+
+ SPORTDIGITAL FUSSBALL
+ SR Fernsehen HD
+ Super RTL
+ SWR BW HD
+ SWR Fernsehen RP
+ SYFY HD
+ tagesschau24 HD
+ Tele 5
+ Telebom / Tele Dom
+ TLC
+ TOGGO plus
+ TRT Türk
+ TV5MONDE Europe
+ TV 8
+ TV Crne Gore Sat
+ TVE Internacional
+ TVN 24
+ TV Polonia
+ iTVS
+ Universal TV HD
+ Vodafone TV
+ VOX
+ VOXup
+ Warner TV Comedy HD
+ Warner TV Film
+ Warner TV Serie
+ WDR Aachen
+ WDR Bonn
+ WDR Köln HD
+ WELT
+ ZDF
+ ZDFinfo HD
+ zdf_neo
+ ERT World
diff --git a/sites/horizon.tv/horizon.tv_sk.channels.xml b/sites/horizon.tv/horizon.tv_sk.channels.xml
new file mode 100644
index 00000000..89066865
--- /dev/null
+++ b/sites/horizon.tv/horizon.tv_sk.channels.xml
@@ -0,0 +1,188 @@
+
+
+
+ RTVS 24 HD
+ AMC HD
+ Animal Planet HD
+ Magyar ATV
+ Auto Motor Sport
+ BabesTV HD
+ Barrandov Krimi HD
+ Bober
+ Channel One Russia HD
+ CNBC Europe HD
+ CNN Prima News HD
+ Cool TV
+ CS History
+ CS Mystery
+ CT 1 HD
+ CT 24 HD
+ CT 2 HD
+ CT 3 HD
+ CT sport HD
+ Current Time
+ Docubox HD
+ Dom Kino
+ Dom Kino PREMIUM HD
+ ducktv HD
+ Duna
+ Duna World
+ Dvojka HD
+ EroXXX HD
+ Espreso TV
+ Euronews FR
+ Euronews HU
+ Extasy HD
+ Extreme Sports
+ Fast & FunBox HD
+ Fem3
+ Fightbox HD
+ FilmBox Extra HD
+ FilmBox Family
+ FilmBox HD
+ FilmBox Premium HD
+ FilmBox Stars HD
+ Film+ CZ HD
+ Folklorika HD
+ HirTV
+ Hobby TV HD
+ Jednotka HD
+ JOJ 24 HD
+ JOJ Cinema HD
+ Jojko HD
+ JOJ Plus HD
+ JOJ Sport HD
+ WAU HD
+ Carousel
+ Kino Barrandov HD
+ Leo TV HD
+ m1 HD
+ m2
+ m4 Sport HD
+ m5
+ Dajto HD
+ Doma HD
+ Markiza HD
+ Mezzo
+ Minimax
+ Mnam TV HD
+ Mnau TV
+ MTV 00s
+ MTV 80s
+ MTV 90s
+ Muzika Pervogo
+ Muzsika TV
+ Nova International HD
+ Nova Sport 1 HD
+ Nova Sport 2 HD
+ O!
+ ORF 1
+ ORF 2
+ ORF III
+ Park TV
+ Pobeda
+ Poekhali!
+ Prima COOL HD
+ Prima KRIMI HD
+ Prima love HD
+ Prima MAX HD
+ Prima PLUS HD
+ Prima ZOOM HD
+ RELAX
+ Retro Music TV
+ RTL Gold
+ RTL 2
+ RTL Klub
+ RTL+
+ SENZI HD
+ Slager muzika
+ Slager original
+ Slager Premium HD
+ Slager TV
+ Sorozat+
+ Spektrum HD
+ Spektrum home
+ Sport 1 HD
+ Sport 2 HD
+ Sport 5
+ RTVS Sport HD
+ Story 4
+ Super TV2
+ TA3 HD
+ Telecafe
+ Seznam.cz TV HD
+ Trojka HD
+ TRT World
+ TV2
+ TV2Sef
+ TV4
+ TV8
+ Barrandov TV HD
+ JOJ HD
+ TV LUX HD
+ Noe TV HD
+ TV Paprika HU
+ TVP Polonia
+ TV Raj HD
+ TV Ruzinov HD
+ TV Romana
+ UATV
+ Vremja
+ WELT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+