mirror of
https://github.com/snobu/destreamer.git
synced 2026-02-27 08:48:23 +00:00
check for aria existance
changed ffmpeg error message
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { error } from "winston";
|
||||||
|
|
||||||
/* let's start our error codes up high so we
|
/* let's start our error codes up high so we
|
||||||
don't exit with the wrong message if other modules exit with some code */
|
don't exit with the wrong message if other modules exit with some code */
|
||||||
export const enum ERROR_CODE {
|
export const enum ERROR_CODE {
|
||||||
@@ -11,7 +13,8 @@ export const enum ERROR_CODE {
|
|||||||
NO_ENCRYPTION,
|
NO_ENCRYPTION,
|
||||||
ARIA2C_CRASH,
|
ARIA2C_CRASH,
|
||||||
NO_CONNECT_ARIA2C,
|
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.CANCELLED_USER_INPUT]: 'Input was cancelled by user',
|
||||||
|
|
||||||
[ERROR_CODE.MISSING_FFMPEG]: 'FFmpeg is missing!\n' +
|
[ERROR_CODE.MISSING_FFMPEG]: 'FFmpeg is missing! Destreamer requires FFmpeg to merge videos',
|
||||||
'Destreamer requires a fairly recent release of FFmpeg to download videos',
|
|
||||||
|
[ERROR_CODE.MISSING_ARIA2]: 'FFmpeg is missing! Destreamer requires Aria2c to download videos',
|
||||||
|
|
||||||
[ERROR_CODE.UNK_FFMPEG_ERROR]: 'Unknown FFmpeg error',
|
[ERROR_CODE.UNK_FFMPEG_ERROR]: 'Unknown FFmpeg error',
|
||||||
|
|
||||||
|
|||||||
@@ -194,6 +194,14 @@ export function checkRequirements(): void {
|
|||||||
catch (e) {
|
catch (e) {
|
||||||
process.exit(ERROR_CODE.MISSING_FFMPEG);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user