[error} add downloader error
This commit is contained in:
parent
96399aa1b4
commit
292e25a9af
|
|
@ -120,10 +120,34 @@ class DLServices {
|
||||||
'${video.url.trim()} --sub-langs "all,-live_chat" --embed-subs --embed-thumbnail --embed-metadata --progress -o "temp/${video.filename}_$strType.%(ext)s" -f "$formatCmd"';
|
'${video.url.trim()} --sub-langs "all,-live_chat" --embed-subs --embed-thumbnail --embed-metadata --progress -o "temp/${video.filename}_$strType.%(ext)s" -f "$formatCmd"';
|
||||||
|
|
||||||
var shellLinesController = ShellLinesController();
|
var shellLinesController = ShellLinesController();
|
||||||
var shell = Shell(stdout: shellLinesController.sink, verbose: false);
|
var shellErrorController = ShellLinesController();
|
||||||
|
|
||||||
|
var shell = Shell(
|
||||||
|
stdout: shellLinesController.sink,
|
||||||
|
stderr: shellErrorController.sink,
|
||||||
|
verbose: false);
|
||||||
|
|
||||||
debugPrint('Running $ytDlpPath $command');
|
debugPrint('Running $ytDlpPath $command');
|
||||||
shell.run('$ytDlpPath $command');
|
await shell.run('$ytDlpPath $command').then((result) {
|
||||||
|
result.map((e) {
|
||||||
|
debugPrint('Analyse result: $e');
|
||||||
|
FileLogger().d('Analyse result: ${e.toString()}');
|
||||||
|
FileLogger().d('stdout: ${e.stdout}');
|
||||||
|
FileLogger().d('stderr: ${e.stderr}');
|
||||||
|
});
|
||||||
|
}).catchError((
|
||||||
|
error,
|
||||||
|
stackTrace,
|
||||||
|
) {
|
||||||
|
if (error is ShellException) {
|
||||||
|
debugPrint('ShellException: ${error.message}');
|
||||||
|
FileLogger().e('ShellException error: ${error.result?.stderr}');
|
||||||
|
FileLogger().e('ShellException out: ${error.result?.stdout}');
|
||||||
|
} else {
|
||||||
|
debugPrint('Error: $error');
|
||||||
|
FileLogger().e('Error: $error');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return shellLinesController.stream;
|
return shellLinesController.stream;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue