Merge pull request #780 from iptv-org/fix-canalplus.com

Fix canalplus.com
This commit is contained in:
Aleksandr Statciuk
2022-05-08 14:23:29 +03:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -1,13 +1,17 @@
const dayjs = require('dayjs')
const axios = require('axios')
// TODO: calculate API_KEY based on the current date
//
// const API_KEY = 'f55e5c7ddf0afba59d1c64581358910d' // 03.2022
const API_KEY = 'c71b6b8eb30125dab9d10a3850131ac6' // 05.2022
module.exports = {
site: 'canalplus.com',
ignore: true, // server returns HTTP error 401 (https://github.com/iptv-org/epg/runs/5746477292?check_suite_focus=true)
url: function ({ channel, date }) {
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
return `https://hodor.canalplus.pro/api/v2/mycanal/channels/f55e5c7ddf0afba59d1c64581358910d/${channel.site_id}/broadcasts/day/${diff}`
return `https://hodor.canalplus.pro/api/v2/mycanal/channels/${API_KEY}/${channel.site_id}/broadcasts/day/${diff}`
},
async parser({ content }) {
let programs = []

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="canalplus.com">
<channels>
<channel lang="fr" xmltv_id="3sat.de" site_id="780">3 SAT</channel>
<channel lang="fr" xmltv_id="6ter.fr" site_id="521">6TER</channel>
<channel lang="fr" xmltv_id="AB1.fr" site_id="611">AB1</channel>
<channel lang="fr" xmltv_id="Action.fr" site_id="504">ACTION</channel>
@@ -218,8 +217,6 @@
<channel lang="fr" xmltv_id="TMC.fr" site_id="584">TMC</channel>
<channel lang="fr" xmltv_id="ToonamiFrance.fr" site_id="683">TOONAMI</channel>
<channel lang="fr" xmltv_id="ToutelHistoire.fr" site_id="620">TOUTE L&apos;HISTOIRE</channel>
<channel lang="fr" xmltv_id="TraceAfricaFrench.fr" site_id="674">TRACE AFRICA</channel>
<channel lang="fr" xmltv_id="TraceLatina.fr" site_id="784">TRACE LATINA</channel>
<channel lang="fr" xmltv_id="TraceUrban.fr" site_id="585">TRACE URBAN</channel>
<channel lang="fr" xmltv_id="TV5MondeFranceBelgiqueSuisse.fr" site_id="520">TV5 MONDE</channel>
<channel lang="fr" xmltv_id="TVBreizh.fr" site_id="586">TV BREIZH</channel>