fusion allente configurations into one

This commit is contained in:
theofficialomega
2025-08-17 16:11:44 +02:00
parent 77e10af52c
commit 5d6867fbc1
25 changed files with 357 additions and 767 deletions
-1
View File
@@ -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"}}]}]}
@@ -1 +0,0 @@
{"date":"2001-11-17","categories":[],"channels":[]}
-95
View File
@@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="allente.se" lang="en" xmltv_id="AlJazeera.qa@English" site_id="0344">Al Jazeera English -OTT</channel>
<channel site="allente.se" lang="sv" xmltv_id="AnimalPlanetNordic.uk@HD" site_id="1005">Animal Planet HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ATGLive.se" site_id="1000">ATG Live HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="AxessTV.se" site_id="1053">Axess TV HD -IP</channel>
<channel site="allente.se" lang="sv" xmltv_id="BBCBrit.uk@Sweden" site_id="1016">BBC Nordic HD (S/D/F) (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="BBCNews.uk@Europe" site_id="0016">BBC News (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="BloombergTV.us@Europe" site_id="1008">Bloomberg (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="BoomerangNordic.uk" site_id="0017">Cartoonito (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="" site_id="0028">Cartoon Network (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Fotboll.se" site_id="657">TV4 Fotboll (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Hits.se" site_id="969">TV4 Hits (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Hockey.se" site_id="656">TV4 Hockey (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4SportLive2.se" site_id="660">TV4 Sport Live 2 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4SportLive3.se" site_id="661">TV4 Sport Live 3 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4SportLive4.se" site_id="662">TV4 Sport Live 4 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4SportLive1.se" site_id="659">TV4 Sport Live 1 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Motor.se" site_id="658">TV4 Motor (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Stars.se" site_id="970">TV4 Stars (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="CNBCEurope.uk" site_id="0032">CNBC (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="CNNInternational.us@MENA" site_id="0033">CNN (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="DiscoveryChannel.se" site_id="493">Discovery Channel HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="DiscoveryScienceEurope.uk@Sweden" site_id="1006">Discovery Science (T)</channel>
<channel site="allente.se" lang="da" xmltv_id="DR1.dk" site_id="452">DR1 HD (T)</channel>
<channel site="allente.se" lang="da" xmltv_id="DR2.dk" site_id="0051">DR2 HD (T)</channel>
<channel site="allente.se" lang="da" xmltv_id="DRRamasjang.dk" site_id="0048">DR Ramasjang (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="DW.de@English" site_id="1007">DW English (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Eurosport1.fr" site_id="1023">Eurosport 1 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Eurosport2.fr" site_id="1024">Eurosport 2 HD (S/F) (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="France24.fr@English" site_id="1033">France 24 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Godare.se" site_id="722">Godare HD -IP</channel>
<channel site="allente.se" lang="sv" xmltv_id="History2Nordic.us" site_id="1004">HISTORY 2 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="History.se" site_id="652">HISTORY HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="HorseCountryTV.uk" site_id="668">Horse &amp; Country HD -IP</channel>
<channel site="allente.se" lang="sv" xmltv_id="InvestigationDiscovery.se" site_id="1039">ID Investigation Discovery (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Kanal5.se" site_id="0279">Kanal 5 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Kanal9.se" site_id="474">Kanal 9 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Kanal11.se" site_id="0235">Kanal 11 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Kunskapskanalen.se" site_id="0149">Kunskapskanalen HD (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="Motorvision.de" site_id="1009">MOTORVISION TV HD (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="MTV00s.uk" site_id="0246">MTV 00s (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="MTV80s.uk" site_id="0099">MTV 80s (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="MTVGlobal.uk" site_id="0080">MTV (Nordic) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NationalGeographic.se" site_id="0084">National Geographic HD (S/F) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NickelodeonScandinavia.nl" site_id="0086">Nickelodeon (Nordic) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NickJrScandinavia.nl" site_id="0088">Nick Jr. (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NicktoonsScandinavia.nl" site_id="570">Nicktoons (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NRK1.no" site_id="0090">NRK1 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NRK2.no" site_id="0288">NRK2 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="NRK3.no" site_id="0289">NRK3/ NRK Super HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ParamountPlusMovies.se" site_id="1001">SkyShowtime 2 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ParamountPlusSeries.se" site_id="1002">SkyShowtime 1 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="SFkanalen.se" site_id="972">SF Kanalen (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Sjuan.se" site_id="0232">Sjuan HD (S) (T)</channel>
<channel site="allente.se" lang="en" xmltv_id="SkyNewsInternational.uk" site_id="596">Sky News (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="Sportkanalen.se" site_id="0325">TV4 Sportkanalen (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="SVT1.se" site_id="0148">SVT1 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="SVT2.se" site_id="0282">SVT2 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="SVT24.se" site_id="146">SVT24 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="SVTBarn.se" site_id="0147">SVT Barn HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TLC.se" site_id="1038">TLC Sverige HD (T)</channel>
<channel site="allente.se" lang="da" xmltv_id="TV2.dk" site_id="0297">TV 2 HD (D) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV3.se" site_id="0290">TV3 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4.se" site_id="0227">TV4 HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Fakta.se" site_id="0228">TV4 Fakta (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Film.se" site_id="0229">TV4 Film (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Guld.se" site_id="0230">TV4 Guld (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV4Tennis.se" site_id="675">TV4 Tennis (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV6.se" site_id="0360">TV6 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV8.se" site_id="666">TV8 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV10.se" site_id="667">TV10 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="TV12.se" site_id="664">TV12 HD (S) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VFilmAction.se" site_id="0299">V film action HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VFilmFamily.se" site_id="0308">V film family (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VFilmHits.se" site_id="0322">V film hits HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VFilmPremiere.se" site_id="0321">V film premiere HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ViasatExplore.se" site_id="0358">Viasat Explore HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ViasatHistory.se" site_id="0357">Viasat History HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="ViasatNature.se" site_id="0356">Viasat Nature HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSeries.se" site_id="0320">V series HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSport1.se" site_id="0362">V sport 1 HD (S/F) (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportExtra.se" site_id="715">V sport extra HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportFootball.se" site_id="0269">V sport football HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportGolf.se" site_id="0364">V sport golf HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportLive1.se" site_id="0255">V sport live 1 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportLive2.se" site_id="0256">V sport live 2 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportLive3.se" site_id="0257">V sport live 3 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportLive4.se" site_id="0258">V sport live 4 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportLive5.se" site_id="0259">V sport live 5 (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportMotor.se" site_id="0292">V sport motor HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportPremium.se" site_id="527">V sport premium HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportUltraHD.se" site_id="418">V sport ultra HD (T)</channel>
<channel site="allente.se" lang="sv" xmltv_id="VSportVinter.se" site_id="0363">V sport vinter HD (T)</channel>
</channels>
-65
View File
@@ -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
}
-51
View File
@@ -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([])
})
-21
View File
@@ -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
```