Finished? The 'anime' command

This commit is contained in:
Itamar Oren
2023-02-26 17:59:11 -05:00
parent a1db1a1400
commit 7fc72d7c01
7 changed files with 891 additions and 25 deletions
+20
View File
@@ -0,0 +1,20 @@
import { execFileSync } from 'child_process';
import { getJSON } from '../utils/JSON.js';
import chalk from 'chalk';
export default async function donwloadFromStream(url, newpath) {
try {
const vpath = await getJSON("vpath");
const command = `${vpath} ${url}`;
// start "C:\Program Files\VideoLAN\VLC\vlc.exe" url
console.log(chalk.green('done! Hit enter to watch!'));
console.log(command);
execFileSync(vpath, [url], {
stdio: ['ignore']
});
} catch (err) {
console.error(err);
console.log(chalk.red(`ERROR:\n${err.message}`));
}
}