diff --git a/src/Types.ts b/src/Types.ts index 7709449..e686d1c 100644 --- a/src/Types.ts +++ b/src/Types.ts @@ -22,15 +22,17 @@ interface Errors { // we can't use multiline string for long errors // TODO: create better errors descriptions export const Errors: Errors = { - 22: 'FFmpeg is missing. \n' + - 'Destreamer requires a fairly recent release of FFmpeg to work properly. \n' + - 'Please install it with your preferred package manager or copy FFmpeg binary in destreamer root directory. \n', + 22: 'FFmpeg is missing.\n' + + 'Destreamer requires a fairly recent release of FFmpeg to download videos.\n' + + 'Please install it in $PATH or copy the ffmpeg binary to the root directory (next to package.json). \n', - 33: 'cannot split videoID from videUrl \n', + 33: "Can't split videoId from videoUrl\n", - 44: 'couldn\'t evaluate sessionInfo in the page \n', + 44: "Couldn't evaluate sessionInfo on the page\n", - 55: 'running in an elevated shell \n', + 55: 'Running in an elevated shell\n', - 66: 'no valid URL in the input \n' + 66: 'No valid URL in the input\n', + + 0: "Clean exit with code 0." } diff --git a/src/destreamer.ts b/src/destreamer.ts index c3316f1..87eee4f 100644 --- a/src/destreamer.ts +++ b/src/destreamer.ts @@ -65,6 +65,9 @@ async function init() { }); process.on('exit', (code) => { + if (code == 0) { + return + }; if (code in Errors) console.error(colors.bgRed(`\n\nError: ${Errors[code]} \n`)) else