mirror of
https://github.com/iptv-org/epg
synced 2026-05-09 02:47:00 -04:00
properly check country for c+ epg
This commit is contained in:
@@ -77,11 +77,15 @@ module.exports = {
|
|||||||
days: 2,
|
days: 2,
|
||||||
url: async function ({ channel, date }) {
|
url: async function ({ channel, date }) {
|
||||||
const [region, site_id] = channel.site_id.split('#')
|
const [region, site_id] = channel.site_id.split('#')
|
||||||
if(!canalToken[region]) canalToken[region] = await parseToken(region || 'fr')
|
const currentRegion = region || 'fr'
|
||||||
const path = region === 'pl' ? 'mycanalint' : 'mycanal'
|
if(!canalToken[currentRegion] || canalToken.lastRegion !== currentRegion) {
|
||||||
|
canalToken[currentRegion] = await parseToken(currentRegion)
|
||||||
|
canalToken.lastRegion = currentRegion
|
||||||
|
}
|
||||||
|
const path = currentRegion === 'pl' ? 'mycanalint' : 'mycanal'
|
||||||
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
||||||
|
|
||||||
return `https://hodor.canalplus.pro/api/v2/${path}/channels/${canalToken[region].token}/${site_id}/broadcasts/day/${diff}`
|
return `https://hodor.canalplus.pro/api/v2/${path}/channels/${canalToken[currentRegion].token}/${site_id}/broadcasts/day/${diff}`
|
||||||
},
|
},
|
||||||
request:{
|
request:{
|
||||||
headers() {
|
headers() {
|
||||||
|
|||||||
Reference in New Issue
Block a user