Update watch.sportsnet.ca

This commit is contained in:
freearhey
2023-11-27 17:57:39 +03:00
parent c12acfec1e
commit f390955ad8
3 changed files with 48 additions and 8 deletions
@@ -25,6 +25,25 @@ module.exports = {
})
return programs
},
async channels() {
const axios = require('axios')
const html = await axios
.get(`https://watch.sportsnet.ca/schedule/tvlistings`)
.then(r => r.data)
.catch(console.log)
let [, __data] = html.match(/window\.__data \= ([^<]+)<\/script>/)
const func = new Function(`"use strict";return ${__data}`)
const data = func()
return data.cache.list['678|page_size=24'].list.items.map(item => {
return {
lang: 'en',
site_id: item.id,
name: item.title
}
})
}
}