Update foxsports.com.au

This commit is contained in:
freearhey
2023-11-19 13:51:41 +03:00
parent 3e3687035c
commit 67d2ead6a3
3 changed files with 26 additions and 10 deletions
@@ -28,6 +28,30 @@ module.exports = {
})
return programs
},
async channels() {
const axios = require('axios')
const data = await axios
.get(
`https://tvguide.foxsports.com.au/granite-api/programmes.json?from=${dayjs().format(
'YYYY-MM-DD'
)}&to=${dayjs().add(1, 'd').format('YYYY-MM-DD')}`
)
.then(r => r.data)
.catch(console.log)
let channels = {}
data['channel-programme'].forEach(item => {
if (channels[item.channelId]) return
channels[item.channelId] = {
lang: 'en',
site_id: item.channelId,
name: item.channelName
}
})
return Object.values(channels)
}
}