mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update.js
This commit is contained in:
parent
0de4ee66d1
commit
4e792cbbcb
1 changed files with 20 additions and 15 deletions
|
@ -6,25 +6,30 @@ const CHANNELS_PATH = process.env.CHANNELS_PATH || 'sites/**/*.channels.xml'
|
||||||
const OUTPUT_DIR = process.env.OUTPUT_DIR || '.gh-pages/api'
|
const OUTPUT_DIR = process.env.OUTPUT_DIR || '.gh-pages/api'
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const files = await file.list(CHANNELS_PATH)
|
|
||||||
let guides = []
|
let guides = []
|
||||||
for (const filepath of files) {
|
|
||||||
const { site, channels } = await parser.parseChannels(filepath)
|
|
||||||
const dir = file.dirname(filepath)
|
|
||||||
const config = require(file.resolve(`${dir}/${site}.config.js`))
|
|
||||||
if (config.ignore) continue
|
|
||||||
|
|
||||||
const filename = file.basename(filepath)
|
try {
|
||||||
const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null]
|
const files = await file.list(CHANNELS_PATH)
|
||||||
|
for (const filepath of files) {
|
||||||
|
const { site, channels } = await parser.parseChannels(filepath)
|
||||||
|
const dir = file.dirname(filepath)
|
||||||
|
const config = require(file.resolve(`${dir}/${site}.config.js`))
|
||||||
|
if (config.ignore) continue
|
||||||
|
|
||||||
for (const channel of channels) {
|
const filename = file.basename(filepath)
|
||||||
guides.push({
|
const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null]
|
||||||
channel: channel.xmltv_id,
|
|
||||||
site,
|
for (const channel of channels) {
|
||||||
lang: channel.lang,
|
guides.push({
|
||||||
url: `https://iptv-org.github.io/epg/guides/${suffix}/${site}.epg.xml`
|
channel: channel.xmltv_id,
|
||||||
})
|
site,
|
||||||
|
lang: channel.lang,
|
||||||
|
url: `https://iptv-org.github.io/epg/guides/${suffix}/${site}.epg.xml`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
guides = _.sortBy(guides, 'channel')
|
guides = _.sortBy(guides, 'channel')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue