feat: Add a way to convert an entire playlist

Closes #194
This commit is contained in:
Pierre Rudloff 2019-04-21 22:56:07 +02:00
parent 4db519c2ef
commit 70475f83d4
3 changed files with 38 additions and 5 deletions

View file

@ -6,6 +6,7 @@
namespace Alltube\Controller;
use Alltube\Config;
use Alltube\ConvertedPlaylistArchiveStream;
use Alltube\EmptyUrlException;
use Alltube\Locale;
use Alltube\LocaleManager;
@ -378,7 +379,11 @@ class FrontController
private function getStream(Request $request, Response $response)
{
if (isset($this->video->entries)) {
$stream = new PlaylistArchiveStream($this->video);
if ($request->getQueryParam('audio')) {
$stream = new ConvertedPlaylistArchiveStream($this->video);
} else {
$stream = new PlaylistArchiveStream($this->video);
}
$response = $response->withHeader('Content-Type', 'application/zip');
$response = $response->withHeader(
'Content-Disposition',