fix: Fix downloading a playlist as a TAR archive
This is the only time where youtube-dl returning an empty URL is not a problem.
This commit is contained in:
parent
17b9185e53
commit
edf4d4644d
3 changed files with 30 additions and 6 deletions
|
@ -6,6 +6,7 @@
|
|||
namespace Alltube\Controller;
|
||||
|
||||
use Alltube\Config;
|
||||
use Alltube\EmptyUrlException;
|
||||
use Alltube\Locale;
|
||||
use Alltube\LocaleManager;
|
||||
use Alltube\PasswordException;
|
||||
|
@ -456,11 +457,19 @@ class FrontController
|
|||
*/
|
||||
private function getRedirectResponse($url, $format, Response $response, Request $request)
|
||||
{
|
||||
$videoUrls = $this->download->getURL(
|
||||
$url,
|
||||
$format,
|
||||
$this->sessionSegment->getFlash($url)
|
||||
);
|
||||
try {
|
||||
$videoUrls = $this->download->getURL(
|
||||
$url,
|
||||
$format,
|
||||
$this->sessionSegment->getFlash($url)
|
||||
);
|
||||
} catch (EmptyUrlException $e) {
|
||||
/*
|
||||
If this happens it is probably a playlist
|
||||
so it will either be handle by getStream() or throw an exception anyway.
|
||||
*/
|
||||
$videoUrls = [];
|
||||
}
|
||||
if (count($videoUrls) > 1) {
|
||||
return $this->getRemuxStream($videoUrls, $format, $response, $request);
|
||||
} elseif ($this->config->stream) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue