diff --git a/src/Errors.ts b/src/Errors.ts index 2f76595..7b47ab2 100644 --- a/src/Errors.ts +++ b/src/Errors.ts @@ -1,3 +1,5 @@ +import { error } from "winston"; + /* let's start our error codes up high so we don't exit with the wrong message if other modules exit with some code */ export const enum ERROR_CODE { @@ -11,7 +13,8 @@ export const enum ERROR_CODE { NO_ENCRYPTION, ARIA2C_CRASH, NO_CONNECT_ARIA2C, - NO_DEAMON_PORT + NO_DEAMON_PORT, + MISSING_ARIA2 } @@ -24,8 +27,9 @@ export const errors: {[key: number]: string} = { [ERROR_CODE.CANCELLED_USER_INPUT]: 'Input was cancelled by user', - [ERROR_CODE.MISSING_FFMPEG]: 'FFmpeg is missing!\n' + - 'Destreamer requires a fairly recent release of FFmpeg to download videos', + [ERROR_CODE.MISSING_FFMPEG]: 'FFmpeg is missing! Destreamer requires FFmpeg to merge videos', + + [ERROR_CODE.MISSING_ARIA2]: 'FFmpeg is missing! Destreamer requires Aria2c to download videos', [ERROR_CODE.UNK_FFMPEG_ERROR]: 'Unknown FFmpeg error', diff --git a/src/Utils.ts b/src/Utils.ts index 15346b2..6d075fa 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -194,6 +194,14 @@ export function checkRequirements(): void { catch (e) { process.exit(ERROR_CODE.MISSING_FFMPEG); } + + try { + const aria2Ver: string = execSync('aria2c --version').toString().split('\n')[0]; + logger.verbose(`Using ${aria2Ver}\n`); + } + catch (e) { + process.exit(ERROR_CODE.MISSING_ARIA2); + } }