Update chaines-tv.orange.fr

This commit is contained in:
freearhey
2023-11-18 17:03:04 +03:00
parent 80650a2737
commit a891187dc5
3 changed files with 321 additions and 197 deletions
@@ -1,3 +1,4 @@
const axios = require('axios')
const dayjs = require('dayjs')
module.exports = {
@@ -25,6 +26,26 @@ module.exports = {
})
return programs
},
async channels() {
const html = await axios
.get(`https://chaines-tv.orange.fr/programme-tv?filtres=all`)
.then(r => r.data)
.catch(console.log)
const [, nuxtFunc] = html.match(/window\.__NUXT__=([^<]+)/) || [null, null]
const func = new Function(`"use strict";return ${nuxtFunc}`)
const data = func()
const items = data.state.channels.channels
return items.map(item => {
return {
lang: 'fr',
site_id: item.idEPG,
name: item.name
}
})
}
}