Download Tar archives from playlists
This commit is contained in:
parent
e46d8544ed
commit
d7927fc442
11 changed files with 419 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue