diff --git a/classes/PlaylistArchiveStream.php b/classes/PlaylistArchiveStream.php index 3675595..78f716d 100644 --- a/classes/PlaylistArchiveStream.php +++ b/classes/PlaylistArchiveStream.php @@ -5,16 +5,16 @@ namespace Alltube; -use Barracuda\ArchiveStream\TarArchive; +use Barracuda\ArchiveStream\ZipArchive; use GuzzleHttp\Psr7\Stream; use Psr\Http\Message\StreamInterface; /** - * Class used to create a Tar archive from playlists and stream it to the browser. + * Class used to create a Zip archive from playlists and stream it to the browser. * * @link https://github.com/php-fig/http-message/blob/master/src/StreamInterface.php */ -class PlaylistArchiveStream extends TarArchive implements StreamInterface +class PlaylistArchiveStream extends ZipArchive implements StreamInterface { /** * videos to add in the archive. diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 4af49fd..8b1758e 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -380,10 +380,10 @@ class FrontController { if (isset($this->video->entries)) { $stream = new PlaylistArchiveStream($this->video); - $response = $response->withHeader('Content-Type', 'application/x-tar'); + $response = $response->withHeader('Content-Type', 'application/zip'); $response = $response->withHeader( 'Content-Disposition', - 'attachment; filename="'.$this->video->title.'.tar"' + 'attachment; filename="'.$this->video->title.'.zip"' ); return $response->withBody($stream); diff --git a/phpstan.neon b/phpstan.neon index e7225f9..0f1af62 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,4 @@ parameters: ignoreErrors: # The Archive constructor messes up the output buffering. - - '#Alltube\\PlaylistArchiveStream::__construct\(\) does not call parent constructor from Barracuda\\ArchiveStream\\TarArchive\.#' + - '#Alltube\\PlaylistArchiveStream::__construct\(\) does not call parent constructor from Barracuda\\ArchiveStream\\ZipArchive\.#'