mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -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 => {
|
||||
const site = sites[channel.site]
|
||||
dates.forEach(date => {
|
||||
const url = site.url({ date, channel })
|
||||
const promise = client.get(url).catch(console.log)
|
||||
|
||||
requests.push({
|
||||
url,
|
||||
site,
|
||||
channel,
|
||||
promise
|
||||
url: site.url({ date, channel }),
|
||||
channel
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
let programs = []
|
||||
for (let request of requests) {
|
||||
const progs = await request.promise
|
||||
const progs = await client
|
||||
.get(request.url)
|
||||
.then(response => {
|
||||
const channel = request.channel
|
||||
const site = sites[channel.site]
|
||||
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))
|
||||
.catch(console.log)
|
||||
|
||||
programs = programs.concat(progs)
|
||||
}
|
||||
|
||||
const xml = utils.convertToXMLTV({ channels, programs })
|
||||
fs.writeFileSync(path.resolve(__dirname, config.filename), xml)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue