mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Update tvtv.us.config.js
This commit is contained in:
parent
4bdcdf0962
commit
ad2dd69287
1 changed files with 12 additions and 11 deletions
|
@ -21,11 +21,11 @@ module.exports = {
|
||||||
'sec-ch-ua-platform': '"Windows"'
|
'sec-ch-ua-platform': '"Windows"'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async parser({ content, request }) {
|
async parser(ctx) {
|
||||||
let programs = []
|
let programs = []
|
||||||
let queue = []
|
let queue = []
|
||||||
|
|
||||||
const items = parseItems(content)
|
const items = parseItems(ctx.content)
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
const start = dayjs(item.startTime)
|
const start = dayjs(item.startTime)
|
||||||
const stop = start.add(item.duration, 'minute')
|
const stop = start.add(item.duration, 'minute')
|
||||||
|
@ -38,15 +38,16 @@ module.exports = {
|
||||||
stop
|
stop
|
||||||
})
|
})
|
||||||
|
|
||||||
if (item.programId && !cachedPrograms[item.programId]) {
|
// NOTE: This part of the code is commented out because loading additional data leads either to error 429 Too Many Requests or to even greater delays between requests.
|
||||||
queue.push({
|
// if (item.programId && !cachedPrograms[item.programId]) {
|
||||||
programId: item.programId,
|
// queue.push({
|
||||||
url: `https://tvtv.us/api/v1/programs/${item.programId}`,
|
// programId: item.programId,
|
||||||
httpAgent: request.agent,
|
// url: `https://tvtv.us/api/v1/programs/${item.programId}`,
|
||||||
httpsAgent: request.agent,
|
// httpAgent: ctx.request.agent,
|
||||||
headers: module.exports.request.headers
|
// httpsAgent: ctx.request.agent,
|
||||||
})
|
// headers: module.exports.request.headers
|
||||||
}
|
// })
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue