mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 17:10:07 -04:00
Update dstv.com.config.js
This commit is contained in:
parent
abd4d2a1d5
commit
9dc63bb478
1 changed files with 17 additions and 1 deletions
|
@ -2,6 +2,7 @@ const cheerio = require('cheerio')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
|
const axios = require('axios')
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
@ -14,10 +15,25 @@ module.exports = {
|
||||||
url({ channel, date }) {
|
url({ channel, date }) {
|
||||||
const [bouquetId] = channel.site_id.split('#')
|
const [bouquetId] = channel.site_id.split('#')
|
||||||
|
|
||||||
return `https://guide.dstv.com/api/gridview/page?&bouquetId=${bouquetId}&genre=all&date=${date.format(
|
return `https://guide.dstv.com/api/gridview/page?bouquetId=${bouquetId}&genre=all&date=${date.format(
|
||||||
'YYYY-MM-DD'
|
'YYYY-MM-DD'
|
||||||
)}`
|
)}`
|
||||||
},
|
},
|
||||||
|
async logo({ channel }) {
|
||||||
|
const [bouquetId, channelId] = channel.site_id.split('#')
|
||||||
|
const url = `https://guide.dstv.com/api/channel/fetchChannelsByGenresInBouquet?bouquetId=${bouquetId}&genre=all`
|
||||||
|
const result = await axios
|
||||||
|
.get(url)
|
||||||
|
.then(r => r.data)
|
||||||
|
.catch(console.log)
|
||||||
|
if (!result) return null
|
||||||
|
const items = result.items || []
|
||||||
|
const elem = items.find(i => i.channelTag === channelId) || {
|
||||||
|
channelLogoPaths: { XLARGE: null }
|
||||||
|
}
|
||||||
|
|
||||||
|
return elem.channelLogoPaths.XLARGE
|
||||||
|
},
|
||||||
parser({ content, date, channel }) {
|
parser({ content, date, channel }) {
|
||||||
let PM = false
|
let PM = false
|
||||||
const programs = []
|
const programs = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue