mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update streamingtvguides.com
This commit is contained in:
parent
858d1f40b1
commit
7e5258fecc
4 changed files with 3113 additions and 2 deletions
|
@ -32,6 +32,33 @@ module.exports = {
|
|||
programs = _.orderBy(_.uniqBy(programs, 'start'), 'start')
|
||||
|
||||
return programs
|
||||
},
|
||||
async channels({ country, lang }) {
|
||||
const axios = require('axios')
|
||||
const data = await axios
|
||||
.get(`https://streamingtvguides.com/Preferences`)
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
|
||||
let channels = []
|
||||
|
||||
const $ = cheerio.load(data)
|
||||
$('#channel-group-all > div > div').each((i, el) => {
|
||||
const site_id = $(el).find('input').attr('value').replace('&', '&')
|
||||
const label = $(el).text().trim()
|
||||
const svgTitle = $(el).find('svg').attr('alt')
|
||||
const name = (label || svgTitle || '').replace(site_id, '').trim()
|
||||
|
||||
if (!name || !site_id) return
|
||||
|
||||
channels.push({
|
||||
lang: 'en',
|
||||
site_id,
|
||||
name
|
||||
})
|
||||
})
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue