mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-14 11:00:03 -04:00
Update validate.ts
This commit is contained in:
parent
f8a4eab5e3
commit
3c84179eb6
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { Logger, Storage, Collection, Dictionary } from '@freearhey/core'
|
import { Logger, Storage, Collection, Dictionary } from '@freearhey/core'
|
||||||
import { DataLoader, DataProcessor, PlaylistParser } from '../../core'
|
import { DataLoader, DataProcessor, PlaylistParser } from '../../core'
|
||||||
import { DataProcessorData } from '../../types/dataProcessor'
|
import { DataProcessorData } from '../../types/dataProcessor'
|
||||||
import { DATA_DIR, STREAMS_DIR } from '../../constants'
|
import { DATA_DIR, ROOT_DIR } from '../../constants'
|
||||||
import { DataLoaderData } from '../../types/dataLoader'
|
import { DataLoaderData } from '../../types/dataLoader'
|
||||||
import { BlocklistRecord, Stream } from '../../models'
|
import { BlocklistRecord, Stream } from '../../models'
|
||||||
import { program } from 'commander'
|
import { program } from 'commander'
|
||||||
|
@ -30,13 +30,13 @@ async function main() {
|
||||||
}: DataProcessorData = processor.process(data)
|
}: DataProcessorData = processor.process(data)
|
||||||
|
|
||||||
logger.info('loading streams...')
|
logger.info('loading streams...')
|
||||||
const streamsStorage = new Storage(STREAMS_DIR)
|
const rootStorage = new Storage(ROOT_DIR)
|
||||||
const parser = new PlaylistParser({
|
const parser = new PlaylistParser({
|
||||||
storage: streamsStorage,
|
storage: rootStorage,
|
||||||
channelsKeyById,
|
channelsKeyById,
|
||||||
feedsGroupedByChannelId
|
feedsGroupedByChannelId
|
||||||
})
|
})
|
||||||
const files = program.args.length ? program.args : await streamsStorage.list('**/*.m3u')
|
const files = program.args.length ? program.args : await rootStorage.list('streams/**/*.m3u')
|
||||||
const streams = await parser.parse(files)
|
const streams = await parser.parse(files)
|
||||||
logger.info(`found ${streams.count()} streams`)
|
logger.info(`found ${streams.count()} streams`)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue