Skip to content

Commit

Permalink
fix canal + and dependency error (yarn)
Browse files Browse the repository at this point in the history
  • Loading branch information
BellezaEmporium committed Jan 20, 2025
1 parent 4cfed04 commit e2a21cb
Show file tree
Hide file tree
Showing 3 changed files with 343 additions and 252 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@eslint/js": "^9.17.0",
"@freearhey/core": "^0.5.0",
"@ntlab/sfetch": "^1.0.0",
"@octokit/core": "^6.1.3",
"@octokit/plugin-paginate-rest": "^11.3.6",
"@octokit/plugin-rest-endpoint-methods": "^13.2.6",
"@swc/core": "^1.10.4",
Expand All @@ -54,6 +55,7 @@
"@types/node-cleanup": "^2.1.2",
"@types/numeral": "^2.0.3",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.20.0",
"axios": "^1.5.1",
"axios-cookiejar-support": "^5.0.4",
"chalk": "^4.1.2",
Expand Down Expand Up @@ -103,6 +105,7 @@
"tough-cookie": "^5.0.0",
"transliteration": "^2.2.0",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"unzipit": "^1.4.0",
"wildcard-match": "^5.1.2"
}
Expand Down
22 changes: 18 additions & 4 deletions sites/canalplus.com/canalplus.com.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@ module.exports = {
days: 2,
url: async function ({ channel, date }) {
const [region, site_id] = channel.site_id.split('#')
const data = await axios
let data = ''
if (region === 'pl') {
data = await axios
.get('https://www.canalplus.com/pl/program-tv/')
.then(r => r.data.toString())
.catch(err => console.log(err))

const token = parseToken(data)

const diff = date.diff(dayjs.utc().startOf('d'), 'd')

return `https://hodor.canalplus.pro/api/v2/mycanalint/channels/${token}/${site_id}/broadcasts/day/${diff}`
} else {
data = await axios
.get(`https://www.canalplus.com/${region}/programme-tv/`)
.then(r => r.data.toString())
.catch(err => console.log(err))
const token = parseToken(data)
const token = parseToken(data)

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/mycanal/channels/${token}/${site_id}/broadcasts/day/${diff}`
return `https://hodor.canalplus.pro/api/v2/mycanal/channels/${token}/${site_id}/broadcasts/day/${diff}`
}
},
async parser({ content }) {
let programs = []
Expand Down
Loading

0 comments on commit e2a21cb

Please sign in to comment.