Update dstv.com.config.js

This commit is contained in:
Aleksandr Statciuk 2022-01-22 18:33:37 +03:00
parent 619db0909b
commit ab8320f4fc

View file

@ -1,3 +1,4 @@
const axios = require('axios')
const cheerio = require('cheerio') const cheerio = require('cheerio')
const dayjs = require('dayjs') const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc') const utc = require('dayjs/plugin/utc')
@ -43,6 +44,24 @@ module.exports = {
}) })
return programs return programs
},
async channels({ bouquet }) {
const data = await axios
.get(
`https://guide.dstv.com/api/channel/fetchChannelsByGenresInBouquet?bouquetId=${bouquet}&genre=all`
)
.then(r => r.data)
.catch(console.log)
const items = data.items
return items.map(item => {
return {
lang: 'en',
site_id: `${bouquet}#${item.channelTag}`,
name: item.channelName,
logo: item.channelLogoPaths.XLARGE
}
})
} }
} }