Merge pull request #2638 from iptv-org/belleza-cpfix

canalplus.com - Fix PL programming
This commit is contained in:
PopeyeTheSai10r 2025-01-20 16:28:31 -08:00 committed by GitHub
commit a4bd81606b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 368 additions and 131 deletions

View file

@ -9,15 +9,22 @@ module.exports = {
days: 2,
url: async function ({ channel, date }) {
const [region, site_id] = channel.site_id.split('#')
const baseUrl =
region === 'pl'
? 'https://www.canalplus.com/pl/program-tv/'
: `https://www.canalplus.com/${region}/programme-tv/`
const data = await axios
.get(`https://www.canalplus.com/${region}/programme-tv/`)
.get(baseUrl)
.then(r => r.data.toString())
.catch(err => console.log(err))
const token = parseToken(data)
const token = parseToken(data)
const path = region === 'pl' ? 'mycanalint' : 'mycanal'
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
return `https://hodor.canalplus.pro/api/v2/mycanal/channels/${token}/${site_id}/broadcasts/day/${diff}`
return `https://hodor.canalplus.pro/api/v2/${path}/channels/${token}/${site_id}/broadcasts/day/${diff}`
},
async parser({ content }) {
let programs = []