Update allente sites.

Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
Toha
2026-07-04 19:32:45 +07:00
parent 41a54452e8
commit f59a46bb00
26 changed files with 257889 additions and 421 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
{"date":"2001-11-17","categories":[],"channels":[]}
+68
View File
@@ -0,0 +1,68 @@
const dayjs = require('dayjs')
const eventIds = []
module.exports = {
site: 'allente.fi',
days: 2,
request: {
cache: {
ttl: 24 * 60 * 60 * 1000 // 1 day
}
},
url({ date }) {
return `https://www.allente.fi/api/epg/refetch-epg-data?Start=${date.format('YYYY-MM-DD')}`
},
parser({ content, channel }) {
const programs = []
if (typeof content === 'string' || Buffer.isBuffer(content)) {
content = JSON.parse(content)
}
if (Array.isArray(content?.channels)) {
content.channels
.filter(item => item.id === channel.site_id)
.forEach(item => {
if (Array.isArray(item.programs)) {
item.programs
// make program unique across days
.filter(event => !eventIds.includes(event.id))
.forEach(event => {
eventIds.push(event.id)
programs.push({
title: event.title,
description: event.shortDescription,
category: event.genres,
image: event.splashImageUri,
season: event.seasonNumber ? event.seasonNumber : null,
episode: event.episodeNumber ? event.episodeNumber : null,
year: event.releaseYear ? event.releaseYear.toString() : null,
start: dayjs(event.eventStart),
stop: dayjs(event.eventEnd)
})
})
}
})
}
return programs
},
async channels() {
const channels = []
const axios = require('axios')
const res = await axios.get(`https://www.allente.fi/api/epg/refetch-epg-data?Start=${dayjs().format('YYYY-MM-DD')}`)
.then(res => res.data)
.catch(console.error)
if (Array.isArray(res.channels)) {
channels.push(...res.channels
.map(item => ({
lang: 'fi',
site_id: item.id,
name: item.name
})
))
}
return channels
}
}
+55
View File
@@ -0,0 +1,55 @@
const { parser, url } = require('./allente.fi.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const date = dayjs('2026-06-28').startOf('d')
const channel = {
site_id: '20001'
}
it('can generate valid url', () => {
expect(url({ date })).toBe('https://www.allente.fi/api/epg/refetch-epg-data?Start=2026-06-28')
})
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.length).toBe(26)
expect(result[2]).toMatchObject({
start: '2026-06-28T03:30:00.000Z',
stop: '2026-06-28T04:00:00.000Z',
title: 'Trucks!',
description:
'The hosts present viewers with all of the latest trends and models for trucks while also demonstrating a series of how-to projects.',
category: ['Elämäntapa', 'Antiikki'],
image:
'https://allente-imgmgr.akamaized.net/11823019554723227163.jpg?im=Resize,width=600,%20height=338',
season: 19,
episode: 6,
year: '2026'
})
expect(result[25]).toMatchObject({
start: '2026-06-28T23:30:00.000Z',
stop: '2026-06-29T03:00:00.000Z',
title: 'Airing Break',
category: ['Sekalaiset'],
season: null,
episode: null
})
})
it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="allente.fi" site_id="20001" lang="fi" xmltv_id="">SVT1 HD</channel>
<channel site="allente.fi" site_id="20002" lang="fi" xmltv_id="">SVT2 HD</channel>
<channel site="allente.fi" site_id="20010" lang="fi" xmltv_id="">SVT Barn HD</channel>
<channel site="allente.fi" site_id="20013" lang="fi" xmltv_id="">Kunskapskanalen HD</channel>
<channel site="allente.fi" site_id="20014" lang="fi" xmltv_id="">ID Investigation Discovery (S)</channel>
<channel site="allente.fi" site_id="20025" lang="fi" xmltv_id="">Eurosport 1 HD (F)</channel>
<channel site="allente.fi" site_id="20059" lang="fi" xmltv_id="">Horse &amp; Country</channel>
<channel site="allente.fi" site_id="20062" lang="fi" xmltv_id="">Nickelodeon</channel>
<channel site="allente.fi" site_id="40001" lang="fi" xmltv_id="">Nelonen HD</channel>
<channel site="allente.fi" site_id="40003" lang="fi" xmltv_id="">MTV Sub HD</channel>
<channel site="allente.fi" site_id="40005" lang="fi" xmltv_id="">liv HD</channel>
<channel site="allente.fi" site_id="40006" lang="fi" xmltv_id="">JIM HD</channel>
<channel site="allente.fi" site_id="40007" lang="fi" xmltv_id="">Kuukauden kanava</channel>
<channel site="allente.fi" site_id="40008" lang="fi" xmltv_id="">Discovery Channel HD (F)</channel>
<channel site="allente.fi" site_id="40009" lang="fi" xmltv_id="">MTV Juniori HD</channel>
<channel site="allente.fi" site_id="40014" lang="fi" xmltv_id="">MTV Max HD</channel>
<channel site="allente.fi" site_id="40015" lang="fi" xmltv_id="">MTV Urheilu 1 HD</channel>
<channel site="allente.fi" site_id="40016" lang="fi" xmltv_id="">MTV Urheilu 2 HD</channel>
<channel site="allente.fi" site_id="40023" lang="fi" xmltv_id="">Yle TV1 HD</channel>
<channel site="allente.fi" site_id="40024" lang="fi" xmltv_id="">Yle TV2 HD</channel>
<channel site="allente.fi" site_id="40025" lang="fi" xmltv_id="">MTV3 HD</channel>
<channel site="allente.fi" site_id="40030" lang="fi" xmltv_id="">Viaplay 3 Urheilu HD</channel>
<channel site="allente.fi" site_id="40031" lang="fi" xmltv_id="">Viaplay 2 Urheilu HD</channel>
<channel site="allente.fi" site_id="40032" lang="fi" xmltv_id="">Viaplay 1 Urheilu HD</channel>
<channel site="allente.fi" site_id="40035" lang="fi" xmltv_id="">Yle Teema &amp; Fem HD</channel>
<channel site="allente.fi" site_id="40037" lang="fi" xmltv_id="">TV5 HD</channel>
<channel site="allente.fi" site_id="40041" lang="fi" xmltv_id="">MTV Liiga 1</channel>
<channel site="allente.fi" site_id="40042" lang="fi" xmltv_id="">MTV Liiga 2</channel>
<channel site="allente.fi" site_id="40043" lang="fi" xmltv_id="">MTV Liiga 3</channel>
<channel site="allente.fi" site_id="40044" lang="fi" xmltv_id="">MTV Liiga 4</channel>
<channel site="allente.fi" site_id="40045" lang="fi" xmltv_id="">MTV Liiga 5</channel>
<channel site="allente.fi" site_id="40046" lang="fi" xmltv_id="">MTV Liiga 6</channel>
<channel site="allente.fi" site_id="40047" lang="fi" xmltv_id="">MTV Liiga 7</channel>
<channel site="allente.fi" site_id="40049" lang="fi" xmltv_id="">V sport football HD (F)</channel>
<channel site="allente.fi" site_id="40050" lang="fi" xmltv_id="">V sport vinter HD (F)</channel>
<channel site="allente.fi" site_id="40051" lang="fi" xmltv_id="">V sport 1 HD (F)</channel>
<channel site="allente.fi" site_id="40052" lang="fi" xmltv_id="">V sport premium HD (F)</channel>
<channel site="allente.fi" site_id="40054" lang="fi" xmltv_id="">MTV Urheilu 3 HD</channel>
<channel site="allente.fi" site_id="40055" lang="fi" xmltv_id="">MTV Liiga 8</channel>
<channel site="allente.fi" site_id="40056" lang="fi" xmltv_id="">Viaplay TV HD</channel>
<channel site="allente.fi" site_id="50007" lang="fi" xmltv_id="">HISTORY</channel>
<channel site="allente.fi" site_id="50008" lang="fi" xmltv_id="">HISTORY 2</channel>
<channel site="allente.fi" site_id="50012" lang="fi" xmltv_id="">MTV</channel>
<channel site="allente.fi" site_id="50018" lang="fi" xmltv_id="">Nick Jr</channel>
<channel site="allente.fi" site_id="50019" lang="fi" xmltv_id="">Cartoon Network</channel>
<channel site="allente.fi" site_id="50024" lang="fi" xmltv_id="">CNN International</channel>
<channel site="allente.fi" site_id="50025" lang="fi" xmltv_id="">BBC News</channel>
<channel site="allente.fi" site_id="50026" lang="fi" xmltv_id="">Sky News</channel>
<channel site="allente.fi" site_id="50027" lang="fi" xmltv_id="">Bloomberg</channel>
<channel site="allente.fi" site_id="50028" lang="fi" xmltv_id="">Al Jazeera English</channel>
<channel site="allente.fi" site_id="50030" lang="fi" xmltv_id="">SF-kanalen</channel>
<channel site="allente.fi" site_id="50034" lang="fi" xmltv_id="">CGTN HD</channel>
<channel site="allente.fi" site_id="50036" lang="fi" xmltv_id="">CGTN Documentary HD</channel>
<channel site="allente.fi" site_id="50037" lang="fi" xmltv_id="">Kanal 10 Norge HD</channel>
<channel site="allente.fi" site_id="50038" lang="fi" xmltv_id="">BBC Nordic HD</channel>
<channel site="allente.fi" site_id="50043" lang="fi" xmltv_id="">MTV Viihde HD</channel>
<channel site="allente.fi" site_id="50049" lang="fi" xmltv_id="">V sport vinter HD (S)</channel>
<channel site="allente.fi" site_id="50052" lang="fi" xmltv_id="">V classics HD</channel>
<channel site="allente.fi" site_id="50054" lang="fi" xmltv_id="">National Geographic HD (S/F)</channel>
<channel site="allente.fi" site_id="50055" lang="fi" xmltv_id="">Eurosport 2 HD (S/F)</channel>
<channel site="allente.fi" site_id="50077" lang="fi" xmltv_id="">V sport golf HD</channel>
<channel site="allente.fi" site_id="50078" lang="fi" xmltv_id="">V sport premium HD (S)</channel>
<channel site="allente.fi" site_id="50082" lang="fi" xmltv_id="">CNBC</channel>
<channel site="allente.fi" site_id="50083" lang="fi" xmltv_id="">DW English</channel>
<channel site="allente.fi" site_id="50085" lang="fi" xmltv_id="">Nicktoons</channel>
<channel site="allente.fi" site_id="50105" lang="fi" xmltv_id="">V sport ultra HD</channel>
<channel site="allente.fi" site_id="50106" lang="fi" xmltv_id="">V film premiere HD</channel>
<channel site="allente.fi" site_id="50107" lang="fi" xmltv_id="">V film action HD</channel>
<channel site="allente.fi" site_id="50108" lang="fi" xmltv_id="">V film hits HD</channel>
<channel site="allente.fi" site_id="50109" lang="fi" xmltv_id="">V film family</channel>
<channel site="allente.fi" site_id="50113" lang="fi" xmltv_id="">Viasat Explore HD</channel>
<channel site="allente.fi" site_id="50114" lang="fi" xmltv_id="">Viasat History HD</channel>
<channel site="allente.fi" site_id="50115" lang="fi" xmltv_id="">Viasat Nature HD</channel>
<channel site="allente.fi" site_id="50125" lang="fi" xmltv_id="">V sport live 1</channel>
<channel site="allente.fi" site_id="50126" lang="fi" xmltv_id="">V sport live 2</channel>
<channel site="allente.fi" site_id="50127" lang="fi" xmltv_id="">V sport live 3</channel>
<channel site="allente.fi" site_id="50128" lang="fi" xmltv_id="">V sport live 4</channel>
<channel site="allente.fi" site_id="50129" lang="fi" xmltv_id="">V sport live 5</channel>
<channel site="allente.fi" site_id="50132" lang="fi" xmltv_id="">SkyShowtime 2 HD</channel>
<channel site="allente.fi" site_id="50133" lang="fi" xmltv_id="">SkyShowtime 1 HD</channel>
<channel site="allente.fi" site_id="50136" lang="fi" xmltv_id="">Bedehuskanalen</channel>
<channel site="allente.fi" site_id="50137" lang="fi" xmltv_id="">SBN International</channel>
<channel site="allente.fi" site_id="50138" lang="fi" xmltv_id="">FREEDOM</channel>
<channel site="allente.fi" site_id="50140" lang="fi" xmltv_id="">Kanal 10 Sverige</channel>
<channel site="allente.fi" site_id="50141" lang="fi" xmltv_id="">Moonbug</channel>
<channel site="allente.fi" site_id="50142" lang="fi" xmltv_id="">Love Nature HD</channel>
<channel site="allente.fi" site_id="50143" lang="fi" xmltv_id="">Mezzo Live</channel>
<channel site="allente.fi" site_id="50144" lang="fi" xmltv_id="">Dizi</channel>
<channel site="allente.fi" site_id="50145" lang="fi" xmltv_id="">Sverigekanalen</channel>
</channels>
+21
View File
@@ -0,0 +1,21 @@
# allente.fi
https://www.allente.fi/tv-guide/
### Download the guide
```sh
npm run grab --- --sites=allente.fi
```
### Update channel list
```sh
npm run channels:parse --- --config=./sites/allente.fi/allente.fi.config.js --output=./sites/allente.fi/allente.fi_fi.channels.xml
```
### Test
```sh
npm test --- allente.fi
```