Use bestaudio if available

This commit is contained in:
Pierre Rudloff 2016-04-10 19:41:25 +02:00
parent 39205ebe45
commit 442e2ec87c

View file

@ -112,6 +112,10 @@ class FrontController
if (isset($params["url"])) { if (isset($params["url"])) {
if (isset($params['audio'])) { if (isset($params['audio'])) {
try { try {
try {
$url = $this->download->getURL($params["url"], 'bestaudio');
return $response->withRedirect($url);
} catch (\Exception $e) {
$video = $this->download->getJSON($params["url"]); $video = $this->download->getJSON($params["url"]);
//Vimeo needs a correct user-agent //Vimeo needs a correct user-agent
@ -167,6 +171,7 @@ class FrontController
); );
exit; exit;
} }
}
} catch (\Exception $e) { } catch (\Exception $e) {
$error = $e->getMessage(); $error = $e->getMessage();
} }