Display error message (fixes #1)

This commit is contained in:
Pierre Rudloff 2014-03-18 15:08:16 +01:00
parent 0651377e93
commit efcf786b44
2 changed files with 9 additions and 5 deletions

View file

@ -124,12 +124,16 @@ Class VideoDownload
if (isset($format)) {
$cmd .= ' -f '.escapeshellarg($format);
}
$cmd .=' --dump-json '.escapeshellarg($url);
$cmd .=' --dump-json '.escapeshellarg($url)." 2>&1";
exec(
$cmd,
$json
$json, $code
);
return $json[0];
if ($code>0) {
return array('success'=>false, 'error'=>$json);
} else {
return json_decode($json[0]);
}
}
/**