mirror of
https://github.com/iptv-org/epg
synced 2026-05-09 19:07:03 -04:00
@@ -28,6 +28,29 @@ module.exports = {
|
||||
})
|
||||
|
||||
return programs
|
||||
},
|
||||
async channels() {
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
const result = await axios
|
||||
.get(`https://api.firstmedia.com/api/content/tv-guide/list?date=${dayjs().format('DD/MM/YYYY')}&channel=&startTime=0&endTime=24`)
|
||||
.then(response => response.data)
|
||||
.catch(console.error)
|
||||
|
||||
const channels = []
|
||||
if (result.data && result.data.entries) {
|
||||
Object.values(result.data.entries).forEach(schedules => {
|
||||
if (schedules.length) {
|
||||
channels.push({
|
||||
lang: 'en',
|
||||
site_id: schedules[0].channel.no,
|
||||
name: schedules[0].channel.name
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user