Files
ion-cli/anime/downloadVideo.js
2023-02-26 19:23:03 -05:00

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}`));
}
}