fix: Throw an exception when trying to download DASH with ffmpeg
Fallback to default format when we can't download bestaudio Fixes #165
This commit is contained in:
parent
38e31c39f1
commit
2b316d4e8d
3 changed files with 18 additions and 1 deletions
|
@ -228,7 +228,11 @@ class FrontController
|
|||
$response = $response->withHeader('Content-Type', 'audio/mpeg');
|
||||
|
||||
if ($request->isGet() || $request->isPost()) {
|
||||
$process = $this->download->getAudioStream($params['url'], 'bestaudio/best', $password);
|
||||
try {
|
||||
$process = $this->download->getAudioStream($params['url'], 'bestaudio/best', $password);
|
||||
} catch (Exception $e) {
|
||||
$process = $this->download->getAudioStream($params['url'], $this->defaultFormat, $password);
|
||||
}
|
||||
$response = $response->withBody(new Stream($process));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue