mirror of
https://github.com/iptv-org/iptv
synced 2025-12-18 11:27:34 -05:00
Update scripts/
This commit is contained in:
@@ -5,8 +5,9 @@ import { Stream, Playlist } from '../../models'
|
|||||||
import { program } from 'commander'
|
import { program } from 'commander'
|
||||||
import { DataLoaderData } from '../../types/dataLoader'
|
import { DataLoaderData } from '../../types/dataLoader'
|
||||||
import { DataProcessorData } from '../../types/dataProcessor'
|
import { DataProcessorData } from '../../types/dataProcessor'
|
||||||
|
import path from 'node:path'
|
||||||
|
|
||||||
program.argument('[filepath]', 'Path to file to validate').parse(process.argv)
|
program.argument('[filepath...]', 'Path to file to format').parse(process.argv)
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const logger = new Logger()
|
const logger = new Logger()
|
||||||
@@ -27,7 +28,8 @@ async function main() {
|
|||||||
feedsGroupedByChannelId,
|
feedsGroupedByChannelId,
|
||||||
logosGroupedByStreamId
|
logosGroupedByStreamId
|
||||||
})
|
})
|
||||||
const files = program.args.length ? program.args : await streamsStorage.list('**/*.m3u')
|
let files = program.args.length ? program.args : await streamsStorage.list('**/*.m3u')
|
||||||
|
files = files.map((filepath: string) => path.basename(filepath))
|
||||||
let streams = await parser.parse(files)
|
let streams = await parser.parse(files)
|
||||||
|
|
||||||
logger.info(`found ${streams.count()} streams`)
|
logger.info(`found ${streams.count()} streams`)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ let streams = new Collection()
|
|||||||
let isLiveUpdateEnabled = true
|
let isLiveUpdateEnabled = true
|
||||||
|
|
||||||
program
|
program
|
||||||
.argument('[filepath]', 'Path to file to validate')
|
.argument('[filepath...]', 'Path to file to test')
|
||||||
.option(
|
.option(
|
||||||
'-p, --parallel <number>',
|
'-p, --parallel <number>',
|
||||||
'Batch size of streams to test concurrently',
|
'Batch size of streams to test concurrently',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { BlocklistRecord, Stream } from '../../models'
|
|||||||
import { program } from 'commander'
|
import { program } from 'commander'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
|
|
||||||
program.argument('[filepath]', 'Path to file to validate').parse(process.argv)
|
program.argument('[filepath...]', 'Path to file to validate').parse(process.argv)
|
||||||
|
|
||||||
type LogItem = {
|
type LogItem = {
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
Reference in New Issue
Block a user