From 5d6867fbc1a07d3f94cc0e5e99d4c0529b7287b9 Mon Sep 17 00:00:00 2001
From: theofficialomega <30985701+BellezaEmporium@users.noreply.github.com>
Date: Sun, 17 Aug 2025 16:11:44 +0200
Subject: [PATCH] fusion allente configurations into one
---
sites/allente.dk/__data__/content.json | 1 -
sites/allente.dk/__data__/no_content.json | 1 -
sites/allente.dk/allente.dk.channels.xml | 77 ---------------
sites/allente.dk/allente.dk.config.js | 65 -------------
sites/allente.dk/allente.dk.test.js | 51 ----------
sites/allente.dk/readme.md | 21 ----
sites/allente.fi/__data__/content.json | 1 -
sites/allente.fi/__data__/no_content.json | 1 -
sites/allente.fi/allente.fi.channels.xml | 74 ---------------
sites/allente.fi/allente.fi.config.js | 65 -------------
sites/allente.fi/allente.fi.test.js | 51 ----------
sites/allente.fi/readme.md | 21 ----
sites/allente.no/allente.no.channels.xml | 87 -----------------
sites/allente.no/allente.no.config.js | 31 +++---
sites/allente.no/allente.no.test.js | 12 ++-
sites/allente.no/allente.no_dk.channels.xml | 75 +++++++++++++++
sites/allente.no/allente.no_fi.channels.xml | 71 ++++++++++++++
sites/allente.no/allente.no_no.channels.xml | 85 +++++++++++++++++
sites/allente.no/allente.no_se.channels.xml | 100 ++++++++++++++++++++
sites/allente.se/__data__/content.json | 1 -
sites/allente.se/__data__/no_content.json | 1 -
sites/allente.se/allente.se.channels.xml | 95 -------------------
sites/allente.se/allente.se.config.js | 65 -------------
sites/allente.se/allente.se.test.js | 51 ----------
sites/allente.se/readme.md | 21 ----
25 files changed, 357 insertions(+), 767 deletions(-)
delete mode 100644 sites/allente.dk/__data__/content.json
delete mode 100644 sites/allente.dk/__data__/no_content.json
delete mode 100644 sites/allente.dk/allente.dk.channels.xml
delete mode 100644 sites/allente.dk/allente.dk.config.js
delete mode 100644 sites/allente.dk/allente.dk.test.js
delete mode 100644 sites/allente.dk/readme.md
delete mode 100644 sites/allente.fi/__data__/content.json
delete mode 100644 sites/allente.fi/__data__/no_content.json
delete mode 100644 sites/allente.fi/allente.fi.channels.xml
delete mode 100644 sites/allente.fi/allente.fi.config.js
delete mode 100644 sites/allente.fi/allente.fi.test.js
delete mode 100644 sites/allente.fi/readme.md
delete mode 100644 sites/allente.no/allente.no.channels.xml
create mode 100644 sites/allente.no/allente.no_dk.channels.xml
create mode 100644 sites/allente.no/allente.no_fi.channels.xml
create mode 100644 sites/allente.no/allente.no_no.channels.xml
create mode 100644 sites/allente.no/allente.no_se.channels.xml
delete mode 100644 sites/allente.se/__data__/content.json
delete mode 100644 sites/allente.se/__data__/no_content.json
delete mode 100644 sites/allente.se/allente.se.channels.xml
delete mode 100644 sites/allente.se/allente.se.config.js
delete mode 100644 sites/allente.se/allente.se.test.js
delete mode 100644 sites/allente.se/readme.md
diff --git a/sites/allente.dk/__data__/content.json b/sites/allente.dk/__data__/content.json
deleted file mode 100644
index bdac9a55..00000000
--- a/sites/allente.dk/__data__/content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"channels":[{"id":"0148","icon":"//images.ctfassets.net/989y85n5kcxs/5uT9g9pdQWRZeDPQXVI9g6/9cc44da567f591822ed645c99ecdcb64/SVT_1_black_new__2_.png","name":"SVT1 HD (T)","events":[{"id":"0086202208220710","live":false,"time":"2022-08-22T07:10:00Z","title":"Hemmagympa med Sofia","details":{"title":"Hemmagympa med Sofia","image":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440","description":"Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.","season":4,"episode":1,"categories":["other"],"duration":"20"}}]}]}
\ No newline at end of file
diff --git a/sites/allente.dk/__data__/no_content.json b/sites/allente.dk/__data__/no_content.json
deleted file mode 100644
index 793e8706..00000000
--- a/sites/allente.dk/__data__/no_content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"date":"2001-11-17","categories":[],"channels":[]}
\ No newline at end of file
diff --git a/sites/allente.dk/allente.dk.channels.xml b/sites/allente.dk/allente.dk.channels.xml
deleted file mode 100644
index 1dea3a03..00000000
--- a/sites/allente.dk/allente.dk.channels.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
- Nickelodeon (Nordic) (T)
- SVT1 HD (T)
- V sport live 1 (T)
- V sport live 2 (T)
- V sport live 3 (T)
- V sport live 4 (T)
- V sport live 5 (T)
- SVT2 HD (T)
- NRK2 HD (T)
- NRK3/ NRK Super HD (T)
- Viasat Nature HD (T)
- Sky News (T)
- Horse & Country HD -IP
- TV 2 Sport X HD (D) (T)
- SkyShowtime 2 (T)
- SkyShowtime 1 (T)
- HISTORY HD (N/D/F) (T)
- HISTORY 2 HD (T)
- Animal Planet HD (T)
- Discovery Science (T)
- DW English (T)
- Bloomberg (T)
- MOTORVISION TV HD (T)
- ID Investigation Discovery (D) (T)
- TLC Danmark (T)
- Sport Live (D) (T)
- BBC Nordic HD (S/D/F) (T)
- France 24 (T)
- Discovery Channel HD (D) (T)
- Eurosport 1 HD (D) (T)
- 6'eren HD (D) (T)
- Al Jazeera English -OTT
- BBC News (T)
- Cartoonito (T)
- CANAL9 HD (D) (T)
- Cartoon Network (T)
- CNBC (T)
- CNN (T)
- dk4 (T)
- DR1 HD (T)
- DR2 HD (T)
- DR Ramasjang (T)
- Eurosport 2 HD (D) (T)
- Kanal 4 HD (D) (T)
- Kanal 5 HD (D) (T)
- MTV 00s (T)
- MTV 80s (T)
- MTV (Nordic) (T)
- National Geographic HD (D) (T)
- Nick Jr. (T)
- Nicktoons (T)
- NRK1 HD (T)
- TV 2 HD (D) (T)
- TV 2 Charlie HD (D) (T)
- TV 2 Fri HD (D) (T)
- TV 2 News HD (D) (T)
- TV 2 Sport HD (D) (T)
- TV 2 Echo HD (D) (T)
- TV3 HD (D) (T)
- TV3 MAX HD (D) (T)
- TV3+ HD (D) (T)
- TV3 Puls HD (D) (T)
- TV3 Sport HD (D) (T)
- TV4 HD (T)
- V film action HD (T)
- V film family (T)
- V film hits HD (T)
- V film premiere HD (T)
- Viasat Explore HD (T)
- Viasat History HD (T)
- V series HD (T)
- V sport golf HD (T)
- V sport ultra HD (T)
- See (D) (T)
-
\ No newline at end of file
diff --git a/sites/allente.dk/allente.dk.config.js b/sites/allente.dk/allente.dk.config.js
deleted file mode 100644
index 5e80b7b0..00000000
--- a/sites/allente.dk/allente.dk.config.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const dayjs = require('dayjs')
-
-module.exports = {
- site: 'allente.dk',
- days: 2,
- request: {
- cache: {
- ttl: 60 * 60 * 1000 // 1 hour
- }
- },
- url({ date }) {
- return `https://cs-vcb.allente.dk/epg/events?date=${date.format('YYYY-MM-DD')}`
- },
- parser({ content, channel }) {
- let programs = []
- const items = parseItems(content, channel)
- items.forEach(item => {
- if (!item.details) return
- const start = dayjs(item.time)
- const stop = start.add(item.details.duration, 'm')
- programs.push({
- title: item.title,
- category: item.details.categories,
- description: item.details.description,
- image: item.details.image,
- season: parseSeason(item),
- episode: parseEpisode(item),
- start,
- stop
- })
- })
-
- return programs
- },
- async channels() {
- const axios = require('axios')
- const data = await axios
- .get(`https://cs-vcb.allente.dk/epg/events?date=${dayjs().format('YYYY-MM-DD')}`)
- .then(r => r.data)
- .catch(console.log)
-
- return data.channels.map(item => {
- return {
- lang: 'da',
- site_id: item.id,
- name: item.name
- }
- })
- }
-}
-
-function parseItems(content, channel) {
- const data = JSON.parse(content)
- if (!data || !Array.isArray(data.channels)) return []
- const channelData = data.channels.find(i => i.id === channel.site_id)
-
- return channelData && Array.isArray(channelData.events) ? channelData.events : []
-}
-
-function parseSeason(item) {
- return item.details.season || null
-}
-function parseEpisode(item) {
- return item.details.episode || null
-}
diff --git a/sites/allente.dk/allente.dk.test.js b/sites/allente.dk/allente.dk.test.js
deleted file mode 100644
index e6f0caa9..00000000
--- a/sites/allente.dk/allente.dk.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const { parser, url } = require('./allente.dk.config.js')
-const dayjs = require('dayjs')
-const utc = require('dayjs/plugin/utc')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-const { readFileSync } = require('fs')
-const { resolve } = require('path')
-dayjs.extend(customParseFormat)
-dayjs.extend(utc)
-
-const date = dayjs.utc('2021-11-17', 'YYYY-MM-DD').startOf('d')
-const channel = {
- site_id: '0148',
- xmltv_id: 'SVT1.se'
-}
-
-it('can generate valid url', () => {
- expect(url({ date, channel })).toBe('https://cs-vcb.allente.dk/epg/events?date=2021-11-17')
-})
-
-it('can parse response', () => {
- const content = readFileSync(resolve(__dirname, '__data__/content.json'))
- const result = parser({ content, channel }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(result).toMatchObject([
- {
- start: '2022-08-22T07:10:00.000Z',
- stop: '2022-08-22T07:30:00.000Z',
- title: 'Hemmagympa med Sofia',
- category: ['other'],
- description:
- 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
- image:
- 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
- season: 4,
- episode: 1
- }
- ])
-})
-
-it('can handle empty guide', () => {
- const result = parser({
- date,
- channel,
- content: '{"date":"2001-11-17","categories":[],"channels":[]}'
- })
- expect(result).toMatchObject([])
-})
diff --git a/sites/allente.dk/readme.md b/sites/allente.dk/readme.md
deleted file mode 100644
index cb60865d..00000000
--- a/sites/allente.dk/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# allente.dk
-
-https://www.allente.dk/tv-guide/
-
-### Download the guide
-
-```sh
-npm run grab --- --site=allente.dk
-```
-
-### Update channel list
-
-```sh
-npm run channels:parse --- --config=./sites/allente.dk/allente.dk.config.js --output=./sites/allente.dk/allente.dk.channels.xml
-```
-
-### Test
-
-```sh
-npm test --- allente.dk
-```
diff --git a/sites/allente.fi/__data__/content.json b/sites/allente.fi/__data__/content.json
deleted file mode 100644
index bdac9a55..00000000
--- a/sites/allente.fi/__data__/content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"channels":[{"id":"0148","icon":"//images.ctfassets.net/989y85n5kcxs/5uT9g9pdQWRZeDPQXVI9g6/9cc44da567f591822ed645c99ecdcb64/SVT_1_black_new__2_.png","name":"SVT1 HD (T)","events":[{"id":"0086202208220710","live":false,"time":"2022-08-22T07:10:00Z","title":"Hemmagympa med Sofia","details":{"title":"Hemmagympa med Sofia","image":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440","description":"Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.","season":4,"episode":1,"categories":["other"],"duration":"20"}}]}]}
\ No newline at end of file
diff --git a/sites/allente.fi/__data__/no_content.json b/sites/allente.fi/__data__/no_content.json
deleted file mode 100644
index 793e8706..00000000
--- a/sites/allente.fi/__data__/no_content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"date":"2001-11-17","categories":[],"channels":[]}
\ No newline at end of file
diff --git a/sites/allente.fi/allente.fi.channels.xml b/sites/allente.fi/allente.fi.channels.xml
deleted file mode 100644
index 6da58a2c..00000000
--- a/sites/allente.fi/allente.fi.channels.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
- BBC News (T)
- Nickelodeon (Nordic) (T)
- SVT Barn HD (T)
- SVT1 HD (T)
- Kunskapskanalen HD (T)
- V sport+ Suomi HD (T)
- SVT2 HD (T)
- Al Jazeera English -OTT
- Viasat Nature HD (T)
- Viasat History HD (T)
- Viasat Explore HD (T)
- Nicktoons (T)
- Sky News (T)
- MTV 80s (T)
- Horse & Country HD -IP
- YLE 1 (F) (T)
- YLE 2 (F) (T)
- YLE Teema & Fem (F) (T)
- MTV Aitio (F) (T)
- MTV Viihde (F) (T)
- SF Kanalen (T)
- SkyShowtime 2 (T)
- SkyShowtime 1 (T)
- HISTORY HD (N/D/F) (T)
- HISTORY 2 HD (T)
- Animal Planet HD (T)
- Discovery Science (T)
- DW English (T)
- Bloomberg (T)
- MOTORVISION TV HD (T)
- ID Investigation Discovery (N/F) (T)
- BBC Nordic HD (S/D/F) (T)
- Eurosport 2 HD (S/F) (T)
- France 24 (T)
- MTV3 HD (F) (T)
- Nelonen (F) (T)
- MTV Sub (F) (T)
- TV5 (F) (T)
- liv (F) (T)
- JIM (F) (T)
- Discovery Channel (F) (T)
- MTV Juniori (F) (T)
- MTV Max HD (F) (T)
- MTV Urheilu 1 HD (F) (T)
- MTV Urheilu 2 HD (F) (T)
- Eurosport 1 HD (F) (T)
- Cartoonito (T)
- Cartoon Network (T)
- CNBC (T)
- CNN (T)
- MTV 00s (T)
- MTV (Nordic) (T)
- National Geographic HD (S/F) (T)
- Nick Jr. (T)
- V film action HD (T)
- V film family (T)
- V film hits HD (T)
- V film premiere HD (T)
- V sport 1 Suomi HD (T)
- V sport 1 HD (S/F) (T)
- V sport 2 Suomi HD (T)
- V sport football HD (T)
- V sport golf HD (T)
- V sport live 1 (T)
- V sport live 2 (T)
- V sport live 3 (T)
- V sport live 4 (T)
- V sport live 5 (T)
- V sport premium HD (T)
- V sport ultra HD (T)
- V sport vinter HD (T)
-
\ No newline at end of file
diff --git a/sites/allente.fi/allente.fi.config.js b/sites/allente.fi/allente.fi.config.js
deleted file mode 100644
index cebe9364..00000000
--- a/sites/allente.fi/allente.fi.config.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const dayjs = require('dayjs')
-
-module.exports = {
- site: 'allente.fi',
- days: 2,
- request: {
- cache: {
- ttl: 60 * 60 * 1000 // 1 hour
- }
- },
- url({ date }) {
- return `https://cs-vcb.allente.fi/epg/events?date=${date.format('YYYY-MM-DD')}`
- },
- parser({ content, channel }) {
- let programs = []
- const items = parseItems(content, channel)
- items.forEach(item => {
- if (!item.details) return
- const start = dayjs(item.time)
- const stop = start.add(item.details.duration, 'm')
- programs.push({
- title: item.title,
- category: item.details.categories,
- description: item.details.description,
- image: item.details.image,
- season: parseSeason(item),
- episode: parseEpisode(item),
- start,
- stop
- })
- })
-
- return programs
- },
- async channels() {
- const axios = require('axios')
- const data = await axios
- .get(`https://cs-vcb.allente.fi/epg/events?date=${dayjs().format('YYYY-MM-DD')}`)
- .then(r => r.data)
- .catch(console.log)
-
- return data.channels.map(item => {
- return {
- lang: 'fi',
- site_id: item.id,
- name: item.name
- }
- })
- }
-}
-
-function parseItems(content, channel) {
- const data = JSON.parse(content)
- if (!data || !Array.isArray(data.channels)) return []
- const channelData = data.channels.find(i => i.id === channel.site_id)
-
- return channelData && Array.isArray(channelData.events) ? channelData.events : []
-}
-
-function parseSeason(item) {
- return item.details.season || null
-}
-function parseEpisode(item) {
- return item.details.episode || null
-}
diff --git a/sites/allente.fi/allente.fi.test.js b/sites/allente.fi/allente.fi.test.js
deleted file mode 100644
index 2601571d..00000000
--- a/sites/allente.fi/allente.fi.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const { parser, url } = require('./allente.fi.config.js')
-const fs = require('fs')
-const path = require('path')
-const dayjs = require('dayjs')
-const utc = require('dayjs/plugin/utc')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-dayjs.extend(customParseFormat)
-dayjs.extend(utc)
-
-const date = dayjs.utc('2021-11-17', 'YYYY-MM-DD').startOf('d')
-const channel = {
- site_id: '0148',
- xmltv_id: 'SVT1.se'
-}
-
-it('can generate valid url', () => {
- expect(url({ date, channel })).toBe('https://cs-vcb.allente.fi/epg/events?date=2021-11-17')
-})
-
-it('can parse response', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
- const result = parser({ content, channel }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(result).toMatchObject([
- {
- start: '2022-08-22T07:10:00.000Z',
- stop: '2022-08-22T07:30:00.000Z',
- title: 'Hemmagympa med Sofia',
- category: ['other'],
- description:
- 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
- image:
- 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
- season: 4,
- episode: 1
- }
- ])
-})
-
-it('can handle empty guide', () => {
- const result = parser({
- date,
- channel,
- content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
- })
- expect(result).toMatchObject([])
-})
diff --git a/sites/allente.fi/readme.md b/sites/allente.fi/readme.md
deleted file mode 100644
index 9753d24c..00000000
--- a/sites/allente.fi/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# allente.fi
-
-https://www.allente.fi/tv-guide/
-
-### Download the guide
-
-```sh
-npm run grab --- --site=allente.fi
-```
-
-### Update channel list
-
-```sh
-npm run channels:parse --- --config=./sites/allente.fi/allente.fi.config.js --output=./sites/allente.fi/allente.fi.channels.xml
-```
-
-### Test
-
-```sh
-npm test --- allente.fi
-```
diff --git a/sites/allente.no/allente.no.channels.xml b/sites/allente.no/allente.no.channels.xml
deleted file mode 100644
index 91e009ce..00000000
--- a/sites/allente.no/allente.no.channels.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
- Cartoonito (T)
- Nickelodeon (Nordic) (T)
- TV2 Direkte (N) (T)
- TV2 Sport Premium 2 HD (N) (T)
- Viasat Nature HD (T)
- TV3+ (N) (T)
- SkyShowtime 2 (T)
- SkyShowtime 1 (T)
- HISTORY HD (N/D/F) (T)
- HISTORY 2 HD (T)
- Animal Planet HD (T)
- Discovery Science (T)
- DW English (T)
- Bloomberg (T)
- MOTORVISION TV HD (T)
- Bilkanalen Auto Motor og Sport TV (N) (T)
- ID Investigation Discovery (N/F) (T)
- TLC Norge HD (T)
- BBC Nordic HD (N) (T)
- France 24 (T)
- VGTV HD (T)
- V sport Premier League HD (T)
- V sport Premier League 1 HD (T)
- V sport Premier League 2 HD (T)
- Heim HD (T)
- Stars HD (N) (T)
- Hits HD (N) (T)
- DR1 HD (T)
- Sky News (T)
- Horse & Country HD -IP
- SF Kanalen (T)
- Al Jazeera English -OTT
- BBC News (T)
- Cartoon Network (T)
- CNBC (T)
- CNN (T)
- Discovery Channel HD (N) (T)
- DR2 HD (T)
- Eurosport Norge HD (T)
- Eurosport 1 HD (N) (T)
- FEM HD (T)
- Kunskapskanalen HD (T)
- MAX HD (T)
- MTV 00s (T)
- MTV 80s (T)
- MTV (Nordic) (T)
- National Geographic HD (N) (T)
- Nick Jr. (T)
- Nicktoons (T)
- NRK1 HD (T)
- NRK2 HD (T)
- NRK3/ NRK Super HD (T)
- SVT1 HD (T)
- SVT2 HD (T)
- SVT Barn HD (T)
- TV 2 HD (D) (T)
- TV2 Livsstil HD (N) (T)
- TV2 Nyheter (N) (T)
- TV2 Sport 1 HD (N) (T)
- TV2 Sport 2 HD (N) (T)
- TV2 Sport Premium HD (N) (T)
- TV2 Zebra HD (N) (T)
- TV3 HD (N) (T)
- TV6 (N) (T)
- TV Norge HD (T)
- V film action HD (T)
- V film family (T)
- V film hits HD (T)
- V film premiere HD (T)
- Viasat Explore HD (T)
- Viasat History HD (T)
- VOX HD (T)
- V series HD (T)
- V sport 1 HD (N) (T)
- V sport 2 HD (N) (T)
- V sport 3 HD (N) (T)
- V sport golf HD (T)
- V sport live 1 (T)
- V sport live 2 (T)
- V sport live 3 (T)
- V sport live 4 (T)
- V sport live 5 (T)
- V sport+ HD (N) (T)
- V sport ultra HD (T)
-
\ No newline at end of file
diff --git a/sites/allente.no/allente.no.config.js b/sites/allente.no/allente.no.config.js
index 348b521c..27622e09 100644
--- a/sites/allente.no/allente.no.config.js
+++ b/sites/allente.no/allente.no.config.js
@@ -8,8 +8,9 @@ module.exports = {
ttl: 60 * 60 * 1000 // 1 hour
}
},
- url({ date }) {
- return `https://cs-vcb.allente.no/epg/events?date=${date.format('YYYY-MM-DD')}`
+ url({ channel, date }) {
+ const country = channel.site_id.split('#')[0]
+ return `https://cs-vcb.allente.${country}/epg/events?date=${date.format('YYYY-MM-DD')}`
},
parser({ content, channel }) {
let programs = []
@@ -32,27 +33,27 @@ module.exports = {
return programs
},
- async channels() {
+ async channels({ country = 'no' }) {
const axios = require('axios')
- const data = await axios
- .get(`https://cs-vcb.allente.no/epg/events?date=${dayjs().format('YYYY-MM-DD')}`)
- .then(r => r.data)
- .catch(console.log)
+ const date = dayjs().format('YYYY-MM-DD')
- return data.channels.map(item => {
- return {
- lang: 'no',
- site_id: item.id,
- name: item.name
- }
- })
+ const res = await axios.get(`https://cs-vcb.allente.${country}/epg/events?date=${date}`)
+ const data = res.data
+ if (!data || !Array.isArray(data.channels)) return []
+
+ return data.channels.map(item => ({
+ lang: country,
+ site_id: `${country}#${item.id}`,
+ name: item.name
+ }))
}
}
function parseItems(content, channel) {
const data = JSON.parse(content)
if (!data || !Array.isArray(data.channels)) return []
- const channelData = data.channels.find(i => i.id === channel.site_id)
+ const channelId = (channel.site_id || '').split('#')[1] || channel.site_id
+ const channelData = data.channels.find(i => i.id === channelId)
return channelData && Array.isArray(channelData.events) ? channelData.events : []
}
diff --git a/sites/allente.no/allente.no.test.js b/sites/allente.no/allente.no.test.js
index f12e8978..e55c7924 100644
--- a/sites/allente.no/allente.no.test.js
+++ b/sites/allente.no/allente.no.test.js
@@ -9,12 +9,20 @@ dayjs.extend(utc)
const date = dayjs.utc('2021-11-17', 'YYYY-MM-DD').startOf('d')
const channel = {
- site_id: '0148',
+ site_id: 'se#0148',
xmltv_id: 'SVT1.se'
}
it('can generate valid url', () => {
- expect(url({ date, channel })).toBe('https://cs-vcb.allente.no/epg/events?date=2021-11-17')
+ if (channel.site_id.split('#')[0] !== 'se') {
+ expect(url({ channel, date })).toBe('https://cs-vcb.allente.se/epg/events?date=2021-11-17')
+ } else if (channel.site_id.split('#')[0] === 'fi') {
+ expect(url({ channel, date })).toBe('https://cs-vcb.allente.fi/epg/events?date=2021-11-17')
+ } else if (channel.site_id.split('#')[0] === 'no') {
+ expect(url({ channel, date })).toBe('https://cs-vcb.allente.no/epg/events?date=2021-11-17')
+ } else if (channel.site_id.split('#')[0] === 'dk') {
+ expect(url({ channel, date })).toBe('https://cs-vcb.allente.dk/epg/events?date=2021-11-17')
+ }
})
it('can parse response', () => {
diff --git a/sites/allente.no/allente.no_dk.channels.xml b/sites/allente.no/allente.no_dk.channels.xml
new file mode 100644
index 00000000..03021aa9
--- /dev/null
+++ b/sites/allente.no/allente.no_dk.channels.xml
@@ -0,0 +1,75 @@
+
+
+ BBC News (T)
+ Cartoon Network (T)
+ CNBC (T)
+ CNN (T)
+ DR Ramasjang (T)
+ DR2 HD (T)
+ Kanal 4 HD (D) (T)
+ Kanal 5 HD (D) (T)
+ MTV (Nordic) (T)
+ Nickelodeon (Nordic) (T)
+ Nick Jr. (T)
+ NRK1 HD (T)
+ SVT1 HD (T)
+ TV 2 Charlie HD (D) (T)
+ TV 2 News HD (D) (T)
+ TV3 Sport HD (D) (T)
+ TV 2 Echo HD (D) (T)
+ TV4 HD (T)
+ MTV 00s (T)
+ TV3+ HD (D) (T)
+ V sport live 1 (T)
+ V sport live 2 (T)
+ V sport live 3 (T)
+ V sport live 4 (T)
+ V sport live 5 (T)
+ SVT2 HD (T)
+ NRK2 HD (T)
+ NRK3/ NRK Super HD (T)
+ TV 2 HD (D) (T)
+ V film action HD (T)
+ V film family (T)
+ National Geographic HD (D) (T)
+ V series HD (T)
+ V film premiere HD (T)
+ V film hits HD (T)
+ Al Jazeera English (T)
+ Viasat Nature HD (T)
+ Viasat History HD (T)
+ Viasat Explore HD (T)
+ TV3 HD (D) (T)
+ V sport golf HD (T)
+ Eurosport 2 HD (D) (T)
+ CANAL9 HD (D) (T)
+ TV3 MAX HD (D) (T)
+ dk4 (T)
+ TV 2 Fri HD (D) (T)
+ V sport ultra HD (T)
+ DR1 HD (T)
+ TV 2 Sport HD (D) (T)
+ 6'eren HD (D) (T)
+ Nicktoons (T)
+ Sky News (T)
+ MTV 80s (T)
+ TV3 Puls HD (D) (T)
+ Horse & Country (T)
+ See HD (D) (T)
+ TV 2 Sport X HD (D) (T)
+ SkyShowtime 2 HD (T)
+ SkyShowtime 1 HD (T)
+ DW English (T)
+ Bloomberg (T)
+ ID Investigation Discovery (D) (T)
+ TLC Danmark (T)
+ Sport Live (D) (T)
+ BBC Nordic HD (D/F) (T)
+ Discovery Channel HD (D) (T)
+ Eurosport 1 HD (D) (T)
+ Love Nature HD (T)
+ Moonbug (T)
+ Mezzo Live (T)
+ Dizi
+ Viaplay Sport News HD (D) (T)
+
diff --git a/sites/allente.no/allente.no_fi.channels.xml b/sites/allente.no/allente.no_fi.channels.xml
new file mode 100644
index 00000000..202d59bd
--- /dev/null
+++ b/sites/allente.no/allente.no_fi.channels.xml
@@ -0,0 +1,71 @@
+
+
+ BBC News (T)
+ Cartoon Network (T)
+ CNBC (T)
+ CNN (T)
+ MTV (Nordic) (T)
+ National Geographic HD (S/F) (T)
+ Nickelodeon (Nordic) (T)
+ Nick Jr. (T)
+ SVT Barn HD (T)
+ SVT1 HD (T)
+ Kunskapskanalen HD (T)
+ Viaplay 1 Urheilu HD (T)
+ MTV 00s (T)
+ V sport live 1 (T)
+ V sport live 2 (T)
+ V sport live 3 (T)
+ V sport live 4 (T)
+ V sport live 5 (T)
+ V sport football HD (T)
+ Viaplay 3 Urheilu HD (T)
+ SVT2 HD (T)
+ V film action HD (T)
+ V film family (T)
+ V film premiere HD (T)
+ V film hits HD (T)
+ Al Jazeera English (T)
+ Viasat Nature HD (T)
+ Viasat History HD (T)
+ Viasat Explore HD (T)
+ V sport 1 HD (S/F) (T)
+ V sport vinter HD (T)
+ V sport golf HD (T)
+ V sport ultra HD (T)
+ Viaplay 2 Urheilu HD (T)
+ V sport premium HD (T)
+ Nicktoons (T)
+ Sky News (T)
+ MTV 80s (T)
+ Horse & Country (T)
+ YLE TV1 HD (F) (T)
+ YLE TV2 HD (F) (T)
+ YLE Teema & Fem HD (F) (T)
+ MTV Aitio HD (F) (T)
+ MTV Viihde HD (F) (T)
+ SF Kanalen (T)
+ SkyShowtime 2 HD (T)
+ SkyShowtime 1 HD (T)
+ DW English (T)
+ Bloomberg (T)
+ BBC Nordic HD (D/F) (T)
+ Eurosport 2 HD (S/F) (T)
+ ID Investigation Discovery (S/F) (T)
+ MTV3 HD (F) (T)
+ Nelonen HD (F) (T)
+ MTV Sub HD (F) (T)
+ TV5 HD (F) (T)
+ liv HD (F) (T)
+ JIM HD (F) (T)
+ Discovery Channel HD (F) (T)
+ MTV Juniori HD (F) (T)
+ MTV Max HD (F) (T)
+ MTV Urheilu 1 HD (F) (T)
+ MTV Urheilu 2 HD (F) (T)
+ Eurosport 1 HD (F) (T)
+ Love Nature HD (T)
+ Moonbug (T)
+ Mezzo Live (T)
+ Dizi
+
diff --git a/sites/allente.no/allente.no_no.channels.xml b/sites/allente.no/allente.no_no.channels.xml
new file mode 100644
index 00000000..bd479a12
--- /dev/null
+++ b/sites/allente.no/allente.no_no.channels.xml
@@ -0,0 +1,85 @@
+
+
+ BBC News (T)
+ Cartoon Network (T)
+ CNBC (T)
+ CNN (T)
+ DR2 HD (T)
+ FEM HD (T)
+ MTV (Nordic) (T)
+ Nickelodeon (Nordic) (T)
+ Nick Jr. (T)
+ NRK1 HD (T)
+ SVT1 HD (T)
+ SVT2 HD (T)
+ SVT Barn HD (T)
+ Kunskapskanalen HD (T)
+ TV 2 Direkte HD (N) (T)
+ TV 2 HD (D) (T)
+ TV 2 Sport Premium HD (N) (T)
+ TV 2 Sport Premium 2 HD (N) (T)
+ TV 2 Sport 1 HD (N) (T)
+ TV6 (N) (T)
+ MTV 00s (T)
+ V sport live 1 (T)
+ V sport live 2 (T)
+ V sport live 3 (T)
+ V sport live 4 (T)
+ V sport live 5 (T)
+ V sport+ HD (N) (T)
+ TV 2 Livsstil HD (N) (T)
+ NRK2 HD (T)
+ NRK3/ NRK Super HD (T)
+ TV3 HD (N) (T)
+ V film action HD (T)
+ V film family (T)
+ National Geographic HD (N) (T)
+ V series HD (T)
+ V film premiere HD (T)
+ V film hits HD (T)
+ Al Jazeera English (T)
+ Viasat Nature HD (T)
+ Viasat History HD (T)
+ Viasat Explore HD (T)
+ TV3+ HD (N) (T)
+ V sport golf HD (T)
+ V sport 1 HD (N) (T)
+ TV 2 Zebra HD (N) (T)
+ TV 2 Sport 2 HD (N) (T)
+ V sport ultra HD (T)
+ DR1 HD (T)
+ TV 2 Nyheter HD (N) (T)
+ Eurosport Norge HD (T)
+ Eurosport 1 HD (N) (T)
+ Discovery Channel HD (N) (T)
+ REX HD (T)
+ TVNorge HD (T)
+ VOX HD (T)
+ Nicktoons (T)
+ Sky News (T)
+ MTV 80s (T)
+ V sport 2 HD (N) (T)
+ V sport 3 HD (N) (T)
+ Horse & Country (T)
+ SF Kanalen (T)
+ SkyShowtime 2 HD (T)
+ SkyShowtime 1 HD (T)
+ DW English (T)
+ Bloomberg (T)
+ ID Investigation Discovery (N) (T)
+ TLC Norge HD (T)
+ BBC Nordic HD (N) (T)
+ VGTV HD (T)
+ V sport Premier League HD (T)
+ V sport Premier League 1 HD (T)
+ V sport Premier League 2 HD (T)
+ V sport Premier League 3 HD (T)
+ V sport Premier League 4 HD (T)
+ Heim HD (T)
+ Stars HD (N) (T)
+ Hits HD (N) (T)
+ Love Nature HD (T)
+ Moonbug (T)
+ Mezzo Live (T)
+ Dizi
+
diff --git a/sites/allente.no/allente.no_se.channels.xml b/sites/allente.no/allente.no_se.channels.xml
new file mode 100644
index 00000000..14661707
--- /dev/null
+++ b/sites/allente.no/allente.no_se.channels.xml
@@ -0,0 +1,100 @@
+
+
+ BBC News (T)
+ Cartoon Network (T)
+ CNBC (T)
+ CNN (T)
+ DR Ramasjang (T)
+ DR2 HD (T)
+ MTV (Nordic) (T)
+ National Geographic HD (S/F) (T)
+ Nickelodeon (Nordic) (T)
+ Nick Jr. (T)
+ NRK1 HD (T)
+ MTV 80s (T)
+ SVT24 HD (T)
+ SVT Barn HD (T)
+ SVT1 HD (T)
+ Kunskapskanalen HD (T)
+ TV4 HD (T)
+ TV4 Fakta (T)
+ TV4 Film (T)
+ TV4 Guld (T)
+ Sjuan HD (S) (T)
+ Kanal 11 HD (S) (T)
+ MTV 00s (T)
+ V sport live 1 (T)
+ V sport live 2 (T)
+ V sport live 3 (T)
+ V sport live 4 (T)
+ V sport live 5 (T)
+ V sport football HD (T)
+ Kanal 5 HD (S) (T)
+ SVT2 HD (T)
+ NRK2 HD (T)
+ NRK3/ NRK Super HD (T)
+ TV3 HD (S) (T)
+ V sport motor HD (T)
+ TV 2 HD (D) (T)
+ V film action HD (T)
+ V film family (T)
+ V series HD (T)
+ V film premiere HD (T)
+ V film hits HD (T)
+ TV4 Sportkanalen HD (T)
+ Al Jazeera English (T)
+ Viasat Nature HD (T)
+ Viasat History HD (T)
+ Viasat Explore HD (T)
+ TV6 HD (S) (T)
+ V sport 1 HD (S/F) (T)
+ V sport vinter HD (T)
+ V sport golf HD (T)
+ V sport ultra HD (T)
+ DR1 HD (T)
+ Kanal 9 HD (S) (T)
+ Discovery Channel HD (S) (T)
+ V sport premium HD (T)
+ Nicktoons (T)
+ Sky News (T)
+ HBO Max Extra 1 HD (T)
+ HBO Max Extra 2 HD (T)
+ HBO Max Extra 3 HD (T)
+ HBO Max Extra 4 HD (T)
+ HBO Max Extra 5 HD (T)
+ HBO Max Extra 6 HD (T)
+ HBO Max Extra 7 HD (T)
+ HBO Max Extra 8 HD (T)
+ TV4 Hockey HD (T)
+ TV4 Fotboll HD (T)
+ TV4 Motor HD (T)
+ TV4 Sport Live 1 HD (T)
+ TV4 Sport Live 2 HD (T)
+ TV4 Sport Live 3 HD (T)
+ TV4 Sport Live 4 HD (T)
+ TV12 HD (S) (T)
+ TV8 HD (S) (T)
+ TV10 HD (S) (T)
+ Horse & Country (T)
+ TV4 Tennis HD (T)
+ V sport extra HD (T)
+ Godare (T)
+ TV4 Hits HD (T)
+ TV4 Stars HD (T)
+ SF Kanalen (T)
+ ATG Live HD (T)
+ SkyShowtime 2 HD (T)
+ SkyShowtime 1 HD (T)
+ DW English (T)
+ Bloomberg (T)
+ BBC Nordic HD (D/F) (T)
+ Eurosport 1 HD (S) (T)
+ Eurosport 2 HD (S/F) (T)
+ TLC Sverige HD (T)
+ ID Investigation Discovery (S/F) (T)
+ Axess TV HD -IP
+ Love Nature HD (T)
+ Moonbug (T)
+ Mezzo Live (T)
+ Dizi
+
diff --git a/sites/allente.se/__data__/content.json b/sites/allente.se/__data__/content.json
deleted file mode 100644
index bdac9a55..00000000
--- a/sites/allente.se/__data__/content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"channels":[{"id":"0148","icon":"//images.ctfassets.net/989y85n5kcxs/5uT9g9pdQWRZeDPQXVI9g6/9cc44da567f591822ed645c99ecdcb64/SVT_1_black_new__2_.png","name":"SVT1 HD (T)","events":[{"id":"0086202208220710","live":false,"time":"2022-08-22T07:10:00Z","title":"Hemmagympa med Sofia","details":{"title":"Hemmagympa med Sofia","image":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440","description":"Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.","season":4,"episode":1,"categories":["other"],"duration":"20"}}]}]}
\ No newline at end of file
diff --git a/sites/allente.se/__data__/no_content.json b/sites/allente.se/__data__/no_content.json
deleted file mode 100644
index 793e8706..00000000
--- a/sites/allente.se/__data__/no_content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"date":"2001-11-17","categories":[],"channels":[]}
\ No newline at end of file
diff --git a/sites/allente.se/allente.se.channels.xml b/sites/allente.se/allente.se.channels.xml
deleted file mode 100644
index 88ae120c..00000000
--- a/sites/allente.se/allente.se.channels.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
- Al Jazeera English -OTT
- Animal Planet HD (T)
- ATG Live HD (T)
- Axess TV HD -IP
- BBC Nordic HD (S/D/F) (T)
- BBC News (T)
- Bloomberg (T)
- Cartoonito (T)
- Cartoon Network (T)
- TV4 Fotboll (T)
- TV4 Hits (T)
- TV4 Hockey (T)
- TV4 Sport Live 2 (T)
- TV4 Sport Live 3 (T)
- TV4 Sport Live 4 (T)
- TV4 Sport Live 1 (T)
- TV4 Motor (T)
- TV4 Stars (T)
- CNBC (T)
- CNN (T)
- Discovery Channel HD (S) (T)
- Discovery Science (T)
- DR1 HD (T)
- DR2 HD (T)
- DR Ramasjang (T)
- DW English (T)
- Eurosport 1 HD (S) (T)
- Eurosport 2 HD (S/F) (T)
- France 24 (T)
- Godare HD -IP
- HISTORY 2 HD (T)
- HISTORY HD (S) (T)
- Horse & Country HD -IP
- ID Investigation Discovery (S) (T)
- Kanal 5 HD (S) (T)
- Kanal 9 HD (S) (T)
- Kanal 11 HD (S) (T)
- Kunskapskanalen HD (T)
- MOTORVISION TV HD (T)
- MTV 00s (T)
- MTV 80s (T)
- MTV (Nordic) (T)
- National Geographic HD (S/F) (T)
- Nickelodeon (Nordic) (T)
- Nick Jr. (T)
- Nicktoons (T)
- NRK1 HD (T)
- NRK2 HD (T)
- NRK3/ NRK Super HD (T)
- SkyShowtime 2 (T)
- SkyShowtime 1 (T)
- SF Kanalen (T)
- Sjuan HD (S) (T)
- Sky News (T)
- TV4 Sportkanalen (T)
- SVT1 HD (T)
- SVT2 HD (T)
- SVT24 HD (T)
- SVT Barn HD (T)
- TLC Sverige HD (T)
- TV 2 HD (D) (T)
- TV3 HD (S) (T)
- TV4 HD (T)
- TV4 Fakta (T)
- TV4 Film (T)
- TV4 Guld (T)
- TV4 Tennis (T)
- TV6 HD (S) (T)
- TV8 HD (S) (T)
- TV10 HD (S) (T)
- TV12 HD (S) (T)
- V film action HD (T)
- V film family (T)
- V film hits HD (T)
- V film premiere HD (T)
- Viasat Explore HD (T)
- Viasat History HD (T)
- Viasat Nature HD (T)
- V series HD (T)
- V sport 1 HD (S/F) (T)
- V sport extra HD (T)
- V sport football HD (T)
- V sport golf HD (T)
- V sport live 1 (T)
- V sport live 2 (T)
- V sport live 3 (T)
- V sport live 4 (T)
- V sport live 5 (T)
- V sport motor HD (T)
- V sport premium HD (T)
- V sport ultra HD (T)
- V sport vinter HD (T)
-
\ No newline at end of file
diff --git a/sites/allente.se/allente.se.config.js b/sites/allente.se/allente.se.config.js
deleted file mode 100644
index f8666ef3..00000000
--- a/sites/allente.se/allente.se.config.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const dayjs = require('dayjs')
-
-module.exports = {
- site: 'allente.se',
- days: 2,
- request: {
- cache: {
- ttl: 60 * 60 * 1000 // 1 hour
- }
- },
- url({ date }) {
- return `https://cs-vcb.allente.se/epg/events?date=${date.format('YYYY-MM-DD')}`
- },
- parser({ content, channel }) {
- let programs = []
- const items = parseItems(content, channel)
- items.forEach(item => {
- if (!item.details) return
- const start = dayjs(item.time)
- const stop = start.add(item.details.duration, 'm')
- programs.push({
- title: item.title,
- category: item.details.categories,
- description: item.details.description,
- image: item.details.image,
- season: parseSeason(item),
- episode: parseEpisode(item),
- start,
- stop
- })
- })
-
- return programs
- },
- async channels() {
- const axios = require('axios')
- const data = await axios
- .get(`https://cs-vcb.allente.se/epg/events?date=${dayjs().format('YYYY-MM-DD')}`)
- .then(r => r.data)
- .catch(console.log)
-
- return data.channels.map(item => {
- return {
- lang: 'sv',
- site_id: item.id,
- name: item.name
- }
- })
- }
-}
-
-function parseItems(content, channel) {
- const data = JSON.parse(content)
- if (!data || !Array.isArray(data.channels)) return []
- const channelData = data.channels.find(i => i.id === channel.site_id)
-
- return channelData && Array.isArray(channelData.events) ? channelData.events : []
-}
-
-function parseSeason(item) {
- return item.details.season || null
-}
-function parseEpisode(item) {
- return item.details.episode || null
-}
diff --git a/sites/allente.se/allente.se.test.js b/sites/allente.se/allente.se.test.js
deleted file mode 100644
index 2944c58a..00000000
--- a/sites/allente.se/allente.se.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const { parser, url } = require('./allente.se.config.js')
-const fs = require('fs')
-const path = require('path')
-const dayjs = require('dayjs')
-const utc = require('dayjs/plugin/utc')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-dayjs.extend(customParseFormat)
-dayjs.extend(utc)
-
-const date = dayjs.utc('2021-11-17', 'YYYY-MM-DD').startOf('d')
-const channel = {
- site_id: '0148',
- xmltv_id: 'SVT1.se'
-}
-
-it('can generate valid url', () => {
- expect(url({ date, channel })).toBe('https://cs-vcb.allente.se/epg/events?date=2021-11-17')
-})
-
-it('can parse response', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
- const result = parser({ content, channel }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(result).toMatchObject([
- {
- start: '2022-08-22T07:10:00.000Z',
- stop: '2022-08-22T07:30:00.000Z',
- title: 'Hemmagympa med Sofia',
- category: ['other'],
- description:
- 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
- image:
- 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
- season: 4,
- episode: 1
- }
- ])
-})
-
-it('can handle empty guide', () => {
- const result = parser({
- date,
- channel,
- content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
- })
- expect(result).toMatchObject([])
-})
diff --git a/sites/allente.se/readme.md b/sites/allente.se/readme.md
deleted file mode 100644
index b903b1f6..00000000
--- a/sites/allente.se/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# allente.se
-
-https://www.allente.se/tv-guide/
-
-### Download the guide
-
-```sh
-npm run grab --- --site=allente.se
-```
-
-### Update channel list
-
-```sh
-npm run channels:parse --- --config=./sites/allente.se/allente.se.config.js --output=./sites/allente.se/allente.se.channels.xml
-```
-
-### Test
-
-```sh
-npm test --- allente.se
-```