mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update sjonvarp.is
This commit is contained in:
parent
e7516fbed7
commit
83b4327a4c
4 changed files with 63 additions and 22 deletions
|
@ -38,6 +38,32 @@ module.exports = {
|
|||
})
|
||||
|
||||
return programs
|
||||
},
|
||||
async channels() {
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
|
||||
const data = await axios
|
||||
.get(`https://sjonvarp.is/`)
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
|
||||
let channels = []
|
||||
|
||||
const $ = cheerio.load(data)
|
||||
$('.listing-row').each((i, el) => {
|
||||
const site_id = $(el).attr('id')
|
||||
const title = $(el).find('a.channel').first().attr('title')
|
||||
const [, name] = title.match(/^Skoða dagskránna á (.*) í dag$/)
|
||||
|
||||
channels.push({
|
||||
lang: 'is',
|
||||
site_id,
|
||||
name
|
||||
})
|
||||
})
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue