mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update scripts
This commit is contained in:
parent
37664b49b9
commit
5dd131e2d3
15 changed files with 274 additions and 204 deletions
|
@ -2,10 +2,11 @@ import { Logger, Storage, Collection } from '@freearhey/core'
|
|||
import { ChannelsParser } from '../../core'
|
||||
import path from 'path'
|
||||
import { SITES_DIR, API_DIR } from '../../constants'
|
||||
import { Channel } from 'epg-grabber'
|
||||
import epgGrabber from 'epg-grabber'
|
||||
|
||||
type OutputItem = {
|
||||
channel: string | null
|
||||
feed: string | null
|
||||
site: string
|
||||
site_id: string
|
||||
site_name: string
|
||||
|
@ -31,9 +32,13 @@ async function main() {
|
|||
|
||||
logger.info(` found ${parsedChannels.count()} channel(s)`)
|
||||
|
||||
const output = parsedChannels.map((channel: Channel): OutputItem => {
|
||||
const output = parsedChannels.map((channel: epgGrabber.Channel): OutputItem => {
|
||||
const xmltv_id = channel.xmltv_id || ''
|
||||
const [channelId, feedId] = xmltv_id.split('@')
|
||||
|
||||
return {
|
||||
channel: channel.xmltv_id || null,
|
||||
channel: channelId || null,
|
||||
feed: feedId || null,
|
||||
site: channel.site || '',
|
||||
site_id: channel.site_id || '',
|
||||
site_name: channel.name,
|
||||
|
|
|
@ -7,6 +7,7 @@ async function main() {
|
|||
|
||||
const requests = [
|
||||
client.download('channels.json'),
|
||||
client.download('feeds.json'),
|
||||
client.download('countries.json'),
|
||||
client.download('regions.json'),
|
||||
client.download('subdivisions.json')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue