mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 10:56:57 -05:00
Update grab.ts
This commit is contained in:
@@ -133,12 +133,13 @@ async function main() {
|
|||||||
|
|
||||||
siteConfig.filepath = channel.getConfigPath()
|
siteConfig.filepath = channel.getConfigPath()
|
||||||
|
|
||||||
if (options.timeout !== undefined) {
|
if (typeof options.timeout === 'number') {
|
||||||
siteConfig.request = { ...siteConfig.request, ...{ timeout: options.timeout } }
|
siteConfig.request = { ...siteConfig.request, ...{ timeout: options.timeout } }
|
||||||
}
|
}
|
||||||
if (options.delay !== undefined) siteConfig.delay = options.delay
|
if (typeof options.days === 'number') siteConfig.days = options.days
|
||||||
if (options.curl !== undefined) siteConfig.curl = options.curl
|
if (typeof options.delay === 'number') siteConfig.delay = options.delay
|
||||||
if (options.proxy !== undefined) {
|
if (typeof options.curl === 'boolean') siteConfig.curl = options.curl
|
||||||
|
if (typeof options.proxy === 'string') {
|
||||||
const proxy = parseProxy(options.proxy)
|
const proxy = parseProxy(options.proxy)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -158,9 +159,8 @@ async function main() {
|
|||||||
|
|
||||||
if (!channel.xmltv_id) channel.xmltv_id = channel.site_id
|
if (!channel.xmltv_id) channel.xmltv_id = channel.site_id
|
||||||
|
|
||||||
const days = options.days || siteConfig.days || 1
|
|
||||||
const currDate = dayjs.utc(process.env.CURR_DATE || new Date().toISOString())
|
const currDate = dayjs.utc(process.env.CURR_DATE || new Date().toISOString())
|
||||||
const dates = Array.from({ length: days }, (_, day) => currDate.add(day, 'd'))
|
const dates = Array.from({ length: siteConfig.days }, (_, day) => currDate.add(day, 'd'))
|
||||||
|
|
||||||
dates.forEach((date: Dayjs) => {
|
dates.forEach((date: Dayjs) => {
|
||||||
const key = `${channel.site}:${channel.lang}:${channel.xmltv_id}:${date.toJSON()}`
|
const key = `${channel.site}:${channel.lang}:${channel.xmltv_id}:${date.toJSON()}`
|
||||||
|
|||||||
Reference in New Issue
Block a user