mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 01:20:08 -04:00
wip
This commit is contained in:
parent
96eb13d2e6
commit
6e4add9c92
2 changed files with 11396 additions and 1126 deletions
12504
.gh-pages/guide_ru.xml
12504
.gh-pages/guide_ru.xml
File diff suppressed because it is too large
Load diff
|
@ -38,30 +38,30 @@ async function main() {
|
||||||
channels.forEach(channel => {
|
channels.forEach(channel => {
|
||||||
const site = sites[channel.site]
|
const site = sites[channel.site]
|
||||||
dates.forEach(date => {
|
dates.forEach(date => {
|
||||||
const url = site.url({ date, channel })
|
|
||||||
const promise = client.get(url).catch(console.log)
|
|
||||||
|
|
||||||
requests.push({
|
requests.push({
|
||||||
url,
|
url: site.url({ date, channel }),
|
||||||
site,
|
channel
|
||||||
channel,
|
|
||||||
promise
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
let programs = []
|
let programs = []
|
||||||
for (let request of requests) {
|
for (let request of requests) {
|
||||||
const progs = await request.promise
|
const progs = await client
|
||||||
|
.get(request.url)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const channel = request.channel
|
const channel = request.channel
|
||||||
|
const site = sites[channel.site]
|
||||||
console.log(`${channel.site} - ${channel.xmltv_id}`)
|
console.log(`${channel.site} - ${channel.xmltv_id}`)
|
||||||
|
|
||||||
return request.site.parser({ channel, content: response.data })
|
return site.parser({ channel, content: response.data })
|
||||||
})
|
})
|
||||||
.then(utils.sleep(3000))
|
.then(utils.sleep(3000))
|
||||||
|
.catch(console.log)
|
||||||
|
|
||||||
programs = programs.concat(progs)
|
programs = programs.concat(progs)
|
||||||
}
|
}
|
||||||
|
|
||||||
const xml = utils.convertToXMLTV({ channels, programs })
|
const xml = utils.convertToXMLTV({ channels, programs })
|
||||||
fs.writeFileSync(path.resolve(__dirname, config.filename), xml)
|
fs.writeFileSync(path.resolve(__dirname, config.filename), xml)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue