Download Tar archives from playlists

This commit is contained in:
Pierre Rudloff 2017-05-02 17:04:55 +02:00
parent e46d8544ed
commit d7927fc442
11 changed files with 419 additions and 3 deletions

View file

@ -364,4 +364,23 @@ class VideoDownload
{
return popen($this->getRtmpProcess($video)->getCommandLine(), 'r');
}
/**
* Get a Tar stream containing every video in the playlist piped through the server.
*
* @param string $video Video object returned by youtube-dl
* @param string $format Requested format
*
* @return Response HTTP response
*/
public function getPlaylistArchiveStream($video, $format)
{
$playlistItems = [];
foreach ($video->entries as $entry) {
$playlistItems[] = urlencode($entry->url);
}
$stream = fopen('playlist://'.implode(';', $playlistItems).'/'.$format, 'r');
return $stream;
}
}