display error message when youtube-dl is not properly installed or has no executable permission

This commit is contained in:
huangjx
2021-12-02 22:55:32 +08:00
parent f983d18965
commit 19b2b5739b

View File

@@ -81,7 +81,7 @@ class YoutubeController extends Controller
$yt = $this->youtube;
$yt->audioOnly = (bool) $this->request->getParam('audio-only');
if (!$yt->isInstalled()) {
return new JSONResponse($this->installYTD());
return new JSONResponse(["error" => "Youtube-dl is not installed!"]);
}
if (Helper::isGetUrlSite($url)) {
return new JSONResponse($this->downloadUrlSite($url));