mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 17:10:07 -04:00
Update dstv.com
This commit is contained in:
parent
7d72a1eaba
commit
ce9f81a81c
2 changed files with 6 additions and 24 deletions
|
@ -19,21 +19,8 @@ module.exports = {
|
||||||
'YYYY-MM-DD'
|
'YYYY-MM-DD'
|
||||||
)}`
|
)}`
|
||||||
},
|
},
|
||||||
async logo({ channel }) {
|
logo({ channel }) {
|
||||||
if (channel.logo) return channel.logo
|
return channel.logo
|
||||||
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
|
||||||
|
|
|
@ -24,15 +24,10 @@ it('can generate valid url', () => {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can get logo url', done => {
|
it('can get logo url', () => {
|
||||||
logo({ channel })
|
expect(logo({ channel })).toBe(
|
||||||
.then(result => {
|
'https://rndcdn.dstv.com/dstvcms/2020/09/01/M-Net_Movies_4_Logo_4-3_lightbackground_xlrg.png'
|
||||||
expect(result).toBe(
|
)
|
||||||
'https://rndcdn.dstv.com/dstvcms/2020/09/01/M-Net_Movies_4_Logo_4-3_lightbackground_xlrg.png'
|
|
||||||
)
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
.catch(error => done(error))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can parse response', () => {
|
it('can parse response', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue