Use bestaudio if available
This commit is contained in:
parent
39205ebe45
commit
442e2ec87c
1 changed files with 57 additions and 52 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue