Update tv.trueid.net

This commit is contained in:
freearhey
2023-11-30 22:19:43 +03:00
parent d2728dc3db
commit 4c184e9cbe
4 changed files with 185 additions and 95 deletions
@@ -27,6 +27,35 @@ module.exports = {
})
return programs
},
async channels({ token }) {
const axios = require('axios')
const ACCESS_TOKEN =
'MTM4MDY0NGUwZjFmYjZiMTRjODI4OTRhMGM2ODJkMTQ3ZTAxNWM5ZDoxZmI2YjE0YzgyODk0YTBjNjgyZDE0N2UwMTVjOWQ='
const data = await axios
.get(`https://tv.trueid.net/api/channel/getChannelListByAllCate`, {
params: {
lang: 'en',
country: 'th'
},
headers: {
authorization: `Basic ${ACCESS_TOKEN}`
}
})
.then(r => r.data)
.catch(console.log)
return data.data.channelsList
.find(i => i.catSlug === 'TrueID : All')
.channels.map(item => {
return {
lang: 'th',
site_id: item.slug,
name: item.title
}
})
}
}