update stod2, need to move to syn.is

This commit is contained in:
theofficialomega
2025-12-17 18:46:39 +01:00
parent 1185158240
commit 157f36ac23
3 changed files with 17 additions and 16 deletions

View File

@@ -1,15 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel site="stod2.is" site_id="besta01" lang="is" xmltv_id="">Besta01</channel>
<channel site="stod2.is" site_id="besta02" lang="is" xmltv_id="">Besta02</channel>
<channel site="stod2.is" site_id="besta03" lang="is" xmltv_id="">Besta03</channel>
<channel site="stod2.is" site_id="golfstodin" lang="is" xmltv_id="Stod2Sport5.is@SD">Stöð 2 Sport 5</channel>
<channel site="stod2.is" site_id="sport" lang="is" xmltv_id="Stod2Sport.is@SD">Stöð 2 Sport</channel>
<channel site="stod2.is" site_id="sport2" lang="is" xmltv_id="Stod2Sport2.is@SD">Stöð 2 Sport 2</channel>
<channel site="stod2.is" site_id="sport3" lang="is" xmltv_id="Stod2Sport3.is@SD">Stöð 2 Sport 3</channel>
<channel site="stod2.is" site_id="sport4" lang="is" xmltv_id="Stod2Sport4.is@SD">Stöð 2 Sport 4</channel>
<channel site="stod2.is" site_id="sport6" lang="is" xmltv_id="Stod2Sport6.is@SD">Stöð 2 Sport 6</channel>
<channel site="stod2.is" site_id="stod2" lang="is" xmltv_id="Stod2.is@SD">Stöð 2</channel>
<channel site="stod2.is" site_id="stod3" lang="is" xmltv_id="Stod2Fjolskylda.is@SD">Stöð 2 Fjölskylda</channel>
<channel site="stod2.is" site_id="vodasport" lang="is" xmltv_id="">Vodafone Sport</channel>
<channel site="syn.is" site_id="beint" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="bio" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="syn" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="synsport" lang="is" xmltv_id="Stod2Sport.is@SD">Stöð 2 Sport</channel>
<channel site="syn.is" site_id="synsport2" lang="is" xmltv_id="Stod2Sport2.is@SD">Stöð 2 Sport 2</channel>
<channel site="syn.is" site_id="synsport3" lang="is" xmltv_id="Stod2Sport3.is@SD">Stöð 2 Sport 3</channel>
<channel site="syn.is" site_id="synsport4" lang="is" xmltv_id="Stod2Sport4.is@SD">Stöð 2 Sport 4</channel>
<channel site="syn.is" site_id="synsport5" lang="is" xmltv_id="Stod2Sport5.is@SD">Stöð 2 Sport 5</channel>
<channel site="syn.is" site_id="synsport6" lang="is" xmltv_id="Stod2Sport6.is@SD">Stöð 2 Sport 6</channel>
<channel site="syn.is" site_id="synsportisland" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="synsportisland2" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="synsportisland3" lang="is" xmltv_id=""></channel>
<channel site="syn.is" site_id="synsportviaplay" lang="is" xmltv_id=""></channel>
</channels>

View File

@@ -5,7 +5,7 @@ const axios = require('axios')
dayjs.extend(utc)
module.exports = {
site: 'stod2.is',
site: 'syn.is',
days: 7,
request: {
cache: {
@@ -13,7 +13,7 @@ module.exports = {
}
},
url({ channel, date }) {
return `https://api.stod2.is/dagskra/api/${channel.site_id}/${date.format('YYYY-MM-DD')}`
return `https://www.syn.is/api/epg/${channel.site_id}/${date.format('YYYY-MM-DD')}`
},
parser: function ({ content }) {
let data
@@ -48,7 +48,7 @@ module.exports = {
},
async channels() {
try {
const response = await axios.get('https://api.stod2.is/dagskra/api')
const response = await axios.get('https://www.syn.is/api/epg/')
if (!response.data || !Array.isArray(response.data)) {
console.error('Error: No channels data found')
return []

View File

@@ -15,7 +15,7 @@ const channel = { site_id: 'stod2', xmltv_id: 'Stod2.is' }
it('can generate valid url', () => {
const generatedUrl = url({ date, channel })
expect(generatedUrl).toBe('https://api.stod2.is/dagskra/api/stod2/2025-01-03')
expect(generatedUrl).toBe('https://www.syn.is/api/epg/stod2/2025-01-03')
})
it('can parse response', () => {