mirror of
https://github.com/iptv-org/epg
synced 2026-05-07 09:57:06 -04:00
Update toonamiaftermath.com.config.js
This commit is contained in:
@@ -1,19 +1,26 @@
|
|||||||
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'
|
|
||||||
|
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
const https = require('https')
|
||||||
|
const path = require('path')
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
const API_ENDPOINT = 'https://api.toonamiaftermath.com'
|
const API_ENDPOINT = 'https://api.toonamiaftermath.com'
|
||||||
|
|
||||||
module.exports = {
|
const config = {
|
||||||
site: 'toonamiaftermath.com',
|
site: 'toonamiaftermath.com',
|
||||||
days: 3,
|
days: 3,
|
||||||
|
request: {
|
||||||
|
httpsAgent: new https.Agent({
|
||||||
|
ca: fs.readFileSync(path.resolve(__dirname, '__data__/certificate.pem'))
|
||||||
|
})
|
||||||
|
},
|
||||||
async url({ channel, date }) {
|
async url({ channel, date }) {
|
||||||
const playlists = await axios
|
const playlists = await axios
|
||||||
.get(
|
.get(
|
||||||
`${API_ENDPOINT}/playlists?scheduleName=${channel.site_id}&startDate=${date
|
`${API_ENDPOINT}/playlists?scheduleName=${channel.site_id}&startDate=${date
|
||||||
.add(1, 'd')
|
.add(1, 'd')
|
||||||
.toJSON()}&thisWeek=true&weekStartDay=monday`
|
.toJSON()}&thisWeek=true&weekStartDay=monday`,
|
||||||
|
config.request
|
||||||
)
|
)
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
@@ -58,3 +65,5 @@ function parseEpisode(item) {
|
|||||||
function parseImage(item) {
|
function parseImage(item) {
|
||||||
return item && item.info && item.info.image ? item.info.image : null
|
return item && item.info && item.info.image ? item.info.image : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = config
|
||||||
|
|||||||
Reference in New Issue
Block a user