mirror of
https://github.com/ION606/ion-cli.git
synced 2026-05-14 22:16:56 +00:00
17 lines
484 B
JavaScript
17 lines
484 B
JavaScript
import { execFileSync } from 'child_process';
|
|
import { getJSON } from '../utils/JSON.js';
|
|
import chalk from 'chalk';
|
|
|
|
export default async function donwloadFromStream(url) {
|
|
try {
|
|
const vpath = await getJSON("vpath");
|
|
// start "C:\Program Files\VideoLAN\VLC\vlc.exe" url
|
|
|
|
execFileSync(vpath, [url], {
|
|
stdio: ['ignore']
|
|
});
|
|
} catch (err) {
|
|
console.error(err);
|
|
console.log(chalk.red(`ERROR:\n${err.message}`));
|
|
}
|
|
} |